PHPSpec2\Formatter\Presenter\StringPresenter::getExceptionExamplePosition PHP Method

getExceptionExamplePosition() protected method

protected getExceptionExamplePosition ( Exception $exception )
$exception Exception
    protected function getExceptionExamplePosition(Exception $exception)
    {
        $refl = $exception->cause;
        foreach ($exception->getTrace() as $call) {
            if (!isset($call['file'])) {
                continue;
            }
            if ($refl->getFilename() === $call['file']) {
                return array($call['file'], $call['line']);
            }
        }
        return array($exception->getFile(), $exception->getLine());
    }