Skip to content

Provides PHPStan standard config for NUK WordPress plugins and themes.

License

Notifications You must be signed in to change notification settings

newsuk/nuk-wp-phpstan-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NUK WP PHPStan config

This library contains PHPStan configuration for NewsUK plugins and themes.

Installation

Composer install:

composer require --dev newsuk/nuk-wp-phpstan-config

Using the ruleset

Create a phpstan.neon.dist file in the root of your project and add the below config. Feel free to alter the paths based on your project requirements

parameters:
    level: max
    paths:
        # adjust the filename / directory name according to project needs.
        - plugin.php
        - includes/

Composer scripts

Add the following to scripts section in composer.json file and run composer phpstan

"phpstan": "phpstan analyse --memory-limit=2048M"

Add the following to generate baseline file for existing plugins and run composer phpstan-baseline

"phpstan-baseline": "phpstan analyse -b --allow-empty-baseline"

About

Provides PHPStan standard config for NUK WordPress plugins and themes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •