/** * Rename item * * @param string $src * @param string $dest * @return void * @throws InvalidArgumentException */ public function renameItem($src, $dest) { try { $name = basename($dest); $dest = ltrim(dirname($src) . $name, './'); $this->storage->renameItem($src, $name); $this->repository->updateKey($src, $dest); } catch (\InvalidArgumentException $e) { throw new \InvalidArgumentException(sprintf('The template object %s could not be renamed.', basename($src)), $e->getCode(), $e); } }