@@ 93-99 (lines=7) @@ | ||
90 | ||
91 | $foundNodes = array(); |
|
92 | foreach ($this['nodes'] as $idx => $node) { |
|
93 | if (!$node instanceof Node\NodeInterface) { |
|
94 | throw new InvalidArgumentException(sprintf( |
|
95 | 'property: [nodes] must implement \Assimtech\Tempo\Node\NodeInterface, [nodes][%s] is a %s', |
|
96 | $idx, |
|
97 | is_object($node) ? get_class($node) : gettype($node) |
|
98 | )); |
|
99 | } |
|
100 | ||
101 | if (in_array((string)$node, $foundNodes)) { |
|
102 | throw new InvalidArgumentException(sprintf( |
@@ 22-28 (lines=7) @@ | ||
19 | ||
20 | $definition = require $path; |
|
21 | ||
22 | if (!$definition instanceof Definition) { |
|
23 | throw new RuntimeException(sprintf( |
|
24 | "%s must return an instance of \Assimtech\Tempo\Definition (%s returned)", |
|
25 | $path, |
|
26 | is_object($definition) ? get_class($definition) : gettype($definition) |
|
27 | )); |
|
28 | } |
|
29 | ||
30 | return $definition; |
|
31 | } |