public function changeToken($originalLine, $oldToken, $newToken)
    {
        $newLine = $this->buffer->getLine($this->createLineNumber($originalLine));

        $newLine = preg_replace(
            '!(^|[^a-z0-9])(' . preg_quote($oldToken) . ')([^a-z0-9]|$)!',
            '\1' . $newToken . '\3',
            $newLine
        );

        $this->buffer->replace(
            $this->createSingleLineRange($originalLine),
            array($newLine)
        );
    }
public function changeToken($originalLine, $oldToken, $newToken)
    {
        $newLine = $this->buffer->getLine($this->createLineNumber($originalLine));

        $newLine = preg_replace(
            '!(^|[^a-z0-9])(' . preg_quote($oldToken) . ')([^a-z0-9]|$)!',
            '\1' . $newToken . '\3',
            $newLine
        );

        $this->buffer->replace(
            $this->createSingleLineRange($originalLine),
            array($newLine)
        );
    }
public function changeToken ( $ originalLine , $ oldToken , $ newToken ) { $ newLine = $ this -> buffer -> getLine ( $ this -> createLineNumber ( $ originalLine ) ) ; $ newLine = preg_replace ( '!(^|[^a-z0-9])(' . preg_quote ( $ oldToken ) . ')([^a-z0-9]|$)!' , '\1' . $ newToken . '\3' , $ newLine ) ; $ this -> buffer -> replace ( $ this -> createSingleLineRange ( $ originalLine ) , array ( $ newLine ) ) ; }
Change Token in given line from old to new.

@param int $originalLine
@param string $oldToken
@param string $newToken

@return void
Change Token in given line from old to new .