fix codestyle

This commit is contained in:
osaajani 2020-06-23 21:06:13 +02:00
parent 350dbb5b59
commit adef27f862
37 changed files with 556 additions and 488 deletions

View file

@ -1,7 +1,7 @@
#!/usr/bin/php
<?php
function help ()
function help()
{
echo 'Usage : ' . __FILE__ . ' <arg>' . "\n" .
'Args :' . "\n" .
@ -15,52 +15,51 @@
$lint_commands = [
'php ' . __DIR__ . '/php-cs-fixer.phar -v --dry-run --config="' . __DIR__ . '/php_cs.config" fix',
];
$fix_commands = [
'php ' . __DIR__ . '/php-cs-fixer.phar --config="' . __DIR__ . '/php_cs.config" fix',
];
if (count($argv) < 2 || $argv[1] === 'help')
if (count($argv) < 2 || 'help' === $argv[1])
{
help();
}
if ($argv[1] === 'lint')
if ('lint' === $argv[1])
{
echo "######################" . "\n";
echo "# SHOW ERRORS TO FIX #" . "\n";
echo "######################" . "\n";
echo '######################' . "\n";
echo '# SHOW ERRORS TO FIX #' . "\n";
echo '######################' . "\n";
echo "\n";
foreach ($lint_commands as $lint_command)
{
echo "Run : " . $lint_command . " \n";
echo 'Run : ' . $lint_command . " \n";
$return = shell_exec($lint_command);
echo $return;
echo "\n\n";
}
exit(0);
}
if ($argv[1] === 'fix')
if ('fix' === $argv[1])
{
echo "##############" . "\n";
echo "# FIX ERRORS #" . "\n";
echo "##############" . "\n";
echo '##############' . "\n";
echo '# FIX ERRORS #' . "\n";
echo '##############' . "\n";
echo "\n";
foreach ($fix_commands as $fix_command)
{
echo "Run : " . $fix_command . " \n";
echo 'Run : ' . $fix_command . " \n";
$return = shell_exec($fix_command);
echo $return;
echo "\n\n";
}
exit(0);
}
echo "Invalid arg : " . $argv[1] . "\n";
echo 'Invalid arg : ' . $argv[1] . "\n";
help();