8000 Review fixes · symfony/symfony@7d8f156 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7d8f156

Browse files
committed
Review fixes
1 parent 3252b42 commit 7d8f156

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/Symfony/Component/HttpFoundation/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ CHANGELOG
1616
`IniSizeFileException`, `NoFileException`, `NoTmpDirFileException`, `PartialFileException` to
1717
handle failed `UploadedFile`.
1818
* added `MigratingSessionHandler` for migrating between two session handlers without losing sessions
19-
* added `HeaderUtility`.
19+
* added `HeaderUtils`.
2020

2121
4.0.0
2222
-----

src/Symfony/Component/HttpFoundation/HeaderUtils.php

Lines changed: 2 additions & 2 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($header, $separators)
43+
public static function split(string $header, string $separators)
4444
{
4545
$quotedSeparators = preg_quote($separators);
4646

@@ -116,7 +116,7 @@ public static function combineParts(array $parts)
116116
$assoc = array();
117117
foreach ($parts as $part) {
118118
$name = strtolower($part[0]);
119-
$value = isset($part[1]) ? $part[1] : true;
119+
$value = $part[1] ?? true;
120120
$assoc[$name] = $value;
121121
}
122122

src/Symfony/Component/HttpFoundation/Tests/HeaderUtilsTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ public function testJoinAssoc()
6464

6565
public function testQuote()
6666
{
67-
$this->assertEquals('foo', HeaderUtils::quote('foo'));
68-
$this->assertEquals('az09!#$%&\'*.^_`|~-', HeaderUtils::quote('az09!#$%&\'*.^_`|~-'));
69-
$this->assertEquals('"foo bar"', HeaderUtils::quote('foo bar'));
70-
$this->assertEquals('"foo [bar]"' 8CFA , HeaderUtils::quote('foo [bar]'));
71-
$this->assertEquals('"foo \"bar\""', HeaderUtils::quote('foo "bar"'));
72-
$this->assertEquals('"foo \\\\ bar"', HeaderUtils::quote('foo \\ bar'));
67+
$this->assertSame('foo', HeaderUtils::quote('foo'));
68+
$this->assertSame('az09!#$%&\'*.^_`|~-', HeaderUtils::quote('az09!#$%&\'*.^_`|~-'));
69+
$this->assertSame('"foo bar"', HeaderUtils::quote('foo bar'));
70+
$this->assertSame('"foo [bar]"', HeaderUtils::quote('foo [bar]'));
71+
$this->assertSame('"foo \"bar\""', HeaderUtils::quote('foo "bar"'));
72+
$this->assertSame('"foo \\\\ bar"', HeaderUtils::quote('foo \\ bar'));
7373
}
7474

7575
public function testUnquote()

0 commit comments

Comments
 (0)
0