Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 18, 2024 via composer

phpstan/phpstan-symfony 1.3.7

Symfony Framework extensions and rules for PHPStan
Package summary
Share
0
issues
1
license
2
MIT
Package created
19 May 2018
Version published
10 Jan 2024
Maintainers
1
Total deps
2
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
phpstan/phpstan@1.11.1
phpstan/phpstan-symfony@1.3.7
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of phpstan/phpstan-symfony 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
phpstan/phpstan1.11.1-MIT
prod

Visualizations

Frequently Asked Questions

What does phpstan/phpstan-symfony do?

PHPStan Symfony, or phpstan/phpstan-symfony, is a vital extension of PHPStan, popular for its Symfony Framework rules and extensions. It enhances functionality by providing accurate return types for various method calls commonly used in Symfony applications. This includes methods like ContainerInterface:get(), ::has(), AbstractController::get(), ::has(), among others. Additionally, it notifies users when they attempt to retrieve an unregistered service from the container or try to access a private service.

How do you use phpstan/phpstan-symfony?

One can add phpstan/phpstan-symfony to their Symfony project using Composer, a PHP package manager, with the following command:

composer require --dev phpstan/phpstan-symfony

Once the extension is installed, it can be included in the project's PHPStan config file using:

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

For implementing framework-specific checks, this file should also be included:

includes:
    - vendor/phpstan/phpstan-symfony/rules.neon

Users must also provide a path to the srcDevDebugProjectContainer.xml file or similar XML file describing the project's container. This can be done in the PHPStan config file:

parameters:
    symfony:
        containerXmlPath: var/cache/dev/srcDevDebugProjectContainer.xml
        # or with Symfony 4.2+
        containerXmlPath: var/cache/dev/srcApp_KernelDevDebugContainer.xml
        # or with Symfony 5+
        containerXmlPath: var/cache/dev/App_KernelDevDebugContainer.xml
    # If you're using PHP config files for Symfony 5.3+, you also need this for auto-loading of `Symfony\Config`:
    scanDirectories:
        - var/cache/dev/Symfony/Config

For more intricate analysis of Symfony Console Commands, users can provide the console application from their application.

Where are the phpstan/phpstan-symfony docs?

The phpstan/phpstan-symfony documentation is embedded within the README file of the package hosted on GitHub. By checking the GitHub repository at https://github.com/phpstan/phpstan-symfony, developers will find a comprehensive guide to using the package, including its installation, configuration, and example code snippets.