FactoryClassGenerator::getTemplateName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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