Symfony extension for PHPStan. Sometimes, when you are dealing with optional dependencies, the ::has() methods can cause problems. For example, the following construct would complain that the condition is always either on or off, depending on whether you have the dependency for service installed. You can opt in for more advanced analysis of Symfony Console Commands by providing the console application from your own application. This will allow the correct argument and option types to be inferred when accessing $input-getArgument() or $input->getOption().

Features

  • Provides correct return type for ContainerInterface::get() and ::has() methods
  • Provides correct return type for Controller::get() and ::has() methods
  • Provides correct return type for AbstractController::get() and ::has() methods
  • Provides correct return type for ContainerInterface::getParameter() and ::hasParameter() methods
  • 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

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow PHPStan Symfony Framework extensions

PHPStan Symfony Framework extensions Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of PHPStan Symfony Framework extensions!

Additional Project Details

Programming Language

PHP

Related Categories

PHP Static Code Analysis Tool

Registered

2023-03-31