| @@ 20-33 (lines=14) @@ | ||
| 17 | * | |
| 18 | * @param Node $node | |
| 19 | */ | |
| 20 | public function applyToNode(Node $node) | |
| 21 |     { | |
| 22 | $instruction = $node->getInstruction($this); | |
| 23 | ||
| 24 | $list = $this->resolve($instruction); | |
| 25 | ||
| 26 |         if (isset($list) && !is_array($list)) { | |
| 27 |             throw new \Exception("Unable to apply {$this->property} processing instruction:" | |
| 28 | . " Expected an array, got a " . (is_object($list) ? get_class($list) . ' ' : '') . gettype($list)); | |
| 29 | } | |
| 30 | ||
| 31 | $result = $this->execute((array)$list); | |
| 32 | $node->setResult($result); | |
| 33 | } | |
| 34 | ||
| 35 | /** | |
| 36 | * Resolve processing nodes in the instruction | |
| @@ 20-33 (lines=14) @@ | ||
| 17 | * | |
| 18 | * @param Node $node | |
| 19 | */ | |
| 20 | public function applyToNode(Node $node) | |
| 21 |     { | |
| 22 | $instruction = $node->getInstruction($this); | |
| 23 | ||
| 24 | $list = $this->resolve($instruction); | |
| 25 | ||
| 26 |         if (isset($list) && !is_array($list)) { | |
| 27 |             throw new \Exception("Unable to apply {$this->property} processing instruction:" | |
| 28 | . " Expected an array, got a " . (is_object($list) ? get_class($list) . ' ' : '') . gettype($list)); | |
| 29 | } | |
| 30 | ||
| 31 | $result = $this->execute((array)$list); | |
| 32 | $node->setResult($result); | |
| 33 | } | |
| 34 | ||
| 35 | /** | |
| 36 | * Resolve processing nodes in the instruction | |