1 | <?php |
||
15 | class Attribute implements AttributeInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | private $name; |
||
21 | |||
22 | /** |
||
23 | * @var int |
||
24 | */ |
||
25 | private $type; |
||
26 | |||
27 | /** |
||
28 | * @var Matchable |
||
29 | */ |
||
30 | private $matcher; |
||
31 | |||
32 | /** |
||
33 | * Attribute constructor. |
||
34 | * @param string $name |
||
35 | * @param int $type |
||
36 | */ |
||
37 | public function __construct(string $name, int $type = self::TYPE_UNDEFINED) |
||
42 | |||
43 | /** |
||
44 | * @param Matchable $hint |
||
45 | * @return Matchable |
||
46 | */ |
||
47 | public function addMatcher(Matchable $hint): Matchable |
||
53 | |||
54 | /** |
||
55 | * @return bool |
||
56 | */ |
||
57 | public function isReadable(): bool |
||
61 | |||
62 | /** |
||
63 | * @return bool |
||
64 | */ |
||
65 | public function isWritable(): bool |
||
69 | |||
70 | /** |
||
71 | * @param mixed $value |
||
72 | * @return bool |
||
73 | */ |
||
74 | public function match($value): bool |
||
78 | |||
79 | /** |
||
80 | * @return string |
||
81 | */ |
||
82 | public function getName(): string |
||
86 | } |
||
87 |