Code Duplication    Length = 22-22 lines in 2 locations

base/Container.php 1 location

@@ 228-249 (lines=22) @@
225
     * @param array $params
226
     * @return array
227
     */
228
    private function buildCalls(array $params)
229
    {
230
        $callers = [];
231
232
        if (!is_array($params[0])) {
233
            $params = [
234
                $params
235
            ];
236
        }
237
238
        foreach ($params as $arguments) {
239
            if (is_string($arguments[0])) {
240
                if (!empty($arguments[1]) && is_array($arguments[1])) {
241
                    $callers[$arguments[0]] = $this->buildParams($arguments[1]);
242
                } else {
243
                    $callers[$arguments[0]] = null;
244
                }
245
            }
246
        }
247
248
        return $callers;
249
    }
250
251
    /**
252
     * Make object with arguments

base/Injector.php 1 location

@@ 172-193 (lines=22) @@
169
     * @param array $params
170
     * @return array
171
     */
172
    private function buildCalls(array $params)
173
    {
174
        $callers = [];
175
176
        if (!is_array($params[0])) {
177
            $params = [
178
                $params
179
            ];
180
        }
181
182
        foreach ($params as $arguments) {
183
            if (is_string($arguments[0])) {
184
                if (!empty($arguments[1]) && is_array($arguments[1])) {
185
                    $callers[$arguments[0]] = $this->buildParams($arguments[1]);
186
                } else {
187
                    $callers[$arguments[0]] = null;
188
                }
189
            }
190
        }
191
192
        return $callers;
193
    }
194
195
    /**
196
     * Make object with arguments