Code Duplication    Length = 8-9 lines in 2 locations

src/Service/EntitiesGeneratorService.php 2 locations

@@ 316-323 (lines=8) @@
313
314
    private static function registerProperty(PhpClass $class, $name, $description, $type)
315
    {
316
        if (!$class->hasProperty($name)) {
317
            $property = PhpProperty::create($name);
318
            $property->setDescription($description);
319
            $property->setType($type);
320
            $property->setVisibility('protected');
321
322
            $class->setProperty($property);
323
        }
324
325
        $isDirtyName = 'dirty'.ucfirst($name);
326
        if (!$class->hasProperty($isDirtyName)) {
@@ 326-334 (lines=9) @@
323
        }
324
325
        $isDirtyName = 'dirty'.ucfirst($name);
326
        if (!$class->hasProperty($isDirtyName)) {
327
            $dirtyProperty = PhpProperty::create($isDirtyName);
328
            $dirtyProperty->setDescription("Whether '$name' has been changed or not.");
329
            $dirtyProperty->setType('bool');
330
            $dirtyProperty->setVisibility('protected');
331
            $dirtyProperty->setDefaultValue(false);
332
333
            $class->setProperty($dirtyProperty);
334
        }
335
336
        $getterName = 'get'.ucfirst($name);
337
        $getterDescription = 'Get '.lcfirst($description);