dev-master
9999999-dev
GPL-3.0+
The Requires
The Development Requires
by Andreas Lutro
Phint is a static code analysis tool for PHP. Very much a work in progress. Currently checks for:, (*2)
instanceof
)catch (stdClass $e)
will error, for example)More features to come. Check the Github issues., (*3)
On a per-project basis:, (*4)
composer require --dev anlutro/phint:dev-master@dev ./vendor/bin/phint /path/to/src
Globally:, (*5)
wget https://files.lutro.me/phint.phar chmod +x phint.phar sudo mv phint.phar /usr/local/bin phint /path/to/src
Note that you must be in your project's root for Phint to run. You also need a composer autoloader to be present in vendor/autoload.php
., (*6)
Example output from a simple command run:, (*7)
, (*8)
You can pass --strict
or -s
as an arugment to get more errors. The errors marked as strict are more prone to be wrong, but should be more accurate as time goes on., (*9)
You can also pass --debug
or -d
to get some debug information. Currently this isn't much, unless you hit a fatal error, in which case you might get some more info., (*10)
By default, if you pass a directory or multiple file paths to the command, Phint will analyze all of them and spit out the errors as it goes along. If you pass --exit-early
or -e
, Phint will exit as soon as it finds a file with errors., (*11)
This tool makes some very heavy assumptions about how you're using it and your application., (*12)
Your project must have some sort of autoloader register script present in vendor/autoload.php
. This autoloader must make every class and function in your project available., (*13)
The checker works best if all the files being checked are classes with methods, nothing more., (*14)
See the CONTRIBUTING.md file for information on contributing., (*15)
The contents of this repository is released under the GPL v3 license. See the LICENSE file included for more information., (*16)
GPL-3.0+