@@ 24-36 (lines=13) @@ | ||
21 | ||
22 | protected static function validate(array $options) |
|
23 | { |
|
24 | if (array_key_exists('handlers', $options)) { |
|
25 | $handlers = $options['handlers']; |
|
26 | ||
27 | if (! is_array($handlers)) { |
|
28 | throw InvalidOptionsException::forInvalidHandlers($handlers); |
|
29 | } |
|
30 | ||
31 | foreach ($handlers as $handler) { |
|
32 | if (! ($handler instanceof HandlerInterface || is_array($handler))) { |
|
33 | throw InvalidOptionsException::forInvalidHandler($handler); |
|
34 | } |
|
35 | } |
|
36 | } |
|
37 | ||
38 | if (array_key_exists('processors', $options)) { |
|
39 | $processors = $options['processors']; |
|
@@ 38-50 (lines=13) @@ | ||
35 | } |
|
36 | } |
|
37 | ||
38 | if (array_key_exists('processors', $options)) { |
|
39 | $processors = $options['processors']; |
|
40 | ||
41 | if (! is_array($processors)) { |
|
42 | throw InvalidOptionsException::forInvalidProcessors($options['processors']); |
|
43 | } |
|
44 | ||
45 | foreach ($processors as $processor) { |
|
46 | if (! (is_callable($processor) || is_array($processor))) { |
|
47 | throw InvalidOptionsException::forInvalidProcessor($processor); |
|
48 | } |
|
49 | } |
|
50 | } |
|
51 | } |
|
52 | } |
|
53 |
@@ 32-44 (lines=13) @@ | ||
29 | } |
|
30 | } |
|
31 | ||
32 | if (array_key_exists('processors', $options)) { |
|
33 | $processors = $options['processors']; |
|
34 | ||
35 | if (! is_array($processors)) { |
|
36 | throw InvalidOptionsException::forInvalidProcessors($options['processors']); |
|
37 | } |
|
38 | ||
39 | foreach ($processors as $processor) { |
|
40 | if (! (is_callable($processor) || is_array($processor))) { |
|
41 | throw InvalidOptionsException::forInvalidProcessor($processor); |
|
42 | } |
|
43 | } |
|
44 | } |
|
45 | } |
|
46 | } |
|
47 |