File tree 2 files changed +37
-0
lines changed
tests/Type/WebMozartAssert
2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ protected function getRule(): Rule
18
18
19
19
public function testExtension (): void
20
20
{
21
+ $ this ->analyse ([__DIR__ . '/data/bug-85.php ' ], []);
22
+
21
23
$ this ->analyse ([__DIR__ . '/data/impossible-check.php ' ], [
22
24
[
23
25
'Call to static method Webmozart\Assert\Assert::stringNotEmpty() with \'\' will always evaluate to false. ' ,
@@ -29,6 +31,7 @@ public function testExtension(): void
29
31
public static function getAdditionalConfigFiles (): array
30
32
{
31
33
return [
34
+ __DIR__ . '/../../../vendor/phpstan/phpstan-strict-rules/rules.neon ' ,
32
35
__DIR__ . '/../../../extension.neon ' ,
33
36
];
34
37
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace PHPStan \Type \WebMozartAssert ;
6
+
7
+ use Webmozart \Assert \Assert ;
8
+
9
+ final class Bug85
10
+ {
11
+
12
+ public function foo (string $ cityCode ): void
13
+ {
14
+ Assert::length ($ cityCode , 3 );
15
+ Assert::upper ($ cityCode );
16
+ }
17
+
18
+ /**
19
+ * @param mixed $url
20
+ */
21
+ function bar ($ url ): void
22
+ {
23
+ Assert::stringNotEmpty ($ url );
24
+ Assert::contains ($ url , '/ ' );
25
+ Assert::startsWith ($ url , 'https://github.com/ ' );
26
+ }
27
+
28
+ public function baz (string $ s ): void
29
+ {
30
+ Assert::stringNotEmpty ($ s );
31
+ Assert::uuid ($ s );
32
+ }
33
+
34
+ }
You can’t perform that action at this time.
0 commit comments