Skip to content

Commit 0cb3c0b

Browse files
committed
Update readme
1 parent e0cf8cd commit 0cb3c0b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ This extension provides following features:
1111
* Provides correct return type for `ContainerInterface::get()` and `::has()` methods.
1212
* Provides correct return type for `Controller::get()` and `::has()` methods.
1313
* Provides correct return type for `Request::getContent()` method based on the `$asResource` parameter.
14+
* Provides correct return type for `HeaderBag::get()` method based on the `$first` parameter.
15+
* Provides correct return type for `Envelope::all()` method based on the `$stampFqcn` parameter.
1416
* Notifies you when you try to get an unregistered service from the container.
1517
* Notifies you when you try to get a private service from the container.
18+
* Optionally correct return types for `InputInterface::getArgument()` and `::getOption`
1619

1720
## Usage
1821

@@ -55,3 +58,21 @@ parameters:
5558
```
5659

5760
Be aware that it may hide genuine errors in your application.
61+
62+
## Console command analysis
63+
64+
You can opt in for more advanced analysis 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().
65+
66+
```
67+
parameters:
68+
symfony:
69+
console_application_loader: tests/console-application.php
70+
```
71+
72+
For example, in a Symfony project, `console-application.php` would look something like this:
73+
74+
```php
75+
require dirname(__DIR__).'/../config/bootstrap.php';
76+
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
77+
return new \Symfony\Bundle\FrameworkBundle\Console\Application($kernel);
78+
```

0 commit comments

Comments
 (0)