Slide 1

Slide 1 text

PHP_CodeSniffer: ask me anything session Juliette Reinders Folmer Tweet/toot about it: @jrf_nl #010PHP

Slide 2

Slide 2 text

PHP CodeSniffer by and PHPCSStandards

Slide 3

Slide 3 text

Justin Luebke

Slide 4

Slide 4 text

GlennForrest

Slide 5

Slide 5 text

Static Analysis ▪ Tokenizes ▪ Per file ▪ Light weight Dynamic Analysis ▪ Parses ▪ Across files

Slide 6

Slide 6 text

Psalm CS- Fixer PHP Stan PHP CS Exakat PHP CPD PHP Insights PHP MD Phan Rector PHP DCD Static Analysis Tools PHP MND

Slide 7

Slide 7 text

Brief (Re-)Introduction to PHP_CodeSniffer Nightsabre

Slide 8

Slide 8 text

Code Style Documentation Code Smells Code Metrics Best Practices Code Compatibility

Slide 9

Slide 9 text

How It Works Standard (ruleset) Sniffs Checks (errorcodes)

Slide 10

Slide 10 text

“ The nice thing about standards is that there are so many to choose from.

Slide 11

Slide 11 text

PHPCS Build-in Standards PEAR PSR1 PSR2 Zend MySource Squiz PSR12 Generic

Slide 12

Slide 12 text

Framework/CMS Standards Laravel Joomla Symfony2 CodeIgniter4 Drupal Magento WordPress MediaWiki Zend Framework (WebImpress) TYPO3 Yii CakePHP

Slide 13

Slide 13 text

Functional Standards and Sniff Collections Object Calisthenics Variable Analysis Universal Slevomat Cognitive Complexity PHP Compatibility Import Detection Security Audit Normalized Arrays PHPCSExtra Modernize

Slide 14

Slide 14 text

Open Floor Clodiney Cruz

Slide 15

Slide 15 text

Thanks! Slides: https://speakerdeck.com/jrf Follow me: https://phpcs.social/@jrf_nl https://twitter.com/jrf_nl https://github.com/jrfnl Fund PHPCS (or me) ;-) https://opencollective.com/ php_codesniffer https://github.com/sponsors/jrfnl