File tree 2 files changed +40
-0
lines changed
tests/Type/WebMozartAssert
2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,15 @@ public function testExtension(): void
26
26
]);
27
27
}
28
28
29
+ public function testBug85 (): void
30
+ {
31
+ $ this ->analyse ([__DIR__ . '/data/bug-85.php ' ], []);
32
+ }
33
+
29
34
public static function getAdditionalConfigFiles (): array
30
35
{
31
36
return [
37
+ __DIR__ . '/../../../vendor/phpstan/phpstan-strict-rules/rules.neon ' ,
32
38
__DIR__ . '/../../../extension.neon ' ,
33
39
];
34
40
}
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