| Total Complexity | 9 |
| Total Lines | 61 |
| Duplicated Lines | 0 % |
| Coverage | 76.19% |
| Changes | 2 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 12 | abstract class AbstractConstraint implements ConstraintInterface |
||
| 13 | { |
||
| 14 | 1 | use NameWorksTrait; |
|
| 15 | 1 | use Traits\InitTrait; |
|
| 16 | |||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | protected $name = null; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @return string |
||
| 24 | */ |
||
| 25 | 4 | public function getName(): string |
|
| 26 | { |
||
| 27 | 4 | if ($this->name === null) { |
|
| 28 | $this->initName(); |
||
| 29 | } |
||
| 30 | |||
| 31 | 4 | return $this->name; |
|
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @param string $name |
||
| 36 | */ |
||
| 37 | 4 | public function setName(string $name) |
|
| 38 | { |
||
| 39 | 4 | $this->name = $name; |
|
| 40 | 4 | } |
|
| 41 | |||
| 42 | protected function initName() |
||
| 43 | { |
||
| 44 | $this->name = $this->generateName(); |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @return string |
||
| 49 | */ |
||
| 50 | 4 | protected function generateName() |
|
| 53 | } |
||
| 54 | |||
| 55 | |||
| 56 | /** |
||
| 57 | * @param $variables |
||
| 58 | */ |
||
| 59 | 1 | protected function applyVariables($variables) |
|
| 63 | } |
||
| 64 | 1 | } |
|
| 65 | |||
| 66 | /** |
||
| 67 | * @param $code |
||
| 68 | */ |
||
| 69 | 1 | public function getErrorMessage($code) |
|
| 73 | } |
||
| 74 | 1 | } |
|
| 76 |