/**
  * @param Exception $exception
  * @return array
  */
 private function getExceptionExamplePosition(Exception $exception)
 {
     $cause = $exception->getCause();
     foreach ($exception->getTrace() as $call) {
         if (!isset($call['file'])) {
             continue;
         }
         if (!empty($cause) && $cause->getFilename() === $call['file']) {
             return array($call['file'], $call['line']);
         }
     }
     return array($exception->getFile(), $exception->getLine());
 }
Esempio n. 2
0
 /**
  * @param PhpSpecException $exception
  *
  * @return array
  */
 protected function getExceptionExamplePosition(PhpSpecException $exception)
 {
     $refl = $exception->getCause();
     foreach ($exception->getTrace() as $call) {
         if (!isset($call['file'])) {
             continue;
         }
         if (!empty($refl) && $refl->getFilename() === $call['file']) {
             return array($call['file'], $call['line']);
         }
     }
     return array($exception->getFile(), $exception->getLine());
 }