We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d638635 commit 1ba7ef1Copy full SHA for 1ba7ef1
README.md
@@ -7,6 +7,24 @@
7
* [PHPStan](https://github.com/phpstan/phpstan)
8
* [beberlei/assert](https://github.com/beberlei/assert)
9
10
+## Description
11
+
12
+The main scope of this extension is to help phpstan to detect the type of object after the `Assert\Assertion` validation.
13
14
+```php
15
+<?php declare(strict_types = 1);
16
+use Assert\Assertion;
17
18
+function demo(?int $a) {
19
+ // ...
20
21
+ Assertion::integer($a);
22
+ // phpstan is now aware that $a can no longer be `null` at this point
23
24
+ return ($a === 10);
25
+}
26
+```
27
28
This extension specifies types of values passed to:
29
30
* `Assertion::integer`
0 commit comments