FactoryClassGenerator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getTemplateName() 0 3 1
A getFile() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Jellyfish\Transfer\Generator;
6
7
use Jellyfish\Transfer\Definition\ClassDefinition;
8
use Jellyfish\Transfer\Definition\ClassDefinitionInterface;
9
10
class FactoryClassGenerator extends AbstractClassGenerator
11
{
12
    protected const TEMPLATE_NAME = 'factory-class.twig';
13
14
    /**
15
     * @param \Jellyfish\Transfer\Definition\ClassDefinitionInterface $classDefinition
16
     *
17
     * @return string
18
     */
19
    protected function getFile(ClassDefinitionInterface $classDefinition): string
20
    {
21
        return $classDefinition->getName() . ClassDefinition::FACTORY_NAME_SUFFIX . static::FILE_EXTENSION;
22
    }
23
24
    /**
25
     * @return string
26
     */
27
    protected function getTemplateName(): string
28
    {
29
        return static::TEMPLATE_NAME;
30
    }
31
}
32