/**
* @inheritdoc
*/
public function rename($newKey)
{
if ($this->storage->renameKey($this->key, $newKey)) {
$event = new StorageEvent($this);
// Set `oldKey` property that will be available only on rename
$event->oldKey = $this->key;
$this->key = $newKey;
$this->eventManager()->fire(StorageEvent::FILE_RENAMED, $event);
return true;
}
return false;
}