Code Duplication    Length = 11-11 lines in 6 locations

src/Component/Grid/Model/Builder/GridBuilder.php 6 locations

@@ 113-123 (lines=11) @@
110
     *
111
     * @return ColumnInterface[]
112
     */
113
    protected function buildColumns(array $config)
114
    {
115
        $columns = [];
116
117
        foreach (isset($config['columns']) ? $config['columns'] : [] as $name => $column) {
118
            $column = $this->buildColumn(array_merge(['name' => $name], $column), $config);
119
            $columns[$column->getName()] = $column;
120
        }
121
122
        return $columns;
123
    }
124
125
    /**
126
     * @param mixed[] $config
@@ 141-151 (lines=11) @@
138
     *
139
     * @return FilterInterface[]
140
     */
141
    protected function buildFilters(array $config)
142
    {
143
        $filters = [];
144
145
        foreach ((isset($config['filters']) ? $config['filters'] : []) as $name => $filter) {
146
            $filter = $this->buildFilter(array_merge(['name' => $name], $filter), $config);
147
            $filters[$filter->getName()] = $filter;
148
        }
149
150
        return $filters;
151
    }
152
153
    /**
154
     * @param mixed[] $config
@@ 169-179 (lines=11) @@
166
     *
167
     * @return SortInterface[]
168
     */
169
    protected function buildSorts(array $config)
170
    {
171
        $sorts = [];
172
173
        foreach ((isset($config['sorts']) ? $config['sorts'] : []) as $name => $sort) {
174
            $sort = $this->buildSort(array_merge(['name' => $name], $sort), $config);
175
            $sorts[$sort->getName()] = $sort;
176
        }
177
178
        return $sorts;
179
    }
180
181
    /**
182
     * @param mixed[] $config
@@ 197-207 (lines=11) @@
194
     *
195
     * @return ActionInterface[]
196
     */
197
    protected function buildGlobalActions(array $config)
198
    {
199
        $globalActions = [];
200
201
        foreach ((isset($config['global_actions']) ? $config['global_actions'] : []) as $name => $action) {
202
            $action = $this->buildGlobalAction(array_merge(['name' => $name], $action), $config);
203
            $globalActions[$action->getName()] = $action;
204
        }
205
206
        return $globalActions;
207
    }
208
209
    /**
210
     * @param mixed[] $config
@@ 225-235 (lines=11) @@
222
     *
223
     * @return ActionInterface[]
224
     */
225
    protected function buildColumnActions(array $config)
226
    {
227
        $columnActions = [];
228
229
        foreach ((isset($config['column_actions']) ? $config['column_actions'] : []) as $name => $action) {
230
            $action = $this->buildColumnAction(array_merge(['name' => $name], $action), $config);
231
            $columnActions[$action->getName()] = $action;
232
        }
233
234
        return $columnActions;
235
    }
236
237
    /**
238
     * @param mixed[] $config
@@ 253-263 (lines=11) @@
250
     *
251
     * @return BatchInterface[]
252
     */
253
    protected function buildBatches(array $config)
254
    {
255
        $batches = [];
256
257
        foreach ((isset($config['batches']) ? $config['batches'] : []) as $name => $batch) {
258
            $batch = $this->buildBatch(array_merge(['name' => $name], $batch), $config);
259
            $batches[$batch->getName()] = $batch;
260
        }
261
262
        return $batches;
263
    }
264
265
    /**
266
     * @param mixed[] $config