Code Duplication    Length = 6-6 lines in 3 locations

lib/GridContext.php 1 location

@@ 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);

lib/Metadata/Driver/ArrayDriver.php 1 location

@@ 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
    }

lib/Grid.php 1 location

@@ 49-54 (lines=6) @@
46
            SelectView::INPUT_NAME,
47
        ];
48
49
        if (array_diff($required, array_keys($postData))) {
50
            throw new \InvalidArgumentException(sprintf(
51
                'Expected all keys "%s" in post data, but (only) got "%s"',
52
                implode('", "', $required), implode('", "', array_keys($postData))
53
            ));
54
        }
55
56
        $actionName = $postData[ActionBar::INPUT_NAME];
57
        $selectedIdentifiers = array_keys($postData[SelectView::INPUT_NAME]);