@@ -27,10 +27,10 @@ class ACL extends FolderCommand {
27
27
public function __construct (
28
28
FolderManager $ folderManager ,
29
29
IRootFolder $ rootFolder ,
30
- private RuleManager $ ruleManager ,
30
+ private readonly RuleManager $ ruleManager ,
31
31
MountProvider $ mountProvider ,
32
- private ACLManagerFactory $ aclManagerFactory ,
33
- private IUserManager $ userManager ,
32
+ private readonly ACLManagerFactory $ aclManagerFactory ,
33
+ private readonly IUserManager $ userManager ,
34
34
) {
35
35
parent ::__construct ($ folderManager , $ rootFolder , $ mountProvider );
36
36
}
@@ -117,8 +117,16 @@ protected function execute(InputInterface $input, OutputInterface $output): int
117
117
$ mappingType = $ input ->getOption ('user ' ) ? 'user ' : 'group ' ;
118
118
$ mappingId = $ input ->getOption ('user ' ) ?: $ input ->getOption ('group ' );
119
119
$ path = $ input ->getArgument ('path ' );
120
+ if (!is_string ($ path )) {
121
+ $ output ->writeln ('<error><path> argument has to be a string</error> ' );
122
+ return -3 ;
123
+ }
120
124
$ path = trim ($ path , '/ ' );
121
125
$ permissionStrings = $ input ->getArgument ('permissions ' );
126
+ if (!is_array ($ permissionStrings )) {
127
+ $ output ->writeln ('<error><permissions> argument has to be an array</error> ' );
128
+ return -3 ;
129
+ }
122
130
123
131
$ mount = $ this ->mountProvider ->getMount (
124
132
$ folder ['id ' ],
@@ -147,6 +155,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
147
155
}
148
156
149
157
foreach ($ permissionStrings as $ permission ) {
158
+ if (!is_string ($ permission )) {
159
+ $ output ->writeln ('<error><permissions> argument has to be an array of strings</error> ' );
160
+ return -3 ;
161
+ }
162
+
150
163
if ($ permission [0 ] !== '+ ' && $ permission [0 ] !== '- ' ) {
151
164
$ output ->writeln ('<error>incorrect format for permissions " ' . $ permission . '"</error> ' );
152
165
return -3 ;
@@ -216,6 +229,9 @@ private function printPermissions(InputInterface $input, OutputInterface $output
216
229
}
217
230
}
218
231
232
+ /**
233
+ * @param list<string> $permissions
234
+ */
219
235
private function parsePermissions (array $ permissions ): array {
220
236
$ mask = 0 ;
221
237
$ result = 0 ;
0 commit comments