Code Duplication    Length = 15-15 lines in 2 locations

base/Container.php 1 location

@@ 261-275 (lines=15) @@
258
     *
259
     * @return mixed
260
     */
261
    private function makeObject($className, array $arguments = [])
262
    {
263
        try {
264
            $reflection = new \ReflectionClass($className);
265
            $reflectionMethod = new \ReflectionMethod($className, '__construct');
266
267
            if ($reflectionMethod->getNumberOfParameters() === 0) {
268
                return new $className;
269
            } else {
270
                return $reflection->newInstanceArgs($arguments);
271
            }
272
        } catch (Exception $e) {
273
            return false;
274
        }
275
    }
276
}
277

base/Injector.php 1 location

@@ 215-229 (lines=15) @@
212
     *
213
     * @return mixed
214
     */
215
    private function makeObject($className, array $arguments = [])
216
    {
217
        try {
218
            $reflection = new \ReflectionClass($className);
219
            $reflectionMethod = new \ReflectionMethod($className, '__construct');
220
221
            if ($reflectionMethod->getNumberOfParameters() === 0) {
222
                return new $className;
223
            } else {
224
                return $reflection->newInstanceArgs($arguments);
225
            }
226
        } catch (Exception $e) {
227
            return false;
228
        }
229
    }
230
}