Code Duplication    Length = 10-12 lines in 2 locations

src/ContainerBuilder.php 2 locations

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