1 | <?php |
||
24 | class CachedSchemaStorage extends SchemaStorage |
||
25 | { |
||
26 | const FILE_PREFIX = 'file://'; |
||
27 | |||
28 | /** |
||
29 | * @var FileLocatorInterface |
||
30 | */ |
||
31 | private $fileLocator; |
||
32 | |||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | private $configuredSchemas; |
||
37 | |||
38 | /** |
||
39 | * @var bool |
||
40 | */ |
||
41 | private $debugMode; |
||
42 | |||
43 | /** |
||
44 | * @var string |
||
45 | */ |
||
46 | private $cacheFilePath; |
||
47 | |||
48 | /** |
||
49 | * @param array $configuredSchemas array containing all file paths to configured schemas |
||
50 | * @param FileLocatorInterface $fileLocator |
||
51 | * @param string $cacheFilePath |
||
52 | * @param string $environment |
||
53 | */ |
||
54 | 10 | public function __construct( |
|
67 | |||
68 | 9 | public function initializeCache() |
|
85 | |||
86 | /** |
||
87 | * @param string $routeId |
||
88 | * |
||
89 | * @return mixed |
||
90 | * |
||
91 | * @throws InvalidArgumentException |
||
92 | */ |
||
93 | 8 | public function getSchemaByRoute($routeId) |
|
99 | |||
100 | /** |
||
101 | * @param string $schemaPath |
||
102 | * @param array $serializedSchemas |
||
103 | * @param array $resources |
||
104 | * |
||
105 | * @throws MalFormedJsonException |
||
106 | * @throws InvalidArgumentException |
||
107 | * @throws FileLocatorFileNotFoundException |
||
108 | */ |
||
109 | 1 | protected function processSchema($schemaPath, array &$serializedSchemas, array &$resources) |
|
130 | |||
131 | /** |
||
132 | * @param mixed $schema |
||
133 | * @param string $schemaFilePath |
||
134 | * @param array $serializedSchemas |
||
135 | * @param array $resources |
||
136 | * |
||
137 | * @throws MalFormedJsonException |
||
138 | * @throws InvalidArgumentException |
||
139 | * @throws FileLocatorFileNotFoundException |
||
140 | */ |
||
141 | 1 | protected function processReferencesInSchema($schema, $schemaFilePath, array &$serializedSchemas, array &$resources) |
|
153 | } |
||
154 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.