src/Jackiedo/LogReader/LogParser.php
public function parseTraceEntry($content)
    {
        $content = trim($content);

        $caught_at = $content;
        $in = $line = null;

        if (!empty($content) && preg_match("/.*".self::TRACE_IN_DIVIDER_PATTERN.".*/", $content)) {
            $split = array_map('trim', preg_split("/".self::TRACE_IN_DIVIDER_PATTERN."/", $content));

            $in   = trim($split[0]);
            $caught_at = (isset($split[1])) ? $split[1] : null;

            if (preg_match("/^".self::TRACE_FILE_PATTERN."$/", $in, $matchs)) {
                $in   = trim($matchs[1]);
                $line = $matchs[2];
            }
        }

        return compact('caught_at', 'in', 'line');
    }
public function parseTraceEntry($content)
    {
        $content = trim($content);

        $caught_at = $content;
        $in = $line = null;

        if (!empty($content) && preg_match("/.*".self::TRACE_IN_DIVIDER_PATTERN.".*/", $content)) {
            $split = array_map('trim', preg_split("/".self::TRACE_IN_DIVIDER_PATTERN."/", $content));

            $in   = trim($split[0]);
            $caught_at = (isset($split[1])) ? $split[1] : null;

            if (preg_match("/^".self::TRACE_FILE_PATTERN."$/", $in, $matchs)) {
                $in   = trim($matchs[1]);
                $line = $matchs[2];
            }
        }

        return compact('caught_at', 'in', 'line');
    }
public function parseTraceEntry ( $ content ) { $ content = trim ( $ content ) ; $ caught_at = $ content ; $ in = $ line = null ; if ( ! empty ( $ content ) && preg_match ( "/.*" . self :: TRACE_IN_DIVIDER_PATTERN . ".*/" , $ content ) ) { $ split = array_map ( 'trim' , preg_split ( "/" . self :: TRACE_IN_DIVIDER_PATTERN . "/" , $ content ) ) ; $ in = trim ( $ split [ 0 ] ) ; $ caught_at = ( isset ( $ split [ 1 ] ) ) ? $ split [ 1 ] : null ; if ( preg_match ( "/^" . self :: TRACE_FILE_PATTERN . "$/" , $ in , $ matchs ) ) { $ in = trim ( $ matchs [ 1 ] ) ; $ line = $ matchs [ 2 ] ; } } return compact ( 'caught_at' , 'in' , 'line' ) ; }
Parses the content of the trace entry into an array containing the necessary information

@param  string  $content

@return array   Structure is ['caught_at' => '', 'in' => '', 'line' => '']
Parses the content of the trace entry into an array containing the necessary information