Skip to content
This repository has been archived by the owner on Nov 29, 2021. It is now read-only.

Commit

Permalink
fix issue #52
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Krauss authored and Philip Krauss committed Feb 27, 2019
1 parent ef83f84 commit 7e54798
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Events/EventBean.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,34 +170,34 @@ final protected function getMetaResult() : string
*
* @link http://php.net/manual/en/reserved.variables.server.php
* @link https://github.com/philkra/elastic-apm-php-agent/issues/27
* @link https://github.com/philkra/elastic-apm-php-agent/issues/54
*
* @return object
* @return array
*/
final protected function getEnv() : object
final protected function getEnv() : array
{
$envMask = $this->contexts['env'];
$env = empty($envMask)
? $_SERVER
: array_intersect_key($_SERVER, array_flip($envMask));

return (object) $env;
return (object)$env;
}

/**
* Get the cookies
*
* @link https://github.com/philkra/elastic-apm-php-agent/issues/30
* @link https://github.com/philkra/elastic-apm-php-agent/issues/54
*
* @return object
* @return array
*/
final protected function getCookies() : object
final protected function getCookies() : array
{
$cookieMask = $this->contexts['cookies'];
$cookies = empty($cookieMask)
return empty($cookieMask)
? $_COOKIE
: array_intersect_key($_COOKIE, array_flip($cookieMask));

return (object) $cookies;
}

/**
Expand Down Expand Up @@ -250,8 +250,8 @@ final protected function getContext() : array
'user-agent' => $headers['User-Agent'] ?? '',
'cookie' => $this->getCookieHeader($headers['Cookie'] ?? ''),
],
'env' => $this->getEnv(),
'cookies' => $this->getCookies(),
'env' => (object)$this->getEnv(),
'cookies' => (object)$this->getCookies(),
]
];

Expand Down

0 comments on commit 7e54798

Please sign in to comment.