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)
        );
    }