contao/phpstan

Contao extension for PHPStan

Installs: 31 674

Dependents: 3

Suggesters: 0

Security: 0

Stars: 3

Watchers: 4

Forks: 1

Open Issues: 1

Type:phpstan-extension

0.12.6 2020-07-02 12:54 UTC

README

This extension provides following features:

  • Provides correct return types for Contao services.

GitHub 68747470733a2f2f636f6465636f762e696f2f67682f636f6e74616f2f7068707374616e2f6272616e63682f6d61737465722f67726170682f62616467652e737667 68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f6e74616f2f7068707374616e2e737667 68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f6e74616f2f7068707374616e2e737667

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.