Skip to content

Commit 2bb54da

Browse files
committed
Add type hints
1 parent 7d8f156 commit 2bb54da

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Symfony/Component/HttpFoundation/HeaderUtils.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ private function __construct()
4040
* @return array Nested array with as many levels as there are characters in
4141
* $separators
4242
*/
43-
public static function split(string $header, string $separators)
43+
public static function split(string $header, string $separators): array
4444
{
4545
$quotedSeparators = preg_quote($separators);
4646

@@ -65,7 +65,7 @@ public static function split(string $header, string $separators)
6565
return self::groupParts($matches, $separators);
6666
}
6767

68-
private static function groupParts(array $matches, $separators)
68+
private static function groupParts(array $matches, string $separators): array
6969
{
7070
$separator = $separators[0];
7171
$partSeparators = substr($separators, 1);
@@ -111,7 +111,7 @@ private static function groupParts(array $matches, $separators)
111111
*
112112
* @return array Associative array
113113
*/
114-
public static function combineParts(array $parts)
114+
public static function combineParts(array $parts): array
115115
{
116116
$assoc = array();
117117
foreach ($parts as $part) {
@@ -140,7 +140,7 @@ public static function combineParts(array $parts)
140140
*
141141
* @return string A string formatted for use in an HTTP header
142142
*/
143-
public static function joinAssoc(array $assoc, $separator)
143+
public static function joinAssoc(array $assoc, string $separator): string
144144
{
145145
$parts = array();
146146
foreach ($assoc as $name => $value) {
@@ -165,7 +165,7 @@ public static function joinAssoc(array $assoc, $separator)
165165
*
166166
* @return return The quoted string
167167
*/
168-
public static function quote($s)
168+
public static function quote(string $s): string
169169
{
170170
if (preg_match('/^[a-z0-9!#$%&\'*.^_`|~-]+$/i', $s)) {
171171
return $s;
@@ -184,7 +184,7 @@ public static function quote($s)
184184
*
185185
* @return string The raw string
186186
*/
187-
public static function unquote($s)
187+
public static function unquote(string $s): string
188188
{
189189
return preg_replace('/\\\\(.)|"/', '$1', $s);
190190
}

0 commit comments

Comments
 (0)