1 | <?php |
||
15 | class CachedSchemaStorage extends SchemaStorage |
||
16 | { |
||
17 | const FILE_PREFIX = 'file://'; |
||
18 | |||
19 | /** |
||
20 | * @var FileLocatorInterface |
||
21 | */ |
||
22 | private $fileLocator; |
||
23 | |||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | private $configuredSchemas; |
||
28 | |||
29 | /** |
||
30 | * @var bool |
||
31 | */ |
||
32 | private $debugMode; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | private $cacheFilePath; |
||
38 | |||
39 | /** |
||
40 | * @param array $configuredSchemas array containing all file paths to configured schemas |
||
41 | * @param FileLocatorInterface $fileLocator |
||
42 | * @param string $cacheFilePath |
||
43 | * @param string $environment |
||
44 | */ |
||
45 | 10 | public function __construct( |
|
58 | |||
59 | 8 | public function initializeCache() |
|
76 | |||
77 | /** |
||
78 | * @param string $routeId |
||
79 | * |
||
80 | * @return object |
||
81 | * @throws InvalidArgumentException |
||
82 | */ |
||
83 | 8 | public function getSchemaByRoute($routeId) |
|
89 | |||
90 | /** |
||
91 | * @param string $schemaPath |
||
92 | * @param array $serializedSchemas |
||
93 | * @param array $resources |
||
94 | * |
||
95 | * @throws MalFormedJsonException |
||
96 | * @throws InvalidArgumentException |
||
97 | * @throws FileLocatorFileNotFoundException |
||
98 | */ |
||
99 | 1 | protected function processSchema($schemaPath, array &$serializedSchemas, array &$resources) |
|
120 | |||
121 | /** |
||
122 | * @param mixed $schema |
||
123 | * @param string $schemaFilePath |
||
124 | * @param array $serializedSchemas |
||
125 | * @param array $resources |
||
126 | * |
||
127 | * @throws MalFormedJsonException |
||
128 | * @throws InvalidArgumentException |
||
129 | * @throws FileLocatorFileNotFoundException |
||
130 | */ |
||
131 | 1 | protected function processReferencesInSchema($schema, $schemaFilePath, array &$serializedSchemas, array &$resources) |
|
143 | } |
||
144 |
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.