We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Total Complexity | 12 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class BaseAttribute implements SmartAttributeInterface |
||
| 10 | { |
||
| 11 | public function __construct( |
||
| 12 | protected string $name, |
||
| 13 | private $value = null, |
||
| 14 | private $rules = [] |
||
| 15 | ) { |
||
| 16 | } |
||
| 17 | |||
| 18 | public static function getValidationRules(SmartCollectionInterface $attributes): array |
||
| 19 | { |
||
| 20 | return []; |
||
| 21 | } |
||
| 22 | |||
| 23 | public static function make(string $name, $value = null, $rules = []) |
||
| 24 | { |
||
| 25 | return new static($name, $value, $rules); |
||
| 26 | } |
||
| 27 | |||
| 28 | public static function getDefault(SmartCollectionInterface $attributes) |
||
| 29 | { |
||
| 30 | return null; |
||
| 31 | } |
||
| 32 | |||
| 33 | public static function getAttributeName(): string |
||
| 34 | { |
||
| 35 | return self::$name; |
||
| 36 | } |
||
| 37 | |||
| 38 | public function setValue($value) |
||
| 39 | { |
||
| 40 | $this->validate($value); |
||
| 41 | |||
| 42 | $this->value = $value; |
||
| 43 | |||
| 44 | return $this; |
||
| 45 | } |
||
| 46 | |||
| 47 | public function setRules(array $rules) |
||
| 48 | { |
||
| 49 | $this->rules = $rules; |
||
| 50 | } |
||
| 51 | |||
| 52 | public function rules(): array |
||
| 55 | } |
||
| 56 | |||
| 57 | public function value() |
||
| 58 | { |
||
| 59 | return $this->value; |
||
| 60 | } |
||
| 61 | |||
| 62 | public function name(): string |
||
| 65 | } |
||
| 66 | |||
| 67 | private function validate($value) |
||
| 68 | { |
||
| 73 | } |
||
| 74 | } |
||
| 76 |