@@ 25-27 (lines=3) @@ | ||
22 | return $this->normalizeArray($declaration); |
|
23 | } |
|
24 | ||
25 | if (isset($declaration['arguments']) && !is_array($declaration['arguments'])) { |
|
26 | throw new \InvalidArgumentException('The "arguments" parameter should be an array of arguments.'); |
|
27 | } |
|
28 | ||
29 | // Adds default value to associative array |
|
30 | return array_merge(['method' => null, 'required' => true, 'arguments' => []], $declaration); |
|
@@ 52-54 (lines=3) @@ | ||
49 | ||
50 | private function normalizeArray($declaration) |
|
51 | { |
|
52 | if (isset($declaration[1]) && !is_array($declaration[1])) { |
|
53 | throw new \InvalidArgumentException('The second argument for a resource configuration, when expressed with a numerically indexed array, should be an array of arguments.'); |
|
54 | } |
|
55 | ||
56 | $service = $declaration[0]; |
|
57 | $method = null; |