File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,36 @@ function requiresString(string $_str): void {}
90
90
$ this ->analyzeFile ('somefile.php ' , new Context ());
91
91
}
92
92
93
+ public function testAssertsAllongCallStaticMethodWork (): void
94
+ {
95
+ $ this ->addFile (
96
+ 'somefile.php ' ,
97
+ '<?php
98
+
99
+ class ImportedAssert
100
+ {
101
+ /** @psalm-assert non-empty-string $b */
102
+ public static function notEmptyStrOnly(string $b): void
103
+ {
104
+ if ("" === $b) throw new \Exception("");
105
+ }
106
+
107
+ public function __callStatic() {}
108
+ }
109
+
110
+ /** @return non-empty-string */
111
+ function returnNonEmpty(string $b): string
112
+ {
113
+ ImportedAssert::notEmptyStrOnly($b);
114
+
115
+ return $b;
116
+ }
117
+ ' ,
118
+ );
119
+
120
+ $ this ->analyzeFile ('somefile.php ' , new Context ());
121
+ }
122
+
93
123
public function testAssertInvalidDocblockMessageDoesNotIncludeTrace (): void
94
124
{
95
125
$ this ->expectException (CodeException::class);
You can’t perform that action at this time.
0 commit comments