studio-stomp/phpstan-craftcms

Craft CMS extension for PHPStan

Installs: 13 962

Dependents: 1

Suggesters: 0

Security: 0

Stars: 3

Watchers: 2

Forks: 0

Open Issues: 4

Type:phpstan-extension

0.3.0 2021-08-26 08:51 UTC

This package is auto-updated.

Last update: 2025-01-31 13:33:19 UTC


README

Latest Version on Packagist Software License Total Downloads

Extension for PHPStan for better support for Craft CMS. The following features are provided:

  • Configure autoload of Craft CMS for analysis
  • Stub to support different ElementQuery-classes

Install

Via Composer

$ composer require --dev studio-stomp/phpstan-craftcms

Usage

Add phpstan-craftcms to the project phpstan.neon / phpstan.neon.dist:

includes:
    - vendor/studio-stomp/phpstan-craftcms/extension.neon

Add the level and paths as well to the project phpstan.neon / phpstan.neon.dist:

parameters: 
    level: max # Or feel free to start at a lower level
    paths:
        - src # Common in plugins and other composer loaded packages
        - modules # Common in Craft CMS project
        - tests # Common in both

Feel free to check out the base configuration and expand on it with own configuration. For example:

includes:
    - vendor/studio-stomp/phpstan-craftcms/extension.neon

parameters:
    ignoreErrors:
        - '#Call to an undefined method SoapClient::#'

Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email hello@studiostomp.nl instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.