Skip to content

Commit

Permalink
Minor fixups.
Browse files Browse the repository at this point in the history
* Don't allocate 3 arrays when we can do it in one.
* Use methods instead of manipulating internal state.
  • Loading branch information
markstory committed Aug 14, 2016
1 parent f6f293e commit 64ed390
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Http/ResponseTransformer.php
Expand Up @@ -101,7 +101,7 @@ protected static function parseCookies(array $cookieHeader)
}

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

foreach ($parts as $part) {
if (strpos($part, '=') !== false) {
Expand Down
14 changes: 2 additions & 12 deletions tests/TestCase/TestSuite/CookieEncryptedUsingControllerTest.php
Expand Up @@ -41,17 +41,7 @@ public function setUp()
DispatcherFactory::clear();
DispatcherFactory::add('Routing');
DispatcherFactory::add('ControllerFactory');
}

/**
* tear down.
*
* @return void
*/
public function tearDown()
{
parent::tearDown();
$this->_useHttpServer = false;
$this->useHttpServer(false);
}

/**
Expand Down Expand Up @@ -157,7 +147,7 @@ public function testCanAssertCookieEncryptedWithAnotherEncryptionKey()
*/
public function testCanAssertCookieEncryptedWithAesWhenUsingPsr7()
{
$this->_useHttpServer = true;
$this->useHttpServer(true);
$this->get('/cookie_component_test/set_cookie');
$this->assertCookieEncrypted('abc', 'NameOfCookie', 'aes');
}
Expand Down

0 comments on commit 64ed390

Please sign in to comment.