@@ -17,27 +17,40 @@ This extension provides following features:
17
17
* Notifies you when you try to get a private service from the container.
18
18
* Optionally correct return types for ` InputInterface::getArgument() ` , ` ::getOption ` , ` ::hasArgument ` , and ` ::hasOption ` .
19
19
20
- ## Usage
20
+
21
+ ## Installation
21
22
22
23
To use this extension, require it in [ Composer] ( https://getcomposer.org/ ) :
23
24
24
- ``` bash
25
+ ```
25
26
composer require --dev phpstan/phpstan-symfony
26
27
```
27
28
28
- And include extension.neon in your project's PHPStan config:
29
+ If you also install [ phpstan/extension-installer] ( https://github.com/phpstan/extension-installer ) then you're all set!
30
+
31
+ <details >
32
+ <summary >Manual installation</summary >
33
+
34
+ If you don't want to use ` phpstan/extension-installer ` , include extension.neon in your project's PHPStan config:
29
35
30
36
```
31
37
includes:
32
- - vendor/phpstan/phpstan-symfony/extension.neon
38
+ - vendor/phpstan/phpstan-symfony/extension.neon
39
+ ```
40
+ </details >
41
+
42
+ # Configuration
43
+
44
+ You have to provide a path to ` srcDevDebugProjectContainer.xml ` or similar XML file describing your container.
45
+
46
+ ```
33
47
parameters:
34
- symfony:
35
- container_xml_path: %rootDir%/../../../var/cache/dev/srcDevDebugProjectContainer.xml
36
- # or with Symfony 4.2+
37
- container_xml_path: '%rootDir%/../../../var/cache/dev/srcApp_KernelDevDebugContainer.xml'
48
+ symfony:
49
+ container_xml_path: %rootDir%/../../../var/cache/dev/srcDevDebugProjectContainer.xml
50
+ # or with Symfony 4.2+
51
+ container_xml_path: '%rootDir%/../../../var/cache/dev/srcApp_KernelDevDebugContainer.xml'
38
52
```
39
53
40
- You have to provide a path to ` srcDevDebugProjectContainer.xml ` or similar xml file describing your container.
41
54
42
55
## Constant hassers
43
56
@@ -49,7 +62,7 @@ if ($this->has('service')) {
49
62
}
50
63
```
51
64
52
- In that case, you can disable the ` ::has() ` method return type resolving like this:
65
+ In that case, you can disable the ` ::has() ` method return type resolving like this:
53
66
54
67
```
55
68
parameters:
0 commit comments