1 | <?php |
||
21 | trait TranscoderTrait |
||
22 | { |
||
23 | protected static $pathRegexp = "/(?:[^\!\$&'\(\)\*\+,;\=\:\/@%]+|%(?![A-Fa-f0-9]{2}))/S"; |
||
24 | |||
25 | protected static $queryFragmentRegexp = "/(?:[^\!\$&'\(\)\*\+,;\=\:\/@%\?]+|%(?![A-Fa-f0-9]{2}))/S"; |
||
26 | |||
27 | protected static $encodedRegexp = ',%(?<encode>[0-9a-fA-F]{2}),'; |
||
28 | |||
29 | protected static $unreservedRegexp = '/[\w\.~]+/'; |
||
30 | |||
31 | /** |
||
32 | * Reserved characters list |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | protected static $reservedCharactersRegex = "\!\$&'\(\)\*\+,;\=\:"; |
||
37 | |||
38 | /** |
||
39 | * Encode a string according to RFC3986 Rules |
||
40 | * |
||
41 | * @param string $subject |
||
42 | * |
||
43 | * @return string |
||
44 | */ |
||
45 | 699 | protected static function encodeQueryFragment($subject) |
|
49 | |||
50 | /** |
||
51 | * Encode a component string |
||
52 | * |
||
53 | * @param string $subject The string to encode |
||
54 | * @param string $regexp The component specific regular expression |
||
55 | * |
||
56 | * @return string |
||
57 | */ |
||
58 | 1505 | protected static function encodeComponent($subject, $regexp) |
|
72 | |||
73 | /** |
||
74 | * Encoding string according to RFC3986 |
||
75 | * |
||
76 | * @param string $subject |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | 673 | protected static function encode($subject) |
|
87 | |||
88 | /** |
||
89 | * Decode a string according to RFC3986 Rules |
||
90 | * |
||
91 | * @param string $subject |
||
92 | * |
||
93 | * @return string |
||
94 | */ |
||
95 | 696 | protected static function decodeQueryFragment($subject) |
|
113 | |||
114 | /** |
||
115 | * Encode a path string according to RFC3986 |
||
116 | * |
||
117 | * @param string $subject can be a string or an array |
||
118 | * |
||
119 | * @return string The same type as the input parameter |
||
120 | */ |
||
121 | 1133 | protected static function encodePath($subject) |
|
125 | |||
126 | /** |
||
127 | * Decode a path string according to RFC3986 |
||
128 | * |
||
129 | * @param string $subject can be a string or an array |
||
130 | * |
||
131 | * @return string The same type as the input parameter |
||
132 | */ |
||
133 | protected static function decodePath($subject) |
||
141 | } |
||
142 |