/phpstan

Contao PHPStan Extension

Primary LanguagePHPMIT LicenseMIT

PHPStan Contao Framework extensions and rules

This extension provides following features:

  • Provides correct return types for Contao services.

GitHub

Usage

To use this extension, require it in Composer:

composer require --dev contao/phpstan

And include extension.neon in your project's PHPStan config:

includes:
    - vendor/contao/phpstan/extension.neon
    - vendor/phpstan/phpstan-symfony/extension.neon

parameters:
    contao:
        services_yml_path: %currentWorkingDirectory%/src/Resources/config/services.yml

    symfony:
        container_xml_path: %currentWorkingDirectory%/vendor/contao/phpstan/var/cache/dev/appDevPHPStanProjectContainer.xml

Limitations

You have to provide a path to services.yml or similar yml file describing your services.