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

@@ 140-161 (lines=22) @@
137
     * @param array $params
138
     * @return array
139
     */
140
    private function buildCalls(array $params)
141
    {
142
        $callers = [];
143
144
        if (!is_array($params[0])) {
145
            $params = [
146
                $params
147
            ];
148
        }
149
150
        foreach ($params as $arguments) {
151
            if (is_string($arguments[0])) {
152
                if (!empty($arguments[1]) && is_array($arguments[1])) {
153
                    $callers[$arguments[0]] = $this->buildParams($arguments[1]);
154
                } else {
155
                    $callers[$arguments[0]] = null;
156
                }
157
            }
158
        }
159
160
        return $callers;
161
    }
162
163
    /**
164
     * Make object with arguments