Code Duplication    Length = 10-12 lines in 2 locations

src/ContainerBuilder.php 2 locations

@@ 476-487 (lines=12) @@
473
         * Iterate all properties and create internal scope reflection class instance if
474
         * at least one property in not public
475
         */
476
        foreach ($propertiesMetadata as $propertyMetadata) {
477
            if (!$propertyMetadata->isPublic) {
478
                $this->generator
479
                    ->comment('Create reflection class for injecting private/protected properties and methods')
480
                    ->newLine($reflectionVariable . ' = new \ReflectionClass(\'' . $className . '\');')
481
                    ->newLine();
482
483
                $reflectionClassCreated = true;
484
485
                break;
486
            }
487
        }
488
489
        /**
490
         * Iterate all properties and create internal scope reflection class instance if
@@ 494-503 (lines=10) @@
491
         * at least one property in not public
492
         */
493
        if (!$reflectionClassCreated) {
494
            foreach ($methodsMetadata as $methodMetadata) {
495
                if (!$methodMetadata->isPublic) {
496
                    $this->generator
497
                        ->comment('Create reflection class for injecting private/protected properties and methods')
498
                        ->newLine($reflectionVariable . ' = new \ReflectionClass(\'' . $className . '\');')
499
                        ->newLine();
500
501
                    break;
502
                }
503
            }
504
        }
505
    }
506