Code Duplication    Length = 20-20 lines in 2 locations

src/DependencyInjection/NeonFileLoader.php 2 locations

@@ 339-358 (lines=20) @@
336
        return true;
337
    }
338
339
    private function processClass($id, &$service, Definition $definition, $file)
340
    {
341
        if (!isset($service['class'])) {
342
            return;
343
        }
344
345
        $class = $service['class'];
346
347
        // nette
348
        if ($class instanceof Entity) {
349
            if (isset($service['arguments']) && !empty($class->attributes)) {
350
                throw new InvalidArgumentException(sprintf('Duplicated definition of arguments for service "%s" in "%s". Check you NEON syntax.', $id, $file));
351
            }
352
353
            $service['arguments'] = $class->attributes;
354
            $class = $class->value;
355
        }
356
357
        $definition->setClass($class);
358
    }
359
360
    private function processFactory($id, array &$service, Definition $definition, $file)
361
    {
@@ 360-379 (lines=20) @@
357
        $definition->setClass($class);
358
    }
359
360
    private function processFactory($id, array &$service, Definition $definition, $file)
361
    {
362
        if (!isset($service['factory'])) {
363
            return;
364
        }
365
366
        $factory = $service['factory'];
367
368
        //nette
369
        if ($factory instanceof Entity) {
370
            if (isset($service['arguments']) && !empty($factory->attributes)) {
371
                throw new InvalidArgumentException(sprintf('Duplicated definition of arguments for service "%s" in "%s". Check you NEON syntax.', $id, $file));
372
            }
373
374
            $service['arguments'] = $factory->attributes;
375
            $factory = $factory->value;
376
        }
377
378
        $definition->setFactory($this->parseFactory($factory, $file));
379
    }
380
381
    private function processArguments(array &$service, Definition $definition, $file)
382
    {