1 | <?php |
||
21 | final class ArrayFactory |
||
22 | { |
||
23 | /** |
||
24 | * Schema array |
||
25 | * |
||
26 | * @var array |
||
27 | */ |
||
28 | private $schema; |
||
29 | |||
30 | /** |
||
31 | * Resolved process instance |
||
32 | * |
||
33 | * @var Process |
||
34 | */ |
||
35 | private $process; |
||
36 | |||
37 | /** |
||
38 | * Construct |
||
39 | * |
||
40 | * @param array $schema |
||
41 | */ |
||
42 | 3 | public function __construct(array $schema) |
|
46 | |||
47 | /** |
||
48 | * Return schema (process) name |
||
49 | * |
||
50 | * @return string |
||
51 | */ |
||
52 | 2 | public function getSchemaName(): string |
|
56 | |||
57 | /** |
||
58 | * Return initial state name |
||
59 | * |
||
60 | * @return string |
||
61 | */ |
||
62 | 2 | public function getInitialState(): string |
|
66 | |||
67 | /** |
||
68 | * Build states for process |
||
69 | * |
||
70 | * @return array |
||
71 | */ |
||
72 | 1 | private function buildStates(): array |
|
85 | |||
86 | /** |
||
87 | * Build state events |
||
88 | * |
||
89 | * @param array $state |
||
90 | * |
||
91 | * @return Event[] |
||
92 | */ |
||
93 | 1 | private function buildEvents(array $state): array |
|
108 | |||
109 | /** |
||
110 | * Return schema process |
||
111 | * |
||
112 | * @return Process |
||
113 | */ |
||
114 | 1 | public function getProcess(): Process |
|
126 | |||
127 | /** |
||
128 | * Returns array element matching key |
||
129 | * |
||
130 | * @param array $array |
||
131 | * @param string $offset |
||
132 | * @param mixed $default |
||
133 | * |
||
134 | * @return mixed |
||
135 | */ |
||
136 | 3 | private function getOffsetFromArray(array $array, $offset, $default = null) |
|
140 | |||
141 | /** |
||
142 | * Return array elements not matching keys |
||
143 | * |
||
144 | * @param array $array |
||
145 | * @param array $ignoredKeys |
||
146 | * |
||
147 | * @return array |
||
148 | */ |
||
149 | 1 | private function getAdditionalFromArray(array $array, array $ignoredKeys): array |
|
153 | } |
||
154 |