public function addFrame($file, $line, $method, $class = null)
    {
        // Account for special "filenames" in eval'd code
        $matches = [];
        if (preg_match("/^(.*?)\((\d+)\) : (?:eval\(\)'d code|runtime-created function)$/", $file, $matches)) {
            $file = $matches[1];
            $line = $matches[2];
        }

        // Construct the frame
        $frame = [
            'lineNumber' => (int) $line,
            'method' => $class ? "$class::$method" : $method,
        ];

        // Attach some lines of code for context
        if ($this->config->shouldSendCode()) {
            $frame['code'] = $this->getCode($file, $line, static::NUM_LINES);
        }

        // Check if this frame is inProject
        $frame['inProject'] = $this->config->isInProject($file);

        // Strip out projectRoot from start of file path
        $frame['file'] = $this->config->getStrippedFilePath($file);

        $this->frames[] = $frame;
    }
public function addFrame($file, $line, $method, $class = null)
    {
        // Account for special "filenames" in eval'd code
        $matches = [];
        if (preg_match("/^(.*?)\((\d+)\) : (?:eval\(\)'d code|runtime-created function)$/", $file, $matches)) {
            $file = $matches[1];
            $line = $matches[2];
        }

        // Construct the frame
        $frame = [
            'lineNumber' => (int) $line,
            'method' => $class ? "$class::$method" : $method,
        ];

        // Attach some lines of code for context
        if ($this->config->shouldSendCode()) {
            $frame['code'] = $this->getCode($file, $line, static::NUM_LINES);
        }

        // Check if this frame is inProject
        $frame['inProject'] = $this->config->isInProject($file);

        // Strip out projectRoot from start of file path
        $frame['file'] = $this->config->getStrippedFilePath($file);

        $this->frames[] = $frame;
    }
public function addFrame ( $ file , $ line , $ method , $ class = null ) { // Account for special "filenames" in eval'd code $ matches = [ ] ; if ( preg_match ( "/^(.*?)\((\d+)\) : (?:eval\(\)'d code|runtime-created function)$/" , $ file , $ matches ) ) { $ file = $ matches [ 1 ] ; $ line = $ matches [ 2 ] ; } // Construct the frame $ frame = [ 'lineNumber' => ( int ) $ line , 'method' => $ class ? "$class::$method" : $ method , ] ; // Attach some lines of code for context if ( $ this -> config -> shouldSendCode ( ) ) { $ frame [ 'code' ] = $ this -> getCode ( $ file , $ line , static :: NUM_LINES ) ; } // Check if this frame is inProject $ frame [ 'inProject' ] = $ this -> config -> isInProject ( $ file ) ; // Strip out projectRoot from start of file path $ frame [ 'file' ] = $ this -> config -> getStrippedFilePath ( $ file ) ; $ this -> frames [ ] = $ frame ; }
Add the given frame to the stacktrace.

@param string      $file   the associated file
@param int         $line   the line number
@param string      $method the method called
@param string|null $class  the associated class

@return void
Add the given frame to the stacktrace .