diff --git a/broken.php b/broken.php new file mode 100644 index 0000000..ea20ec1 --- /dev/null +++ b/broken.php @@ -0,0 +1,3 @@ + /dev/null; echo $? + php -l valid.php > /dev/null; echo $? + + find localPackages/ -name \*.php | parallel --gnu php -d display_errors=stderr -l {} > /dev/null \; + +* PHP Code Sniffer + Checks for Coding Guideline, best practices like no debugging code. + + Extendable, Multiple languages, php, js, typoscript, … + Lint and fix. + Integrated into IDEs, Editors and CI. + +* PHPMD + https://phpmd.org/ + https://phpmd.org/rules/index.html + +* phpstan + https://github.com/phpstan/phpstan + https://packagist.org/packages/saschaegerer/phpstan-typo3 + + PHP >= 7.1 + No configuration necessary + +* phan + https://github.com/phan/phan + + Awesome, but needs configuration file. + +* https://phpqa.io/ + +* https://www.owasp.org/index.php/OWASP_WAP-Web_Application_Protection + +TypoScript +^^^^^^^^^^ + +https://github.com/martin-helmich/typo3-typoscript-lint + +XML / XLIFF +^^^^^^^^^^^ + +http://xmlsoft.org/xmllint.html + +JSON / composer.json +^^^^^^^^^^^^^^^^^^^^ + +`composer validate` + +YAML (Form extension) +^^^^^^^^^^^^^^^^^^^^^ + +https://github.com/adrienverge/yamllint + +Summary +------- + +Check out possible linter. Integrate linter in CI, optionally also in local IDEs +/editors. + +Prevent "dumb" issues like invalid PHP syntax. + +Prevent some security issues. + +Further reading +--------------- + +* https://www.owasp.org/index.php/Static_Code_Analysis + +* https://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis + +* https://phpqa.io/ diff --git a/valid.php b/valid.php new file mode 100644 index 0000000..c656e65 --- /dev/null +++ b/valid.php @@ -0,0 +1,3 @@ +