File/src/File.php
public function rename($filename)
    {
        if ($this->exists() && !@rename($this->filename, $filename)) {
            return false;
        }

        unset(static::$instances[$this->filename]);
        static::$instances[$filename] = $this;

        $this->filename = $filename;

        return true;
    }
public function rename($filename)
    {
        if ($this->exists() && !@rename($this->filename, $filename)) {
            return false;
        }

        unset(static::$instances[$this->filename]);
        static::$instances[$filename] = $this;

        $this->filename = $filename;

        return true;
    }
public function rename ( $ filename ) { if ( $ this -> exists ( ) && ! @ rename ( $ this -> filename , $ filename ) ) { return false ; } unset ( static :: $ instances [ $ this -> filename ] ) ; static :: $ instances [ $ filename ] = $ this ; $ this -> filename = $ filename ; return true ; }
Rename file in the filesystem if it exists.

@param $filename
@return bool
Rename file in the filesystem if it exists .