@@ 352-371 (lines=20) @@ | ||
349 | return true; |
|
350 | } |
|
351 | ||
352 | private function processClass($id, &$service, Definition $definition, $file) |
|
353 | { |
|
354 | if (!isset($service['class'])) { |
|
355 | return; |
|
356 | } |
|
357 | ||
358 | $class = $service['class']; |
|
359 | ||
360 | // nette |
|
361 | if ($class instanceof Entity) { |
|
362 | if (isset($service['arguments']) && !empty($class->attributes)) { |
|
363 | throw new InvalidArgumentException(sprintf('Duplicated definition of arguments for service "%s" in "%s". Check you NEON syntax.', $id, $file)); |
|
364 | } |
|
365 | ||
366 | $service['arguments'] = $class->attributes; |
|
367 | $class = $class->value; |
|
368 | } |
|
369 | ||
370 | $definition->setClass($class); |
|
371 | } |
|
372 | ||
373 | private function processFactory($id, array &$service, Definition $definition, $file) |
|
374 | { |
|
@@ 373-392 (lines=20) @@ | ||
370 | $definition->setClass($class); |
|
371 | } |
|
372 | ||
373 | private function processFactory($id, array &$service, Definition $definition, $file) |
|
374 | { |
|
375 | if (!isset($service['factory'])) { |
|
376 | return; |
|
377 | } |
|
378 | ||
379 | $factory = $service['factory']; |
|
380 | ||
381 | //nette |
|
382 | if ($factory instanceof Entity) { |
|
383 | if (isset($service['arguments']) && !empty($factory->attributes)) { |
|
384 | throw new InvalidArgumentException(sprintf('Duplicated definition of arguments for service "%s" in "%s". Check you NEON syntax.', $id, $file)); |
|
385 | } |
|
386 | ||
387 | $service['arguments'] = $factory->attributes; |
|
388 | $factory = $factory->value; |
|
389 | } |
|
390 | ||
391 | $definition->setFactory($this->parseFactory($factory, $file)); |
|
392 | } |
|
393 | ||
394 | private function processArguments($id, array &$service, Definition $definition, $file) |
|
395 | { |