Skip to content

shiiyan/my-first-php-stan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My First PHPStan Project

Custom Rules

  • InstantiatePersonInFactoryRule
  • AssignPropertiesInsideConstructorRule
  • ClassRegistryInitWithEnumRule

PHPStan Analysis

PHPStan outputs like below.

 % php bin/composer phpstan:analyse;
> vendor/bin/phpstan analyse -c phpstan.neon
 9/9 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ------------------------------------------------------------------------
  Line   Foo.php
 ------ ------------------------------------------------------------------------
  :11    New Person instance can be created only in PersonFactory
  :12    Immutability violated - assigning $email property outside constructor.
  :18    ClassRegistry::init must use ClassRegistryPath as its first argument
 ------ ------------------------------------------------------------------------

Releases

No releases published

Packages

No packages published

Languages