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 723d2fa commit 6acc0e5Copy full SHA for 6acc0e5
README.md
@@ -7,6 +7,25 @@
7
* [PHPStan](https://github.com/phpstan/phpstan)
8
* [webmozart/assert](https://github.com/webmozart/assert)
9
10
+## Description
11
+
12
+The main scope of this extension is to help phpstan to detect the type of object after the `Webmozart\Assert` validation.
13
14
+```php
15
+<?php declare(strict_types = 1);
16
17
+use Webmozart\Assert;
18
19
+function demo(?int $a) {
20
+ // ...
21
22
+ Assert::integer($a);
23
+ // phpstan is now aware that $a can no longer be `null` at this point
24
25
+ return ($a === 10);
26
+}
27
+```
28
29
This extension specifies types of values passed to:
30
31
* `Assert::integer`
0 commit comments