1 | <?php declare (strict_types = 1); |
||
35 | class JsonSchemas implements JsonSchemasInterface |
||
36 | { |
||
37 | use ClassIsTrait; |
||
38 | |||
39 | /** |
||
40 | * @var FactoryInterface |
||
41 | */ |
||
42 | private $factory; |
||
43 | |||
44 | /** |
||
45 | * @var array |
||
46 | */ |
||
47 | private $modelToSchemaMap; |
||
48 | |||
49 | /** |
||
50 | * @var array |
||
51 | */ |
||
52 | private $typeToSchemaMap; |
||
53 | |||
54 | /** |
||
55 | * @var array |
||
56 | */ |
||
57 | private $schemaInstances = []; |
||
58 | |||
59 | /** |
||
60 | * @var ModelSchemaInfoInterface |
||
61 | */ |
||
62 | private $modelSchemas; |
||
63 | |||
64 | /** |
||
65 | * @param FactoryInterface $factory |
||
66 | 58 | * @param array $modelToSchemaMap |
|
67 | * @param array $typeToSchemaMap |
||
68 | * @param ModelSchemaInfoInterface $modelSchemas |
||
69 | */ |
||
70 | public function __construct( |
||
81 | 17 | ||
82 | /** |
||
83 | 17 | * @inheritdoc |
|
84 | */ |
||
85 | 17 | public function getSchema($resourceObject): JsonSchemaInterface |
|
91 | 17 | ||
92 | /** |
||
93 | 17 | * @inheritdoc |
|
94 | 17 | */ |
|
95 | public function hasSchema($resourceObject): bool |
||
100 | 5 | ||
101 | /** |
||
102 | 5 | * @inheritdoc |
|
103 | */ |
||
104 | public function hasRelationshipSchema(string $schemaClass, string $relationshipName): bool |
||
116 | 20 | ||
117 | /** |
||
118 | 20 | * @inheritdoc |
|
119 | */ |
||
120 | public function getRelationshipSchema(string $schemaClass, string $relationshipName): SchemaInterface |
||
131 | 20 | ||
132 | /** |
||
133 | 20 | * @inheritdoc |
|
134 | */ |
||
135 | public function getModelRelationshipSchema(string $modelClass, string $relationshipName): SchemaInterface |
||
144 | 25 | ||
145 | /** |
||
146 | 25 | * @inheritdoc |
|
147 | */ |
||
148 | 25 | public function getSchemaByResourceType(string $resourceType): SchemaInterface |
|
156 | 28 | ||
157 | /** |
||
158 | 28 | * @return FactoryInterface |
|
159 | */ |
||
160 | private function getFactory(): FactoryInterface |
||
164 | 28 | ||
165 | /** |
||
166 | 28 | * @return ModelSchemaInfoInterface |
|
167 | */ |
||
168 | private function getModelSchemas(): ModelSchemaInfoInterface |
||
172 | |||
173 | /** |
||
174 | 17 | * @param mixed $resource |
|
175 | * |
||
176 | 17 | * @return string |
|
177 | 17 | */ |
|
178 | 17 | private function getResourceClass($resource): string |
|
187 | 22 | ||
188 | /** |
||
189 | 22 | * @inheritdoc |
|
190 | */ |
||
191 | 22 | private function getSchemaByModelClass(string $modelClass): JsonSchemaInterface |
|
199 | |||
200 | /** |
||
201 | 28 | * @param string $schemaClass |
|
202 | * |
||
203 | 28 | * @return SchemaInterface |
|
204 | */ |
||
205 | 28 | private function getSchemaByClass(string $schemaClass): JsonSchemaInterface |
|
218 | } |
||
219 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: