Code Duplication    Length = 10-12 lines in 2 locations

src/ContainerBuilder.php 2 locations

@@ 507-518 (lines=12) @@
504
         * Iterate all properties and create internal scope reflection class instance if
505
         * at least one property in not public
506
         */
507
        foreach ($propertiesMetadata as $propertyMetadata) {
508
            if (!$propertyMetadata->isPublic) {
509
                $this->generator
510
                    ->comment('Create reflection class for injecting private/protected properties and methods')
511
                    ->newLine($reflectionVariable . ' = new \ReflectionClass(\'' . $className . '\');')
512
                    ->newLine();
513
514
                $reflectionClassCreated = true;
515
516
                break;
517
            }
518
        }
519
520
        /**
521
         * Iterate all properties and create internal scope reflection class instance if
@@ 525-534 (lines=10) @@
522
         * at least one property in not public
523
         */
524
        if (!$reflectionClassCreated) {
525
            foreach ($methodsMetadata as $methodMetadata) {
526
                if (!$methodMetadata->isPublic) {
527
                    $this->generator
528
                        ->comment('Create reflection class for injecting private/protected properties and methods')
529
                        ->newLine($reflectionVariable . ' = new \ReflectionClass(\'' . $className . '\');')
530
                        ->newLine();
531
532
                    break;
533
                }
534
            }
535
        }
536
    }
537