These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | #!/usr/bin/env php |
||
2 | <?php |
||
3 | |||
4 | $phar = new Phar('checker.phar', 0, 'checker.phar'); |
||
5 | // start buffering. Mandatory to modify stub. |
||
6 | $phar->startBuffering(); |
||
7 | |||
8 | // Get the default stub. You can create your own if you have specific needs |
||
9 | $defaultStub = $phar->createDefaultStub('checker'); |
||
10 | |||
11 | // Adding files |
||
12 | $phar->buildFromDirectory(__DIR__); |
||
13 | // $phar->buildFromDirectory(__DIR__, '/\.php$/'); |
||
0 ignored issues
–
show
|
|||
14 | |||
15 | // Create a custom stub to add the shebang |
||
16 | // $stub = "#!/usr/bin/env php \n".$defaultStub; |
||
17 | $stub = "#!/usr/bin/env php \n".$defaultStub; |
||
18 | |||
19 | // Add the stub |
||
20 | $phar->setStub($stub); |
||
21 | |||
22 | $phar->stopBuffering(); |
||
23 | |||
24 | echo "checker.phar archive has been saved" . PHP_EOL; |
||
25 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.