File tree Expand file tree Collapse file tree 4 files changed +33
-1
lines changed Expand file tree Collapse file tree 4 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,6 @@ parameters:
166
166
- ../stubs/arrayFunctions.stub
167
167
- ../stubs/core.stub
168
168
- ../stubs/typeCheckingFunctions.stub
169
- - ../stubs/json.stub
170
169
earlyTerminatingMethodCalls : []
171
170
earlyTerminatingFunctionCalls : []
172
171
memoryLimitFile : %tmpDir%/.memory_limit
@@ -630,6 +629,11 @@ services:
630
629
autowired :
631
630
- PHPStan\PhpDoc\StubFilesProvider
632
631
632
+ -
633
+ class : PHPStan\PhpDoc\JsonValidateStubFilesExtension
634
+ tags :
635
+ - phpstan.stubFilesExtension
636
+
633
637
-
634
638
class : PHPStan\Analyser\Analyser
635
639
arguments :
Original file line number Diff line number Diff line change @@ -227,4 +227,9 @@ public function supportsCallableInstanceMethods(): bool
227
227
return $ this ->versionId < 80000 ;
228
228
}
229
229
230
+ public function supportsJsonValidate (): bool
231
+ {
232
+ return $ this ->versionId >= 80300 ;
233
+ }
234
+
230
235
}
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types = 1 );
2
+
3
+ namespace PHPStan \PhpDoc ;
4
+
5
+ use PHPStan \Php \PhpVersion ;
6
+
7
+ class JsonValidateStubFilesExtension implements StubFilesExtension
8
+ {
9
+
10
+ public function __construct (private PhpVersion $ phpVersion )
11
+ {
12
+ }
13
+
14
+ public function getFiles (): array
15
+ {
16
+ if (!$ this ->phpVersion ->supportsJsonValidate ()) {
17
+ return [];
18
+ }
19
+
20
+ return [__DIR__ . '/../../stubs/json_validate.stub ' ];
21
+ }
22
+
23
+ }
File renamed without changes.
You can’t perform that action at this time.
0 commit comments