Code Duplication    Length = 8-9 lines in 2 locations

src/Service/EntitiesGeneratorService.php 2 locations

@@ 356-363 (lines=8) @@
353
354
    private static function registerProperty(PhpClass $class, $name, $description, $type)
355
    {
356
        if (!$class->hasProperty($name)) {
357
            $property = PhpProperty::create($name);
358
            $property->setDescription($description);
359
            $property->setType($type);
360
            $property->setVisibility('protected');
361
362
            $class->setProperty($property);
363
        }
364
365
        $isDirtyName = 'dirty'.ucfirst($name);
366
        if (!$class->hasProperty($isDirtyName)) {
@@ 366-374 (lines=9) @@
363
        }
364
365
        $isDirtyName = 'dirty'.ucfirst($name);
366
        if (!$class->hasProperty($isDirtyName)) {
367
            $dirtyProperty = PhpProperty::create($isDirtyName);
368
            $dirtyProperty->setDescription("Whether '$name' has been changed or not.");
369
            $dirtyProperty->setType('bool');
370
            $dirtyProperty->setVisibility('protected');
371
            $dirtyProperty->setDefaultValue(false);
372
373
            $class->setProperty($dirtyProperty);
374
        }
375
376
        $getterName = 'get'.ucfirst($name);
377
        $getterDescription = 'Get '.lcfirst($description);