nextgen-tech/phpstan-laravel-rules

v1.0.0 2020-10-14 13:11 UTC

This package is auto-updated.

Last update: 2024-11-16 18:03:18 UTC


README

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