Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2bb54da

Browse filesBrowse files
committed
Add type hints
1 parent 7d8f156 commit 2bb54da
Copy full SHA for 2bb54da

File tree

1 file changed

+6
-6
lines changed
Filter options

1 file changed

+6
-6
lines changed

‎src/Symfony/Component/HttpFoundation/HeaderUtils.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/HeaderUtils.php
+6-6Lines changed: 6 additions & 6 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.