| Total Complexity | 6 |
| Total Lines | 87 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | final class StructureField implements FieldInterface |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | private $fieldName; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var bool |
||
| 16 | */ |
||
| 17 | private $required; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var callable|null |
||
| 21 | */ |
||
| 22 | private $condition; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var bool |
||
| 26 | */ |
||
| 27 | private $isArray; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @var Strategy |
||
| 31 | */ |
||
| 32 | private $strategy; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * StructureField constructor. |
||
| 36 | * @param string $fieldName |
||
| 37 | * @param bool $required |
||
| 38 | * @param callable|null $condition |
||
| 39 | * @param bool $isArray |
||
| 40 | * @param Strategy $strategy |
||
| 41 | */ |
||
| 42 | public function __construct( |
||
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @inheritdoc |
||
| 58 | */ |
||
| 59 | public function fieldName(): string |
||
| 60 | { |
||
| 61 | return $this->fieldName; |
||
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @inheritdoc |
||
| 66 | */ |
||
| 67 | public function required(): bool |
||
| 68 | { |
||
| 69 | return $this->required; |
||
| 70 | } |
||
| 71 | |||
| 72 | /** |
||
| 73 | * @inheritdoc |
||
| 74 | */ |
||
| 75 | public function condition(): ?callable |
||
| 78 | } |
||
| 79 | |||
| 80 | /** |
||
| 81 | * @inheritdoc |
||
| 82 | */ |
||
| 83 | public function isArray(): bool |
||
| 84 | { |
||
| 85 | return $this->isArray; |
||
| 86 | } |
||
| 87 | |||
| 88 | /** |
||
| 89 | * @return Strategy |
||
| 90 | */ |
||
| 91 | public function strategy(): Strategy |
||
| 94 | } |
||
| 95 | } |
||
| 96 |