/**
  * @param Call $call
  * @param int $type
  * @param string $msg
  */
 public function register(Call $call, $type, $msg)
 {
     if (E_USER_DEPRECATED !== $type) {
         return;
     }
     $group = 'remaining';
     if (0 !== error_reporting()) {
         $group = 'unsilenced';
     }
     if ($call instanceof DefinitionCall) {
         $scenario = $this->detectScenario($call->getFeature(), $call->getStep());
         if ($call->getFeature()->hasTag('legacy') || $scenario->hasTag('legacy')) {
             $group = 'legacy';
         }
         $feature = $scenario->getKeyword() . ': ' . $scenario->getTitle();
         $keyFeature = $feature . ' ' . $call->getFeature()->getFile() . ' ' . $scenario->getLine();
         $this->deprecations[$group][$msg][$keyFeature]['feature'] = $feature;
         $this->deprecations[$group][$msg][$keyFeature]['file'] = $call->getFeature()->getFile();
         $this->deprecations[$group][$msg][$keyFeature]['line'] = $scenario->getLine();
         if (!isset($this->deprecations[$group][$msg][$keyFeature]['count'])) {
             $this->deprecations[$group][$msg][$keyFeature]['count'] = 0;
         }
         $this->deprecations[$group][$msg][$keyFeature]['count']++;
         $step = $call->getStep()->getKeyword() . ' ' . $call->getStep()->getText();
         $keyStep = $step . ' ' . $call->getFeature()->getLine();
         $this->deprecations[$group][$msg][$keyFeature]['steps'][$keyStep]['step'] = $step;
         $this->deprecations[$group][$msg][$keyFeature]['steps'][$keyStep]['line'] = $call->getStep()->getLine();
         if (!isset($this->deprecations[$group][$msg][$keyFeature]['steps'][$keyStep]['count'])) {
             $this->deprecations[$group][$msg][$keyFeature]['steps'][$keyStep]['count'] = 0;
         }
         $this->deprecations[$group][$msg][$keyFeature]['steps'][$keyStep]['count']++;
     }
     if (!isset($this->deprecations[$group][$msg]['count'])) {
         $this->deprecations[$group][$msg]['count'] = 0;
     }
     $this->deprecations[$group][$msg]['count']++;
     $this->deprecations[$group . 'Count']++;
     $this->registerShutdownFunction();
 }
Example #2
0
 /**
  * Starts error handler and stdout buffering.
  *
  * @param Call $call
  */
 private function startErrorAndOutputBuffering(Call $call)
 {
     $errorReporting = $call->getErrorReportingLevel() ?: $this->errorReportingLevel;
     set_error_handler(array($this, 'handleError'), $errorReporting);
     $this->obStarted = ob_start();
 }