@@ -60,7 +60,7 @@ |
||
60 | 60 | private $advice; |
61 | 61 | |
62 | 62 | /** |
63 | - * @param PolicyInterface[]|PolicySetInterface[] $policiesAndSets |
|
63 | + * @param PolicyInterface[] $policiesAndSets |
|
64 | 64 | * @param PolicyCombiningAlgorithmInterface $combiningAlgorithm |
65 | 65 | * @param null|string $name |
66 | 66 | * @param TargetInterface $target |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | /** |
60 | 60 | * @param ContextInterface $context |
61 | - * @param array|null $serializedLogical |
|
61 | + * @param callable|null $serializedLogical |
|
62 | 62 | * |
63 | 63 | * @return bool |
64 | 64 | */ |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | |
366 | 366 | /** |
367 | 367 | * @param array $storage |
368 | - * @param string|int $key |
|
368 | + * @param integer $key |
|
369 | 369 | * @param array $list |
370 | 370 | * |
371 | 371 | * @return array |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | /** |
330 | 330 | * @param array $obligations |
331 | 331 | * @param int $evaluation |
332 | - * @param array $obligationsMap |
|
332 | + * @param callable[] $obligationsMap |
|
333 | 333 | * |
334 | 334 | * @return array |
335 | 335 | * |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | /** |
344 | 344 | * @param array $advice |
345 | 345 | * @param int $evaluation |
346 | - * @param array $adviceMap |
|
346 | + * @param callable[] $adviceMap |
|
347 | 347 | * |
348 | 348 | * @return array |
349 | 349 | * |
@@ -246,8 +246,7 @@ |
||
246 | 246 | $isSet = Encoder::isPolicySet($encodedItem); |
247 | 247 | |
248 | 248 | return $isSet === true ? |
249 | - static::evaluatePolicySet($context, $match, $encodedItem, $logger) : |
|
250 | - static::evaluatePolicy($context, $match, $encodedItem, $logger); |
|
249 | + static::evaluatePolicySet($context, $match, $encodedItem, $logger) : static::evaluatePolicy($context, $match, $encodedItem, $logger); |
|
251 | 250 | } |
252 | 251 | |
253 | 252 | /** |
@@ -542,7 +542,7 @@ |
||
542 | 542 | |
543 | 543 | /** |
544 | 544 | * @param RuleCombiningAlgorithmInterface $algorithm |
545 | - * @param array $rules |
|
545 | + * @param RuleInterface[] $rules |
|
546 | 546 | * |
547 | 547 | * @return array |
548 | 548 | */ |
@@ -355,7 +355,7 @@ |
||
355 | 355 | * @param bool $addTargetAll |
356 | 356 | * @param bool $exInCondition |
357 | 357 | * |
358 | - * @return RuleInterface[] |
|
358 | + * @return Rule[] |
|
359 | 359 | */ |
360 | 360 | private function createRules($addTargetAll = true, $exInCondition = false) |
361 | 361 | { |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | |
198 | 198 | $exceptionThrown = false; |
199 | 199 | $context = new Context(new Request([]), [ |
200 | - 'key11_1' => function () use (&$exceptionThrown) { |
|
200 | + 'key11_1' => function() use (&$exceptionThrown) { |
|
201 | 201 | $exceptionThrown = true; |
202 | 202 | throw new RuntimeException(); |
203 | 203 | }, |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | 'key22_1' => 'value22_1', |
378 | 378 | 'key22_2' => 'value22_2', |
379 | 379 | ]); |
380 | - $allOf3 = new AllOf([ |
|
380 | + $allOf3 = new AllOf([ |
|
381 | 381 | 'key31' => 'value31', |
382 | 382 | ]); |
383 | 383 | |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | ->setCondition(new Logical([self::class, $methodName])) |
396 | 396 | ->setObligations([new Obligation(EvaluationEnum::PERMIT, [self::class, 'ruleObligation1'])]) |
397 | 397 | ->setAdvice([new Advice(EvaluationEnum::PERMIT, [self::class, 'ruleAdvice1'])]); |
398 | - $rule2 = (new Rule()) |
|
398 | + $rule2 = (new Rule()) |
|
399 | 399 | ->setEffect(new Logical([self::class, 'effectDeny'])) |
400 | 400 | ->setTarget($target2) |
401 | 401 | ->setCondition(new Logical([self::class, $methodName])) |
@@ -515,7 +515,7 @@ |
||
515 | 515 | ContextProperties::PARAM_CURRENT_USER_ROLE => $this->currentUserRole, |
516 | 516 | ContextProperties::PARAM_USER_IS_SIGNED_IN => $this->currentUserId !== null && |
517 | 517 | $this->currentUserRole !== null, |
518 | - ContextProperties::PARAM_IS_WORK_TIME => function () { |
|
518 | + ContextProperties::PARAM_IS_WORK_TIME => function() { |
|
519 | 519 | return $this->isWorkTime; |
520 | 520 | }, |
521 | 521 | ]; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | { |
175 | 175 | // check every item is Obligation (debug mode only) |
176 | 176 | assert(call_user_func( |
177 | - function () use ($obligations) { |
|
177 | + function() use ($obligations) { |
|
178 | 178 | foreach ($obligations as $item) { |
179 | 179 | assert($item instanceof ObligationInterface); |
180 | 180 | } |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | { |
205 | 205 | // check every item is Obligation (debug mode only) |
206 | 206 | assert(call_user_func( |
207 | - function () use ($advice) { |
|
207 | + function() use ($advice) { |
|
208 | 208 | foreach ($advice as $item) { |
209 | 209 | assert($item instanceof AdviceInterface); |
210 | 210 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | public function __construct(callable $staticMethod) |
35 | 35 | { |
36 | 36 | assert( |
37 | - is_array($staticMethod) === true && count((array)$staticMethod) === 2 && |
|
37 | + is_array($staticMethod) === true && count((array) $staticMethod) === 2 && |
|
38 | 38 | is_string($staticMethod[0]) === true && is_string($staticMethod[1]) === true, |
39 | 39 | 'Only array form of static callable method is supported.' |
40 | 40 | ); |
@@ -27,7 +27,7 @@ |
||
27 | 27 | const PERMIT = (1 << 0); |
28 | 28 | |
29 | 29 | /** Combine result */ |
30 | - const DENY = (1 << 1); |
|
30 | + const DENY = (1 << 1); |
|
31 | 31 | |
32 | 32 | /** Combine result */ |
33 | 33 | const INDETERMINATE = (1 << 2); |