| Conditions | 4 |
| Paths | 3 |
| Total Lines | 22 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php namespace Anomaly\Streams\Platform\Support; |
||
| 40 | public function evaluate($target, array $arguments = []) |
||
| 41 | { |
||
| 42 | /** |
||
| 43 | * If the target is an instance of Closure then |
||
| 44 | * call through the IoC it with the arguments. |
||
| 45 | */ |
||
| 46 | if ($target instanceof \Closure) { |
||
| 47 | return $this->container->call($target, $arguments); |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * If the target is an array then evaluate |
||
| 52 | * each of it's values. |
||
| 53 | */ |
||
| 54 | if (is_array($target)) { |
||
| 55 | foreach ($target as &$value) { |
||
| 56 | $value = $this->evaluate($value, $arguments); |
||
| 57 | } |
||
| 58 | } |
||
| 59 | |||
| 60 | return $target; |
||
| 61 | } |
||
| 62 | } |
||
| 63 |