protected function replace($from, $to)
    {
        if ($this->file->getExtension() === 'json') {
            $from = addslashes($from);
        }

        file_put_contents(
            $this->file->getRealPath(),
            str_replace($from, $to, $this->file->getContents())
        );
    }
protected function replace($from, $to)
    {
        if ($this->file->getExtension() === 'json') {
            $from = addslashes($from);
        }

        file_put_contents(
            $this->file->getRealPath(),
            str_replace($from, $to, $this->file->getContents())
        );
    }
protected function replace ( $ from , $ to ) { if ( $ this -> file -> getExtension ( ) === 'json' ) { $ from = addslashes ( $ from ) ; } file_put_contents ( $ this -> file -> getRealPath ( ) , str_replace ( $ from , $ to , $ this -> file -> getContents ( ) ) ) ; }
Replaces strings in file content.

@param  string $from
@param  string $to

@return void
Replaces strings in file content .