mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
add phpstan and fix few php-cs-fixer
This commit is contained in:
parent
cf1746ff13
commit
d3408e0600
3 changed files with 44 additions and 1 deletions
|
@ -7,7 +7,7 @@
|
||||||
'Args :' . "\n" .
|
'Args :' . "\n" .
|
||||||
' - help : Show help message.' . "\n" .
|
' - help : Show help message.' . "\n" .
|
||||||
' - lint : Show coding standards to fix.' . "\n" .
|
' - lint : Show coding standards to fix.' . "\n" .
|
||||||
' - help : Fix coding standards.' . "\n";
|
' - fix : Fix coding standards.' . "\n";
|
||||||
|
|
||||||
exit(100);
|
exit(100);
|
||||||
}
|
}
|
||||||
|
|
BIN
tests/phpstan/phpstan.phar
Executable file
BIN
tests/phpstan/phpstan.phar
Executable file
Binary file not shown.
43
tests/phpstan/run.php
Executable file
43
tests/phpstan/run.php
Executable file
|
@ -0,0 +1,43 @@
|
||||||
|
#!/usr/bin/php
|
||||||
|
<?php
|
||||||
|
function help ()
|
||||||
|
{
|
||||||
|
echo 'Usage : ' . __FILE__ . ' <arg>' . "\n" .
|
||||||
|
'Args :' . "\n" .
|
||||||
|
' - help : Show help message.' . "\n" .
|
||||||
|
' - analyse : Analyse code with phpstan.' . "\n";
|
||||||
|
|
||||||
|
exit(100);
|
||||||
|
}
|
||||||
|
|
||||||
|
$analyse_commands = [
|
||||||
|
'php ' . __DIR__ . '/phpstan.phar analyse --autoload-file=' . __DIR__ . '/../../descartes/load.php ' . __DIR__ . '/../../controllers/',
|
||||||
|
'php ' . __DIR__ . '/phpstan.phar analyse --autoload-file=' . __DIR__ . '/../../descartes/load.php ' . __DIR__ . '/../../models/',
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
if (count($argv) < 2 || $argv[1] === 'help')
|
||||||
|
{
|
||||||
|
help();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($argv[1] === 'analyse')
|
||||||
|
{
|
||||||
|
echo "######################" . "\n";
|
||||||
|
echo "# SHOW ERRORS TO FIX #" . "\n";
|
||||||
|
echo "######################" . "\n";
|
||||||
|
echo "\n";
|
||||||
|
|
||||||
|
foreach ($analyse_commands as $analyse_command)
|
||||||
|
{
|
||||||
|
echo "Run : " . $analyse_command . " \n";
|
||||||
|
$return = shell_exec($analyse_command);
|
||||||
|
echo $return;
|
||||||
|
echo "\n\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Invalid arg : " . $argv[1] . "\n";
|
||||||
|
help();
|
Loading…
Add table
Add a link
Reference in a new issue