Airbrake\Configuration::getParameters PHP Method

getParameters() public method

Get the combined server parameters. Note that these parameters will be filtered according to a black list of key names to ignore. If you wish to get the unfiltered results you should use the getUnfilteredParameters method instead.
public getParameters ( ) : array
return array
    public function getParameters()
    {
        $parameters = $this->getUnfilteredParameters();
        foreach ($this->parameterFilters as $filter) {
            /** @var \Airbrake\Filter\FilterInterface $filter */
            $filter->filter($parameters);
        }
        return $parameters;
    }

Usage Example

Example #1
0
 /**
  * Convert the notice to xml
  *
  * @param Airbrake\Configuration $configuration
  * @return string
  */
 public function toXml(Configuration $configuration)
 {
     $doc = new SimpleXMLElement('<notice />');
     $doc->addAttribute('version', Version::API);
     $doc->addChild('api-key', $configuration->get('apiKey'));
     $notifier = $doc->addChild('notifier');
     $notifier->addChild('name', Version::NAME);
     $notifier->addChild('version', Version::NUMBER);
     $notifier->addChild('url', Version::APP_URL);
     $env = $doc->addChild('server-environment');
     $env->addChild('project-root', $configuration->get('projectRoot'));
     $env->addChild('environment-name', $configuration->get('environmentName'));
     $error = $doc->addChild('error');
     $error->addChild('class', $this->errorClass);
     $error->addChild('message', htmlspecialchars($this->errorMessage));
     if (count($this->backtrace) > 0) {
         $backtrace = $error->addChild('backtrace');
         foreach ($this->backtrace as $entry) {
             $method = isset($entry['class']) ? $entry['class'] . '::' : '';
             $method .= isset($entry['function']) ? $entry['function'] : '';
             $line = $backtrace->addChild('line');
             $line->addAttribute('file', isset($entry['file']) ? $entry['file'] : '');
             $line->addAttribute('number', isset($entry['line']) ? $entry['line'] : '');
             $line->addAttribute('method', $method);
         }
     }
     $request = $doc->addChild('request');
     $request->addChild('url', $configuration->get('url'));
     $request->addChild('component', $configuration->get('component'));
     $request->addChild('action', $configuration->get('action'));
     $this->array2Node($request, 'params', array_merge($configuration->getParameters(), array('airbrake_extra' => $this->extraParameters)));
     $this->array2Node($request, 'session', $configuration->get('sessionData'));
     $this->array2Node($request, 'cgi-data', $configuration->get('serverData'));
     return $doc->asXML();
 }
All Usage Examples Of Airbrake\Configuration::getParameters