Skip to content

phpstan/phpstan-symfony

Folders and files

NameName
Last commit message
Last commit date

Latest commit

34b1940 · Jun 21, 2018

History

51 Commits
Jun 21, 2018
Jun 21, 2018
May 13, 2018
Jul 18, 2017
May 13, 2018
May 22, 2018
May 22, 2018
May 5, 2017
May 22, 2018
May 13, 2018
May 29, 2018
May 22, 2018
May 13, 2018
May 29, 2018

Repository files navigation

PHPStan Symfony Framework extensions and rules

Build Status Latest Stable Version License

This extension provides following features:

  • Provides correct return type for ContainerInterface::get() method.
  • Provides correct return type for Controller::get() method.
  • Provides correct return type for Request::getContent() method based on the $asResource parameter.
  • Notifies you when you try to get an unregistered service from the container.
  • Notifies you when you try to get a private service from the container.

Usage

To use this extension, require it in Composer:

composer require --dev phpstan/phpstan-symfony

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

includes:
	- vendor/phpstan/phpstan-symfony/extension.neon
parameters:
	symfony:
		container_xml_path: %rootDir%/../../../var/cache/dev/appDevDebugProjectContainer.xml # or srcDevDebugProjectContainer.xml for Symfony 4+

Limitations

You have to provide a path to appDevDebugProjectContainer.xml or similar xml file describing your container.