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

RuleBuilder::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

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