private function deleteDirectory()
    {
        $path = $this->complement['path']['root'];

        if (! $this->validateRoute($path)) {
            return false;
        }

        $isUninstall = ($this->getState() === 'inactive');

        if (! File::deleteDirRecursively($path) && $isUninstall) {
            $type = self::getType('ucfirst', false);

            $msg = $type . " doesn't exist in '$path' or couldn't be deleted.";

            self::$errors[] = ['message' => $msg];

            return false;
        }

        return true;
    }