1 | <?php |
||
23 | abstract class AbstractComponent |
||
24 | { |
||
25 | use ImmutableComponentTrait; |
||
26 | |||
27 | /** |
||
28 | * The component data |
||
29 | * |
||
30 | * @var int|string |
||
31 | */ |
||
32 | protected $data; |
||
33 | |||
34 | /** |
||
35 | * new instance |
||
36 | * |
||
37 | * @param string|null $data the component value |
||
38 | */ |
||
39 | 704 | public function __construct($data = null) |
|
45 | |||
46 | /** |
||
47 | * Set data. |
||
48 | * |
||
49 | * @param mixed $data The data to set. |
||
50 | */ |
||
51 | 644 | protected function init($data) |
|
56 | |||
57 | /** |
||
58 | * validate the incoming data |
||
59 | * |
||
60 | * @param string $data |
||
61 | * |
||
62 | * @return string |
||
63 | */ |
||
64 | 322 | protected function validate($data) |
|
71 | |||
72 | /** |
||
73 | * Returns the instance string representation; If the |
||
74 | * instance is not defined an empty string is returned |
||
75 | 474 | * |
|
76 | * @return string |
||
77 | 474 | */ |
|
78 | public function __toString() |
||
82 | |||
83 | 52 | /** |
|
84 | * Returns the instance string representation |
||
85 | 52 | * with its optional URI delimiters |
|
86 | * |
||
87 | * @return string |
||
88 | */ |
||
89 | public function getUriComponent() |
||
93 | |||
94 | /** |
||
95 | * @inheritdoc |
||
96 | */ |
||
97 | public static function __set_state(array $properties) |
||
101 | } |
||
102 |