Skip to content

Commit 64ed390

Browse files
committed
Minor fixups.
* Don't allocate 3 arrays when we can do it in one. * Use methods instead of manipulating internal state.
1 parent f6f293e commit 64ed390

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

src/Http/ResponseTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ protected static function parseCookies(array $cookieHeader)
101101
}
102102

103103
list($name, $value) = explode('=', array_shift($parts), 2);
104-
$parsed = compact('name') + ['value' => urldecode($value)];
104+
$parsed = ['name' => $name, 'value' => urldecode($value)];
105105

106106
foreach ($parts as $part) {
107107
if (strpos($part, '=') !== false) {

tests/TestCase/TestSuite/CookieEncryptedUsingControllerTest.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,7 @@ public function setUp()
4141
DispatcherFactory::clear();
4242
DispatcherFactory::add('Routing');
4343
DispatcherFactory::add('ControllerFactory');
44-
}
45-
46-
/**
47-
* tear down.
48-
*
49-
* @return void
50-
*/
51-
public function tearDown()
52-
{
53-
parent::tearDown();
54-
$this->_useHttpServer = false;
44+
$this->useHttpServer(false);
5545
}
5646

5747
/**
@@ -157,7 +147,7 @@ public function testCanAssertCookieEncryptedWithAnotherEncryptionKey()
157147
*/
158148
public function testCanAssertCookieEncryptedWithAesWhenUsingPsr7()
159149
{
160-
$this->_useHttpServer = true;
150+
$this->useHttpServer(true);
161151
$this->get('/cookie_component_test/set_cookie');
162152
$this->assertCookieEncrypted('abc', 'NameOfCookie', 'aes');
163153
}

0 commit comments

Comments
 (0)