1 | <?php |
||
23 | class Fragment extends AbstractComponent implements FragmentInterface |
||
24 | { |
||
25 | |||
26 | /** |
||
27 | * Preserve the delimiter |
||
28 | * |
||
29 | * @var bool |
||
30 | */ |
||
31 | protected $preserveDelimiter = false; |
||
32 | |||
33 | /** |
||
34 | * new instance |
||
35 | * |
||
36 | * @param string|null $data the component value |
||
37 | */ |
||
38 | 757 | public function __construct($data = null) |
|
39 | { |
||
40 | 757 | if ($data !== null) { |
|
41 | 409 | $this->preserveDelimiter = true; |
|
42 | 409 | $this->data = $this->decodeQueryFragment($this->validateString($data)); |
|
43 | 264 | } |
|
44 | 745 | } |
|
45 | |||
46 | /** |
||
47 | * @inheritdoc |
||
48 | */ |
||
49 | 12 | public static function __set_state(array $properties) |
|
56 | |||
57 | /** |
||
58 | * @inheritdoc |
||
59 | */ |
||
60 | 2 | public function __debugInfo() |
|
64 | |||
65 | /** |
||
66 | * Returns the component literal value |
||
67 | * |
||
68 | * @return string|null |
||
69 | */ |
||
70 | 763 | public function getContent() |
|
78 | |||
79 | /** |
||
80 | * Returns the instance string representation |
||
81 | * with its optional URI delimiters |
||
82 | * |
||
83 | * @return string |
||
84 | */ |
||
85 | 761 | public function getUriComponent() |
|
94 | |||
95 | /** |
||
96 | * Returns an instance with the specified string |
||
97 | * |
||
98 | * This method MUST retain the state of the current instance, and return |
||
99 | * an instance that contains the modified data |
||
100 | * |
||
101 | * @param string $value |
||
102 | * |
||
103 | * @return static |
||
104 | */ |
||
105 | 6 | public function modify($value) |
|
117 | } |
||
118 |