Use static analyzer Variants: https://github.com/phpstan/phpstan https://github.com/vimeo/psalm