9
9
10
10
## Description
11
11
12
- The main scope of this extension is to help phpstan to detect the type of object after the ` Webmozart\Assert\Assert ` validation.
12
+ The main scope of this extension is to help PHPStan to detect the type of object after the ` Webmozart\Assert\Assert ` validation.
13
13
14
14
``` php
15
15
<?php declare(strict_types = 1);
@@ -20,96 +20,12 @@ function demo(?int $a) {
20
20
// ...
21
21
22
22
Assert::integer($a);
23
- // phpstan is now aware that $a can no longer be `null` at this point
23
+ // PHPStan is now aware that $a can no longer be `null` at this point
24
24
25
25
return ($a === 10);
26
26
}
27
27
```
28
28
29
- This extension specifies types of values passed to:
30
-
31
- * ` Assert::integer `
32
- * ` Assert::positiveInteger `
33
- * ` Assert::string `
34
- * ` Assert::stringNotEmpty `
35
- * ` Assert::float `
36
- * ` Assert::numeric `
37
- * ` Assert::natural `
38
- * ` Assert::integerish `
39
- * ` Assert::boolean `
40
- * ` Assert::scalar `
41
- * ` Assert::object `
42
- * ` Assert::resource `
43
- * ` Assert::isCallable `
44
- * ` Assert::isArray `
45
- * ` Assert::isTraversable ` (deprecated, use ` isIterable ` or ` isInstanceOf ` instead)
46
- * ` Assert::isIterable `
47
- * ` Assert::isCountable `
48
- * ` Assert::isInstanceOf `
49
- * ` Assert::isInstanceOfAny `
50
- * ` Assert::notInstanceOf `
51
- * ` Assert::isAOf `
52
- * ` Assert::isAnyOf `
53
- * ` Assert::isNotA `
54
- * ` Assert::subclassOf `
55
- * ` Assert::true `
56
- * ` Assert::false `
57
- * ` Assert::notFalse `
58
- * ` Assert::null `
59
- * ` Assert::notNull `
60
- * ` Assert::isEmpty `
61
- * ` Assert::notEmpty `
62
- * ` Assert::eq `
63
- * ` Assert::notEq `
64
- * ` Assert::same `
65
- * ` Assert::notSame `
66
- * ` Assert::greaterThan `
67
- * ` Assert::greaterThanEq `
68
- * ` Assert::lessThan `
69
- * ` Assert::lessThanEq `
70
- * ` Assert::range `
71
- * ` Assert::implementsInterface `
72
- * ` Assert::classExists `
73
- * ` Assert::interfaceExists `
74
- * ` Assert::keyExists `
75
- * ` Assert::keyNotExists `
76
- * ` Assert::validArrayKey `
77
- * ` Assert::count `
78
- * ` Assert::minCount `
79
- * ` Assert::maxCount `
80
- * ` Assert::countBetween `
81
- * ` Assert::isList `
82
- * ` Assert::isNonEmptyList `
83
- * ` Assert::isMap `
84
- * ` Assert::isNonEmptyMap `
85
- * ` Assert::inArray `
86
- * ` Assert::oneOf `
87
- * ` Assert::methodExists `
88
- * ` Assert::propertyExists `
89
- * ` Assert::isArrayAccessible `
90
- * ` Assert::contains `
91
- * ` Assert::startsWith `
92
- * ` Assert::startsWithLetter `
93
- * ` Assert::endsWith `
94
- * ` Assert::unicodeLetters `
95
- * ` Assert::alpha `
96
- * ` Assert::digits `
97
- * ` Assert::alnum `
98
- * ` Assert::lower `
99
- * ` Assert::upper `
100
- * ` Assert::length `
101
- * ` Assert::minLength `
102
- * ` Assert::maxLength `
103
- * ` Assert::lengthBetween `
104
- * ` Assert::uuid `
105
- * ` Assert::ip `
106
- * ` Assert::ipv4 `
107
- * ` Assert::ipv6 `
108
- * ` Assert::email `
109
- * ` Assert::notWhitespaceOnly `
110
- * ` nullOr* ` , ` all* ` and ` allNullOr* ` variants of the above methods
111
-
112
-
113
29
## Installation
114
30
115
31
To use this extension, require it in [ Composer] ( https://getcomposer.org/ ) :
0 commit comments