1 | <?php |
||
24 | abstract class AbstractComponent |
||
25 | { |
||
26 | use ImmutableComponentTrait; |
||
27 | |||
28 | /** |
||
29 | * The component data |
||
30 | * |
||
31 | * @var int|string |
||
32 | */ |
||
33 | protected $data; |
||
34 | |||
35 | /** |
||
36 | * @inheritdoc |
||
37 | */ |
||
38 | 12 | public static function __set_state(array $properties) |
|
42 | |||
43 | /** |
||
44 | * new instance |
||
45 | * |
||
46 | * @param string|null $data the component value |
||
47 | */ |
||
48 | 1262 | public function __construct($data = null) |
|
52 | |||
53 | /** |
||
54 | * Validate the component string |
||
55 | * |
||
56 | * @param mixed $data |
||
57 | * |
||
58 | * @throws InvalidArgumentException if the component is no valid |
||
59 | * |
||
60 | * @return mixed |
||
61 | */ |
||
62 | 1018 | protected function validate($data) |
|
70 | |||
71 | |||
72 | /** |
||
73 | * The component raw data |
||
74 | * |
||
75 | * @return mixed |
||
76 | */ |
||
77 | 768 | public function getContent() |
|
81 | |||
82 | /** |
||
83 | * @inheritdoc |
||
84 | */ |
||
85 | 10 | public function __debugInfo() |
|
91 | |||
92 | /** |
||
93 | * Returns the instance string representation; If the |
||
94 | * instance is not defined an empty string is returned |
||
95 | * |
||
96 | * @return string |
||
97 | */ |
||
98 | 1137 | public function __toString() |
|
102 | |||
103 | /** |
||
104 | * Returns the instance string representation |
||
105 | * with its optional URI delimiters |
||
106 | * |
||
107 | * @return string |
||
108 | */ |
||
109 | 183 | public function getUriComponent() |
|
113 | |||
114 | /** |
||
115 | * Returns an instance with the specified string |
||
116 | * |
||
117 | * This method MUST retain the state of the current instance, and return |
||
118 | * an instance that contains the modified data |
||
119 | * |
||
120 | * @param string $value |
||
121 | * |
||
122 | * @return static |
||
123 | */ |
||
124 | 387 | public function modify($value) |
|
132 | } |
||
133 |