| @@ 24-29 (lines=6) @@ | ||
| 21 | ]; |
|
| 22 | ||
| 23 | // check for invalid keys |
|
| 24 | if ($diff = array_diff(array_keys($options), array_keys($defaults))) { |
|
| 25 | throw new \InvalidArgumentException(sprintf( |
|
| 26 | 'Invalid grid options "%s". Valid options: "%s"', |
|
| 27 | implode('", "', $diff), implode('", "', array_keys($defaults)) |
|
| 28 | )); |
|
| 29 | } |
|
| 30 | ||
| 31 | // set defaults |
|
| 32 | $options = array_merge($defaults, $options); |
|
| @@ 121-126 (lines=6) @@ | ||
| 118 | ||
| 119 | private function resolveConfig(array $defaultConfig, array $config) |
|
| 120 | { |
|
| 121 | if ($diff = array_diff(array_keys($config), array_keys($defaultConfig))) { |
|
| 122 | throw new \InvalidArgumentException(sprintf( |
|
| 123 | 'Invalid configuration keys "%s" for grid, valid keys: "%s"', |
|
| 124 | implode('", "', $diff), implode('", "', array_keys($defaultConfig)) |
|
| 125 | )); |
|
| 126 | } |
|
| 127 | ||
| 128 | return array_merge($defaultConfig, $config); |
|
| 129 | } |
|
| @@ 48-53 (lines=6) @@ | ||
| 45 | SelectView::INPUT_NAME, |
|
| 46 | ]; |
|
| 47 | ||
| 48 | if ($diff = array_diff($required, array_keys($postData))) { |
|
| 49 | throw new \InvalidArgumentException(sprintf( |
|
| 50 | 'Expected all keys "%s" in post data, but (only) got "%s"', |
|
| 51 | implode('", "', $required), implode('", "', array_keys($postData)) |
|
| 52 | )); |
|
| 53 | } |
|
| 54 | ||
| 55 | $actionName = $postData[ActionBar::INPUT_NAME]; |
|
| 56 | $selectedIdentifiers = array_keys($postData[SelectView::INPUT_NAME]); |
|