Code Duplication    Length = 9-9 lines in 4 locations

Command/GenerateCrudCommand.php 4 locations

@@ 329-337 (lines=9) @@
326
        return new DoctrineCrudGenerator($this->getContainer()->get('filesystem'), $this->bundle, $this->entity);
327
    }
328
329
    protected function getFormGenerator(BundleInterface $bundle, $entity, $metadata)
330
    {
331
        if (null === $this->formGenerator) {
332
            $this->formGenerator = new DoctrineFormGenerator($bundle, $entity, $metadata);
333
            $this->formGenerator->setSkeletonDirs($this->getSkeletonDirs($bundle));
334
        }
335
336
        return $this->formGenerator;
337
    }
338
339
    protected function getSerializationConfigGenerator(BundleInterface $bundle, $entity)
340
    {
@@ 339-347 (lines=9) @@
336
        return $this->formGenerator;
337
    }
338
339
    protected function getSerializationConfigGenerator(BundleInterface $bundle, $entity)
340
    {
341
        if (null === $this->serializationConfigGenerator) {
342
            $this->serializationConfigGenerator = new DoctrineSerializationConfigGenerator($bundle, $entity);
343
            $this->serializationConfigGenerator->setSkeletonDirs($this->getSkeletonDirs($bundle));
344
        }
345
346
        return $this->serializationConfigGenerator;
347
    }
348
349
    public function setFormGenerator(DoctrineFormGenerator $formGenerator)
350
    {
@@ 354-362 (lines=9) @@
351
        $this->formGenerator = $formGenerator;
352
    }
353
354
    protected function getManagerGenerator(BundleInterface $bundle, $entity)
355
    {
356
        if (null === $this->managerGenerator) {
357
            $this->managerGenerator = new DoctrineManagerGenerator($bundle, $entity);
358
            $this->managerGenerator->setSkeletonDirs($this->getSkeletonDirs($bundle));
359
        }
360
361
        return $this->managerGenerator;
362
    }
363
364
    protected function getRepositoryGenerator(BundleInterface $bundle, $entity)
365
    {
@@ 364-372 (lines=9) @@
361
        return $this->managerGenerator;
362
    }
363
364
    protected function getRepositoryGenerator(BundleInterface $bundle, $entity)
365
    {
366
        if (null === $this->repositoryGenerator) {
367
            $this->repositoryGenerator = new DoctrineRepositoryGenerator($bundle, $entity);
368
            $this->repositoryGenerator->setSkeletonDirs($this->getSkeletonDirs($bundle));
369
        }
370
371
        return $this->repositoryGenerator;
372
    }
373
}
374