Skip to content

Commit

Permalink
fix GoogleAnalyticsCookieParser plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
moriony committed Sep 29, 2014
1 parent 0dd3f7e commit 15393a1
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ public function __construct($cookieName = self::DEFAULT_COOKIE_NAME)
*/
public function register($client)
{
$client->getEventDispatcher()->addListener('command.before_prepare', function ($e) {
if (!array_key_exists($this->cookieName, $_COOKIE)) {
$cookieName = $this->cookieName;
$client->getEventDispatcher()->addListener('command.before_prepare', function ($e) use($cookieName) {
if (!array_key_exists($cookieName, $_COOKIE)) {
return;
}
$parser = new Parser();
$data = $parser->parse($_COOKIE[$this->cookieName]);
$data = $parser->parse($_COOKIE[$cookieName]);

/** @var \Guzzle\Service\Command\OperationCommand $command */
$command = $e['command'];
Expand Down

0 comments on commit 15393a1

Please sign in to comment.