@@ 236-239 (lines=4) @@ | ||
233 | ||
234 | $index = []; |
|
235 | foreach ($metadata as $metadataItem) { |
|
236 | if (!array_key_exists(static::WORKFLOW_MANAGER_NAME, $metadataItem)) { |
|
237 | $errMsg = sprintf('there is no option %s', static::WORKFLOW_MANAGER_NAME); |
|
238 | throw new Exception\InvalidWorkflowEntryToObjectMetadataException($errMsg); |
|
239 | } |
|
240 | $workflowManagerName = $metadataItem[static::WORKFLOW_MANAGER_NAME]; |
|
241 | ||
242 | if (!array_key_exists(static::WORKFLOW_NAME, $metadataItem)) { |
|
@@ 242-245 (lines=4) @@ | ||
239 | } |
|
240 | $workflowManagerName = $metadataItem[static::WORKFLOW_MANAGER_NAME]; |
|
241 | ||
242 | if (!array_key_exists(static::WORKFLOW_NAME, $metadataItem)) { |
|
243 | $errMsg = sprintf('there is no option %s', static::WORKFLOW_NAME); |
|
244 | throw new Exception\InvalidWorkflowEntryToObjectMetadataException($errMsg); |
|
245 | } |
|
246 | $workflowName = $metadataItem[static::WORKFLOW_NAME]; |
|
247 | ||
248 | if (!array_key_exists(static::MAP, $metadataItem)) { |
|
@@ 248-251 (lines=4) @@ | ||
245 | } |
|
246 | $workflowName = $metadataItem[static::WORKFLOW_NAME]; |
|
247 | ||
248 | if (!array_key_exists(static::MAP, $metadataItem)) { |
|
249 | $errMsg = sprintf('there is no option %s', static::MAP); |
|
250 | throw new Exception\InvalidWorkflowEntryToObjectMetadataException($errMsg); |
|
251 | } |
|
252 | if (!is_array($metadataItem[static::MAP])) { |
|
253 | $errMsg = sprintf('option %s is not array', static::MAP); |
|
254 | throw new Exception\InvalidWorkflowEntryToObjectMetadataException($errMsg); |
|
@@ 252-255 (lines=4) @@ | ||
249 | $errMsg = sprintf('there is no option %s', static::MAP); |
|
250 | throw new Exception\InvalidWorkflowEntryToObjectMetadataException($errMsg); |
|
251 | } |
|
252 | if (!is_array($metadataItem[static::MAP])) { |
|
253 | $errMsg = sprintf('option %s is not array', static::MAP); |
|
254 | throw new Exception\InvalidWorkflowEntryToObjectMetadataException($errMsg); |
|
255 | } |
|
256 | $map = $metadataItem[static::MAP]; |
|
257 | ||
258 | if (!array_key_exists($workflowManagerName, $index)) { |
|
@@ 266-269 (lines=4) @@ | ||
263 | } |
|
264 | ||
265 | foreach ($map as $mapItem) { |
|
266 | if (!array_key_exists(static::ENTITY_CLASS_NAME, $mapItem)) { |
|
267 | $errMsg = sprintf('there is no option %s', static::ENTITY_CLASS_NAME); |
|
268 | throw new Exception\InvalidWorkflowEntryToObjectMetadataException($errMsg); |
|
269 | } |
|
270 | $entityClassName = $mapItem[static::ENTITY_CLASS_NAME]; |
|
271 | ||
272 | if (array_key_exists($entityClassName, $index[$workflowManagerName][$workflowName])) { |
|
@@ 277-280 (lines=4) @@ | ||
274 | throw new Exception\InvalidWorkflowEntryToObjectMetadataException($errMsg); |
|
275 | } |
|
276 | ||
277 | if (!array_key_exists(static::ROUTER_PARAM_NAME, $mapItem)) { |
|
278 | $errMsg = sprintf('there is no option %s', static::ROUTER_PARAM_NAME); |
|
279 | throw new Exception\InvalidWorkflowEntryToObjectMetadataException($errMsg); |
|
280 | } |
|
281 | $routerParamName = $mapItem[static::ROUTER_PARAM_NAME]; |
|
282 | ||
283 | $index[$workflowManagerName][$workflowName][$entityClassName] = $routerParamName; |