Skip to content

nextgen-tech/phpstan-laravel-rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHPStan Laravel Rules

This package provides collection of PHPStan rules for Laravel applications. For now it provides 2 new rules:

  • disallow debug functions (dd, ddd, dump, debug, print_r, var_dump and var_export)
  • disallow debug methods on Collections (dd, dump and debug)

Installation

composer require nextgen-tech/phpstan-laravel-rules --dev

Including extension to PHPStan

In phpstan.neon or phpstan.neon.dist file in includes section add:

./vendor/nextgen-tech/phpstan-laravel-rules/extension.neon

After that file should looks like this:

includes:
    - ./vendor/nunomaduro/larastan/extension.neon                # larastan extension, could be omited
    - ./vendor/nextgen-tech/phpstan-laravel-rules/extension.neon # extension from this package

parameters:
    paths:
        - app

    level: 8