Destroys a specific repository

@param  string                    $name
@throws \InvalidArgumentException
436894
public function destroy($name)
    {
        $path = $this->getReposDir($name);

        if (!is_dir($path)) {
            throw new \InvalidArgumentException(sprintf('Repository path %s does not exists', $path));
        }

        $filesystem = new Filesystem();
        $filesystem->remove($path);
    }
219300
public function delete($name)
    {
        if (array_key_exists($name, $this->getData())) {
            $this->_db->createCommand()->delete($this->tableName, 'name = :name', [':name' => $name])->execute();
            unset($this->_data[$name]);
        }

        $this->_setCache();
    }
405834
public function destroyFieldMigrationForTable($name, $tableName)
    {
        $path = $this->getMigrationPath($tableName, $name);

        $this->delete($path);
    }
1141473
public function removeFolder($name)
    {
        if ($name instanceof Zend_Mail_Storage_Folder) {
            $name = $name->getGlobalName();
        }

        if (!$this->_protocol->delete($name)) {
            /**
             * @see Zend_Mail_Storage_Exception
             */
            // require_once 'Zend/Mail/Storage/Exception.php';
            throw new Zend_Mail_Storage_Exception('cannot delete folder');
        }
    }
1024930
public function removeNamedRoute(string $name)
    {
        $route = $this->getNamedRoute($name);
        // no exception, route exists, now remove by id
        unset($this->routes[$route->getIdentifier()]);
    }
1375014
public function endHashElement($name)
    {
        $this->checkEndHashElement($name);

        $this->json = $this->json->getParent();
    }
1210361
public static function unregisterPartial($name)
    {
        //Argument 1 must be a string
        Argument::i()->test(1, 'string');

        if (isset(self::$partials[$name])) {
            unset(self::$partials[$name]);
        }
    }
713340
public static function remove($name)
    {
        if (!static::has($name)) {
            throw new \InvalidArgumentException(sprintf('The id generator "%s" does not exists.', $name));
        }

        unset(static::$map[$name], static::$idGenerators[$name]);
    }
739578
public function rename($name)
    {
        $this->guardDeletedFile();

        // If there is any slash character in new name, Selectel
        // will create new virtual directory and copy file to
        // this new one. Such behaviour may be unexpected.

        if (count(explode('/', $name)) > 1) {
            throw new InvalidArgumentException('File name can not contain "/" character.');
        }

        $destination = $this->directory().'/'.$name;

        $response = $this->api->request('PUT', $this->absolutePath($destination), [
            'headers' => [
                'X-Copy-From' => $this->absolutePath(),
                'Content-Length' => 0,
            ],
        ]);

        if ($response->getStatusCode() !== 201) {
            throw new ApiRequestFailedException(
                'Unable to rename file from "'.$this->name().'" to "'.$name.'" (path: "'.$this->directory().'").',
                $response->getStatusCode()
            );
        }

        // Since Selectel Storage does not provide such method as "rename",
        // we need to delete original file after copying. Also, "deleted"
        // flag needs to be reverted because file was actually renamed.

        $this->delete();
        $this->deleted = false;

        return $this->data['name'] = $destination;
    }
18312
public static function unregisterHelper($name)
    {
        //Argument 1 must be a string
        Argument::i()->test(1, 'string');

        if (isset(self::$helpers[$name])) {
            unset(self::$helpers[$name]);
        }
    }
312564
public function remove($name)
    {
        unset($this->treated[$name]);
        unset($this->services[$name]);
        unset($this->parameters[$name]);
    }
282088
public function close($name = null)
    {
        if (null === $name) {
            $name = $this->current ?: 'default';
        }

        if (isset($this->connections[$name])) {
            unset($this->connections[$name]);
        }
    }
461930
protected function removePermission($name)
    {
        $permission = $this->authManager->getPermission($name);
        if (empty($permission)) {
            throw new InvalidParamException("Permission '{$permission}' does not exists");
        }
        echo "    > removing permission $permission->name ...";
        $time = microtime(true);
        $this->authManager->remove($permission);
        echo ' done (time: ' . sprintf('%.3f', microtime(true) - $time) . "s)\n";
    }
1082756
public function purge($name)
    {
        try {
            if ($service = $this->getService($name)) {
                if ($service instanceof CacheInterface) {
                    $service->flush();
                }
            }
        } catch (\Exception $ex) {
            // could be due to purge triggered by ServiceDeleted event
        }
        unset($this->services[$name]);
        \Cache::forget('service_mgr:' . $name);
        \Cache::forget('service_mgr:id_name_map_active');
        \Cache::forget('service_mgr:id_name_map');
        \Cache::forget('service_mgr:name_type_map_active');
        \Cache::forget('service_mgr:name_type_map');
    }
902790
public function removeOAuthParameter($name)
    {
        if (!$this->hasOAuthParameter($name)) {
            throw new \InvalidArgumentException(sprintf('The OAuth request parameter "%s" does not exist.', $name));
        }

        unset($this->oauthParameters[rawurlencode($name)]);
    }
378293
public function remove($name)
    {
        try {
            $this->fs->remove($this->rootPath . DIRECTORY_SEPARATOR . 'www' . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . $name);
        } catch (IOException $e) {
            throw new RuntimeException(
                sprintf('Unable to remove assets for plugin %s', $name), $e->getCode(), $e
            );
        }
    }
1232238
public function unregister($type, $name)
    {
        if (!is_string($type) || !isset($this->algos[$type])) {
            throw new \InvalidArgumentException();
        }
        if (!is_string($name)) {
            throw new \InvalidArgumentException();
        }
        unset($this->algos[$type][$name]);
        return $this;
    }