private function getLinesNumbers(string $line)
    {
        $matches = [];
        preg_match('/@@ -(.*) \+(.*) @@?(.*)/', $line, $matches);
        if (!strpos($matches[1], ',')) {
            // one line
            $this->originStartLine = $matches[1];
            $this->originEndLine = $matches[1];
        } else {
            list($this->originStartLine, $this->originEndLine) = explode(',', $matches[1]);
        }

        if (!strpos($matches[2], ',')) {
            // one line
            $this->destStartLine = $matches[2];
            $this->destEndLine = $matches[2];
        } else {
            list($this->destStartLine, $this->destEndLine) = explode(',', $matches[2]);
        }
    }
private function getLinesNumbers(string $line)
    {
        $matches = [];
        preg_match('/@@ -(.*) \+(.*) @@?(.*)/', $line, $matches);
        if (!strpos($matches[1], ',')) {
            // one line
            $this->originStartLine = $matches[1];
            $this->originEndLine = $matches[1];
        } else {
            list($this->originStartLine, $this->originEndLine) = explode(',', $matches[1]);
        }

        if (!strpos($matches[2], ',')) {
            // one line
            $this->destStartLine = $matches[2];
            $this->destEndLine = $matches[2];
        } else {
            list($this->destStartLine, $this->destEndLine) = explode(',', $matches[2]);
        }
    }
private function getLinesNumbers ( string $ line ) { $ matches = [ ] ; preg_match ( '/@@ -(.*) \+(.*) @@?(.*)/' , $ line , $ matches ) ; if ( ! strpos ( $ matches [ 1 ] , ',' ) ) { // one line $ this -> originStartLine = $ matches [ 1 ] ; $ this -> originEndLine = $ matches [ 1 ] ; } else { list ( $ this -> originStartLine , $ this -> originEndLine ) = explode ( ',' , $ matches [ 1 ] ) ; } if ( ! strpos ( $ matches [ 2 ] , ',' ) ) { // one line $ this -> destStartLine = $ matches [ 2 ] ; $ this -> destEndLine = $ matches [ 2 ] ; } else { list ( $ this -> destStartLine , $ this -> destEndLine ) = explode ( ',' , $ matches [ 2 ] ) ; } }
Get line numbers

@param string $line a single line
Get line numbers