Test Setup Failed
Push — develop ( c73499...361b2b )
by Freddie
03:04
created

RuleBuilder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 17
rs 10
c 1
b 0
f 0
ccs 8
cts 8
cp 1
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getFileTemplate() 0 3 1
A getPathTemplate() 0 3 1
1
<?php declare(strict_types=1);
2
/*
3
 * This file is part of FlexPHP.
4
 *
5
 * (c) Freddie Gar <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9 7
 */
10
namespace FlexPHP\Generator\Domain\Builders\Constraint;
11 7
12 7
use FlexPHP\Generator\Domain\Builders\AbstractBuilder;
13
14 7
final class RuleBuilder extends AbstractBuilder
15
{
16 7
    public function __construct(string $property, array $constraints)
17 7
    {
18
        $property = $this->getCamelCase($property);
19 7
20
        parent::__construct(\compact('property', 'constraints'));
21 7
    }
22
23
    protected function getFileTemplate(): string
24 7
    {
25
        return 'Rule.php.twig';
26 7
    }
27
28
    protected function getPathTemplate(): string
29 7
    {
30
        return \sprintf('%1$s/FlexPHP/Constraint', parent::getPathTemplate());
31 7
    }
32
}
33