/** * Rename a file or directory. The filesystem object must exist. * * @param FileSystemObject|string $newPath The filesystem object instance of the path of the filesystem object to * rename the object to. This filesystem object or path should include the full path. The object may only exist if * $overwrite is set to true or the renaming will fail. * @param bool $overwrite [optional] True to overwrite the existing filesystem object when the target name already * exist, false otherwise. * @param resource $context [optional] See the rename() function for documentation. * * @return bool True if the filesystem object was successfully renamed, false on failure. * * @see rename(); */ public function rename($newPath, $overwrite = false, $context = null) { return FilesystemObjectHelper::rename($this, $newPath, $overwrite, $context); }