1 | <?php |
||
19 | class DocumentInstantiator implements InstantiatorInterface |
||
20 | { |
||
21 | /** |
||
22 | * @invisible |
||
23 | * @var ODMInterface |
||
24 | */ |
||
25 | private $odm; |
||
26 | |||
27 | /** |
||
28 | * Primary instantiation class. |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | private $class = ''; |
||
33 | |||
34 | /** |
||
35 | * Normalized schema delivered by DocumentSchema. |
||
36 | * |
||
37 | * @var array |
||
38 | */ |
||
39 | private $schema = []; |
||
40 | |||
41 | /** |
||
42 | * @param ODMInterface $odm |
||
43 | * @param string $class |
||
44 | * @param array $schema |
||
45 | */ |
||
46 | public function __construct(ODMInterface $odm, string $class, array $schema) |
||
52 | |||
53 | /** |
||
54 | * @param array|\ArrayAccess $fields |
||
55 | * |
||
56 | * @return CompositableInterface|DocumentEntity|Document |
||
57 | */ |
||
58 | public function instantiate($fields): CompositableInterface |
||
70 | |||
71 | /** |
||
72 | * Define document class using it's fieldset and definition. |
||
73 | * |
||
74 | * @param \ArrayAccess|array $fields |
||
75 | * |
||
76 | * @return string |
||
77 | * |
||
78 | * @throws DefinitionException |
||
79 | */ |
||
80 | protected function defineClass($fields) |
||
106 | } |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.