Who Am I?
Joe Ferguson
Senior Full Stack Developer @ Preteckt
Twitter: @JoePFerguson
OSMI Board Member
The Joindin Foundation & Joindin
Leadership Team
Slide 3
Slide 3 text
Agenda
Review a basic PHP package
Discuss Static Analysis and demo tools
Demo tools on a real world application
Add some new(ish) PHP 7.x features to
improve analysis results
Slide 4
Slide 4 text
PHP-Easy-Math
Simple example
Addition Class
Subtraction Class
All methods unit tested
Slide 5
Slide 5 text
Shameless Plug
phparch.com/article/artisinal-producing-packages-part-one/
Artisinal:
Producing Packages, Part One
Running Phan
./vendor/bin/phan
PhanTypeMismatchDeclaredReturn Doc-block of add contains
declared return type float which is incompatible with the return type
int declared in the signature
Slide 44
Slide 44 text
Running PHPStan
./vendor/bin/phpstan analyse --level max
Slide 45
Slide 45 text
Documenting Our Code
src/Addition.php
Slide 46
Slide 46 text
Running Phan
./vendor/bin/phan
Slide 47
Slide 47 text
Running PHPStan
./vendor/bin/phpstan analyse --level max
Slide 48
Slide 48 text
Real Time Analysis
https://plugins.jetbrains.com/plugin/7622-php-inspections-ea-extended-
Resources
The Workshop: The Road to 7.3
https://www.phparch.com/magazine/2019/01/
devops-depths/
Phan
https://github.com/phan/phan
PHPStan
https://github.com/phpstan/phpstan
Slide 58
Slide 58 text
Joe Ferguson
Twitter: @JoePFerguson
Email: [email protected]
Contact Info: