src/Processor.php
public function rename($oldFileName, $newFileName, $context, FilesystemAdapter $filesystemAdapter)
    {
        if ($filesystemAdapter->exists($context . '/' . $newFileName)) {
            throw new IcrRuntimeException("File with name {$newFileName} already exists!");
        }

        $image = $filesystemAdapter->get($context . '/' . $oldFileName);
        $filesystemAdapter->move($context . '/' . $oldFileName, $context . '/' . $newFileName);

        foreach ($this->config[$context] as $sizeName => $value) {
            $oldPath = $context . '/' . $sizeName . '/' . $oldFileName;
            $newPath = $context . '/' . $sizeName . '/' . $newFileName;
            $filesystemAdapter->move($oldPath, $newPath);
        }

        return true;
    }
public function rename($oldFileName, $newFileName, $context, FilesystemAdapter $filesystemAdapter)
    {
        if ($filesystemAdapter->exists($context . '/' . $newFileName)) {
            throw new IcrRuntimeException("File with name {$newFileName} already exists!");
        }

        $image = $filesystemAdapter->get($context . '/' . $oldFileName);
        $filesystemAdapter->move($context . '/' . $oldFileName, $context . '/' . $newFileName);

        foreach ($this->config[$context] as $sizeName => $value) {
            $oldPath = $context . '/' . $sizeName . '/' . $oldFileName;
            $newPath = $context . '/' . $sizeName . '/' . $newFileName;
            $filesystemAdapter->move($oldPath, $newPath);
        }

        return true;
    }
public function rename ( $ oldFileName , $ newFileName , $ context , FilesystemAdapter $ filesystemAdapter ) { if ( $ filesystemAdapter -> exists ( $ context . '/' . $ newFileName ) ) { throw new IcrRuntimeException ( "File with name {$newFileName} already exists!" ) ; } $ image = $ filesystemAdapter -> get ( $ context . '/' . $ oldFileName ) ; $ filesystemAdapter -> move ( $ context . '/' . $ oldFileName , $ context . '/' . $ newFileName ) ; foreach ( $ this -> config [ $ context ] as $ sizeName => $ value ) { $ oldPath = $ context . '/' . $ sizeName . '/' . $ oldFileName ; $ newPath = $ context . '/' . $ sizeName . '/' . $ newFileName ; $ filesystemAdapter -> move ( $ oldPath , $ newPath ) ; } return true ; }
Renames existing file

@param string $oldFileName
@param string $newFileName
@param string $context
@param FilesystemAdapter $filesystemAdapter

@return boolean
Renames existing file