Passed
Push — master ( c233ac...ceefe0 )
by Joas
14:23 queued 13s
created
core/Command/Group/RemoveUser.php 1 patch
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -34,68 +34,68 @@
 block discarded – undo
34 34
 use Symfony\Component\Console\Output\OutputInterface;
35 35
 
36 36
 class RemoveUser extends Base {
37
-	/** @var IUserManager */
38
-	protected $userManager;
39
-	/** @var IGroupManager */
40
-	protected $groupManager;
37
+    /** @var IUserManager */
38
+    protected $userManager;
39
+    /** @var IGroupManager */
40
+    protected $groupManager;
41 41
 
42
-	/**
43
-	 * @param IUserManager $userManager
44
-	 * @param IGroupManager $groupManager
45
-	 */
46
-	public function __construct(IUserManager $userManager, IGroupManager $groupManager) {
47
-		$this->userManager = $userManager;
48
-		$this->groupManager = $groupManager;
49
-		parent::__construct();
50
-	}
42
+    /**
43
+     * @param IUserManager $userManager
44
+     * @param IGroupManager $groupManager
45
+     */
46
+    public function __construct(IUserManager $userManager, IGroupManager $groupManager) {
47
+        $this->userManager = $userManager;
48
+        $this->groupManager = $groupManager;
49
+        parent::__construct();
50
+    }
51 51
 
52
-	protected function configure() {
53
-		$this
54
-			->setName('group:removeuser')
55
-			->setDescription('remove a user from a group')
56
-			->addArgument(
57
-				'group',
58
-				InputArgument::REQUIRED,
59
-				'group to remove the user from'
60
-			)->addArgument(
61
-				'user',
62
-				InputArgument::REQUIRED,
63
-				'user to remove from the group'
64
-			);
65
-	}
52
+    protected function configure() {
53
+        $this
54
+            ->setName('group:removeuser')
55
+            ->setDescription('remove a user from a group')
56
+            ->addArgument(
57
+                'group',
58
+                InputArgument::REQUIRED,
59
+                'group to remove the user from'
60
+            )->addArgument(
61
+                'user',
62
+                InputArgument::REQUIRED,
63
+                'user to remove from the group'
64
+            );
65
+    }
66 66
 
67
-	protected function execute(InputInterface $input, OutputInterface $output): int {
68
-		$group = $this->groupManager->get($input->getArgument('group'));
69
-		if (is_null($group)) {
70
-			$output->writeln('<error>group not found</error>');
71
-			return 1;
72
-		}
73
-		$user = $this->userManager->get($input->getArgument('user'));
74
-		if (is_null($user)) {
75
-			$output->writeln('<error>user not found</error>');
76
-			return 1;
77
-		}
78
-		$group->removeUser($user);
79
-		return 0;
80
-	}
67
+    protected function execute(InputInterface $input, OutputInterface $output): int {
68
+        $group = $this->groupManager->get($input->getArgument('group'));
69
+        if (is_null($group)) {
70
+            $output->writeln('<error>group not found</error>');
71
+            return 1;
72
+        }
73
+        $user = $this->userManager->get($input->getArgument('user'));
74
+        if (is_null($user)) {
75
+            $output->writeln('<error>user not found</error>');
76
+            return 1;
77
+        }
78
+        $group->removeUser($user);
79
+        return 0;
80
+    }
81 81
 
82
-	/**
83
-	 * @param string $argumentName
84
-	 * @param CompletionContext $context
85
-	 * @return string[]
86
-	 */
87
-	public function completeArgumentValues($argumentName, CompletionContext $context) {
88
-		if ($argumentName === 'group') {
89
-			return array_map(static fn (IGroup $group) => $group->getGID(), $this->groupManager->search($context->getCurrentWord()));
90
-		}
91
-		if ($argumentName === 'user') {
92
-			$groupId = $context->getWordAtIndex($context->getWordIndex() - 1);
93
-			$group = $this->groupManager->get($groupId);
94
-			if ($group === null) {
95
-				return [];
96
-			}
97
-			return array_map(static fn (IUser $user) => $user->getUID(), $group->searchUsers($context->getCurrentWord()));
98
-		}
99
-		return [];
100
-	}
82
+    /**
83
+     * @param string $argumentName
84
+     * @param CompletionContext $context
85
+     * @return string[]
86
+     */
87
+    public function completeArgumentValues($argumentName, CompletionContext $context) {
88
+        if ($argumentName === 'group') {
89
+            return array_map(static fn (IGroup $group) => $group->getGID(), $this->groupManager->search($context->getCurrentWord()));
90
+        }
91
+        if ($argumentName === 'user') {
92
+            $groupId = $context->getWordAtIndex($context->getWordIndex() - 1);
93
+            $group = $this->groupManager->get($groupId);
94
+            if ($group === null) {
95
+                return [];
96
+            }
97
+            return array_map(static fn (IUser $user) => $user->getUID(), $group->searchUsers($context->getCurrentWord()));
98
+        }
99
+        return [];
100
+    }
101 101
 }
Please login to merge, or discard this patch.