@@ -40,7 +40,7 @@ private function __construct()
40
40
* @return array Nested array with as many levels as there are characters in
41
41
* $separators
42
42
*/
43
- public static function split (string $ header , string $ separators )
43
+ public static function split (string $ header , string $ separators ): array
44
44
{
45
45
$ quotedSeparators = preg_quote ($ separators );
46
46
@@ -65,7 +65,7 @@ public static function split(string $header, string $separators)
65
65
return self ::groupParts ($ matches , $ separators );
66
66
}
67
67
68
- private static function groupParts (array $ matches , $ separators )
68
+ private static function groupParts (array $ matches , string $ separators ): array
69
69
{
70
70
$ separator = $ separators [0 ];
71
71
$ partSeparators = substr ($ separators , 1 );
@@ -111,7 +111,7 @@ private static function groupParts(array $matches, $separators)
111
111
*
112
112
* @return array Associative array
113
113
*/
114
- public static function combineParts (array $ parts )
114
+ public static function combineParts (array $ parts ): array
115
115
{
116
116
$ assoc = array ();
117
117
foreach ($ parts as $ part ) {
@@ -140,7 +140,7 @@ public static function combineParts(array $parts)
140
140
*
141
141
* @return string A string formatted for use in an HTTP header
142
142
*/
143
- public static function joinAssoc (array $ assoc , $ separator )
143
+ public static function joinAssoc (array $ assoc , string $ separator ): string
144
144
{
145
145
$ parts = array ();
146
146
foreach ($ assoc as $ name => $ value ) {
@@ -165,7 +165,7 @@ public static function joinAssoc(array $assoc, $separator)
165
165
*
166
166
* @return return The quoted string
167
167
*/
168
- public static function quote ($ s )
168
+ public static function quote (string $ s ): string
169
169
{
170
170
if (preg_match ('/^[a-z0-9!#$%& \'*.^_`|~-]+$/i ' , $ s )) {
171
171
return $ s ;
@@ -184,7 +184,7 @@ public static function quote($s)
184
184
*
185
185
* @return string The raw string
186
186
*/
187
- public static function unquote ($ s )
187
+ public static function unquote (string $ s ): string
188
188
{
189
189
return preg_replace ('/ \\\\(.)|"/ ' , '$1 ' , $ s );
190
190
}
0 commit comments