Skip to content

Commit

Permalink
style: composer run cs:fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zak39 committed Nov 5, 2024
1 parent ec4f446 commit 2631fa9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
14 changes: 7 additions & 7 deletions lib/Controller/WorkspaceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ public function __construct(
private WorkspaceService $workspaceService,
private UserGroup $userGroup,
private WorkspaceManagerGroup $workspaceManagerGroup,
private SpaceManager $spaceManager,
public $AppName
private SpaceManager $spaceManager,
public $AppName,
) {
parent::__construct($AppName, $request);
}
Expand Down Expand Up @@ -147,9 +147,9 @@ public function createWorkspace(string $spaceName,
*/
public function destroy(int $spaceId): JSONResponse {
$this->logger->debug('Removing GE users from the WorkspacesManagers group if needed.');
$space = $this->spaceManager->get($spaceId);
$folderId = $space['groupfolder_id'];
$space = $this->spaceManager->get($spaceId);
$folderId = $space['groupfolder_id'];
$GEGroup = $this->groupManager->get(WorkspaceManagerGroup::get($spaceId));
foreach ($GEGroup->getUsers() as $user) {
if ($this->userService->canRemoveWorkspaceManagers($user)) {
Expand All @@ -165,7 +165,7 @@ public function destroy(int $spaceId): JSONResponse {
$this->groupManager->get($group)->delete();
}

$this->folderHelper->removeFolder($folderId);
$this->folderHelper->removeFolder($folderId);

return new JSONResponse([
'http' => [
Expand Down Expand Up @@ -213,7 +213,7 @@ public function findAll(): JSONResponse {
$this->logger->warning(
"Be careful, the $gid group is not exist in the oc_groups table."
. " But, it's present in the oc_group_folders_groups table."
. 'It necessary to recreate it with the occ command.'
. 'It necessary to recreate it with the occ command.'
);
continue;
}
Expand Down
18 changes: 9 additions & 9 deletions lib/Helper/GroupfolderHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ public function createFolder(string $mountpoint): int {
public function getFolder(int $folderId, int $rootStorageId) {
try {
return $this->folderManager->getFolder($folderId, $rootStorageId);
} catch(\Exception $e) {
} catch (\Exception $e) {
throw new GroupFolderFunctionException($e->getMessage() . 'Impossible to use the getFolder function from FolderManager.');
}
}

public function setFolderAcl(int $folderId, bool $acl): void {
try {
$this->folderManager->setFolderAcl($folderId, $acl);
} catch(\Exception $e) {
} catch (\Exception $e) {
throw new GroupFolderFunctionException($e->getMessage() . 'Impossible to use the setFolderAcl from FolderManager.');
}
}
Expand Down Expand Up @@ -97,11 +97,11 @@ public function setFolderQuota(int $folderId, int $quota): void {
}
}

public function removeFolder(int $folderId): void {
try {
$this->folderManager->removeFolder($folderId);
} catch (\Exception $e) {
throw new GroupFolderFunctionException($e->getMessage() . 'Impossible to use the removeFolder from FolderManager.');
}
}
public function removeFolder(int $folderId): void {
try {
$this->folderManager->removeFolder($folderId);
} catch (\Exception $e) {
throw new GroupFolderFunctionException($e->getMessage() . 'Impossible to use the removeFolder from FolderManager.');
}
}
}
3 changes: 1 addition & 2 deletions lib/Middleware/IsGeneralManagerMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@
use OCP\AppFramework\Middleware;
use OCP\AppFramework\Utility\IControllerMethodReflector;
use OCP\IRequest;
use PHPUnit\Util\Json;

class IsGeneralManagerMiddleware extends Middleware {
public function __construct(
private IControllerMethodReflector $reflector,
private IRequest $request,
private UserService $userService
private UserService $userService,
) {
}

Expand Down

0 comments on commit 2631fa9

Please sign in to comment.