@@ -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 | * |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | ContextInterface $context, |
| 50 | 50 | array $policiesAndSetsData, |
| 51 | 51 | ?LoggerInterface $logger |
| 52 | - ): array { |
|
| 52 | + ) : array { |
|
| 53 | 53 | return static::callAlgorithm( |
| 54 | 54 | static::getCallable($policiesAndSetsData), |
| 55 | 55 | $context, |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | int $match, |
| 111 | 111 | array $encodedPolicy, |
| 112 | 112 | ?LoggerInterface $logger |
| 113 | - ): array { |
|
| 113 | + ) : array { |
|
| 114 | 114 | assert(Encoder::isPolicy($encodedPolicy)); |
| 115 | 115 | assert($match !== TargetMatchEnum::NO_TARGET); |
| 116 | 116 | |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | int $match, |
| 179 | 179 | array $encodedPolicySet, |
| 180 | 180 | ?LoggerInterface $logger |
| 181 | - ): array { |
|
| 181 | + ) : array { |
|
| 182 | 182 | assert(Encoder::isPolicySet($encodedPolicySet)); |
| 183 | 183 | |
| 184 | 184 | /** @see http://docs.oasis-open.org/xacml/3.0/xacml-3.0-core-spec-os-en.html #7.13 (table 6) */ |
@@ -242,12 +242,11 @@ discard block |
||
| 242 | 242 | int $match, |
| 243 | 243 | array $encodedItem, |
| 244 | 244 | ?LoggerInterface $logger |
| 245 | - ): array { |
|
| 245 | + ) : array { |
|
| 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 | /** |
@@ -258,7 +257,7 @@ discard block |
||
| 258 | 257 | * |
| 259 | 258 | * @SuppressWarnings(PHPMD.StaticAccess) |
| 260 | 259 | */ |
| 261 | - private static function correctEvaluationOnIntermediateTarget(int $evaluation, ?LoggerInterface $logger): int |
|
| 260 | + private static function correctEvaluationOnIntermediateTarget(int $evaluation, ?LoggerInterface $logger) : int |
|
| 262 | 261 | { |
| 263 | 262 | /** @see http://docs.oasis-open.org/xacml/3.0/xacml-3.0-core-spec-os-en.html #7.14 (table 7) */ |
| 264 | 263 | |
@@ -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 | */ |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | * |
| 250 | 250 | * @return array|null |
| 251 | 251 | */ |
| 252 | - public static function targetAnyOfs(array $encodedTarget): ?array |
|
| 252 | + public static function targetAnyOfs(array $encodedTarget): ? array |
|
| 253 | 253 | { |
| 254 | 254 | assert(static::isTarget($encodedTarget)); |
| 255 | 255 | |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | * |
| 286 | 286 | * @return array|null |
| 287 | 287 | */ |
| 288 | - public static function ruleEffect(array $encodedRule): ?array |
|
| 288 | + public static function ruleEffect(array $encodedRule): ? array |
|
| 289 | 289 | { |
| 290 | 290 | assert(static::isRule($encodedRule)); |
| 291 | 291 | |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | * |
| 298 | 298 | * @return callable|null |
| 299 | 299 | */ |
| 300 | - public static function ruleCondition(array $encodedRule): ?callable |
|
| 300 | + public static function ruleCondition(array $encodedRule): ? callable |
|
| 301 | 301 | { |
| 302 | 302 | assert(static::isRule($encodedRule)); |
| 303 | 303 | |
@@ -503,7 +503,7 @@ discard block |
||
| 503 | 503 | * |
| 504 | 504 | * @return callable|null |
| 505 | 505 | */ |
| 506 | - private static function serializeMethod(MethodInterface $method = null): ?callable |
|
| 506 | + private static function serializeMethod(MethodInterface $method = null): ? callable |
|
| 507 | 507 | { |
| 508 | 508 | return $method === null ? null : $method->getCallable(); |
| 509 | 509 | } |
@@ -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); |
@@ -27,10 +27,10 @@ |
||
| 27 | 27 | const MATCH = 0; |
| 28 | 28 | |
| 29 | 29 | /** Combine result */ |
| 30 | - const NOT_MATCH = self::MATCH + 1; |
|
| 30 | + const NOT_MATCH = self::MATCH + 1; |
|
| 31 | 31 | |
| 32 | 32 | /** Combine result */ |
| 33 | - const NO_TARGET = self::NOT_MATCH + 1; |
|
| 33 | + const NO_TARGET = self::NOT_MATCH + 1; |
|
| 34 | 34 | |
| 35 | 35 | /** Combine result */ |
| 36 | 36 | const INDETERMINATE = self::NO_TARGET + 1; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | 60 | * @param ContextInterface $context |
| 61 | - * @param array|null $serializedLogical |
|
| 61 | + * @param null|callable $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 |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | array $optimizedTargets, |
| 134 | 134 | array $encodedItems, |
| 135 | 135 | ?LoggerInterface $logger |
| 136 | - ): array { |
|
| 136 | + ) : array { |
|
| 137 | 137 | foreach (static::evaluateTargets($context, $optimizedTargets, $logger) as $match => $itemId) { |
| 138 | 138 | $encodedItem = $encodedItems[$itemId]; |
| 139 | 139 | $packedEvaluation = static::evaluateItem($context, $match, $encodedItem, $logger); |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | array $optimizedTargets, |
| 163 | 163 | array $encodedItems, |
| 164 | 164 | ?LoggerInterface $logger |
| 165 | - ): array { |
|
| 165 | + ) : array { |
|
| 166 | 166 | foreach (static::evaluateTargets($context, $optimizedTargets, $logger) as $match => $itemId) { |
| 167 | 167 | $encodedItem = $encodedItems[$itemId]; |
| 168 | 168 | $packedEvaluation = static::evaluateItem($context, $match, $encodedItem, $logger); |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | array $optimizedTargets, |
| 192 | 192 | array $encodedItems, |
| 193 | 193 | ?LoggerInterface $logger |
| 194 | - ): array { |
|
| 194 | + ) : array { |
|
| 195 | 195 | foreach (static::evaluateTargets($context, $optimizedTargets, $logger) as $match => $itemId) { |
| 196 | 196 | $encodedItem = $encodedItems[$itemId]; |
| 197 | 197 | $packedEvaluation = static::evaluateItem($context, $match, $encodedItem, $logger); |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | array $optimizedTargets, |
| 225 | 225 | array $encodedItems, |
| 226 | 226 | ?LoggerInterface $logger |
| 227 | - ): array { |
|
| 227 | + ) : array { |
|
| 228 | 228 | $foundDeny = false; |
| 229 | 229 | $foundPermit = false; |
| 230 | 230 | $foundIntDeny = false; |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | array $optimizedTargets, |
| 303 | 303 | array $encodedItems, |
| 304 | 304 | ?LoggerInterface $logger |
| 305 | - ): array { |
|
| 305 | + ) : array { |
|
| 306 | 306 | $foundDeny = false; |
| 307 | 307 | $foundPermit = false; |
| 308 | 308 | $foundIntDeny = false; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * |
| 92 | 92 | * @return self |
| 93 | 93 | */ |
| 94 | - public function setName(?string $name): self |
|
| 94 | + public function setName(?string $name) : self |
|
| 95 | 95 | { |
| 96 | 96 | $this->name = $name; |
| 97 | 97 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * |
| 112 | 112 | * @return self |
| 113 | 113 | */ |
| 114 | - public function setTarget(?TargetInterface $target): self |
|
| 114 | + public function setTarget(?TargetInterface $target) : self |
|
| 115 | 115 | { |
| 116 | 116 | $this->target = $target; |
| 117 | 117 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | * |
| 91 | 91 | * @return self |
| 92 | 92 | */ |
| 93 | - public function setName(?string $name): self |
|
| 93 | + public function setName(?string $name) : self |
|
| 94 | 94 | { |
| 95 | 95 | $this->name = $name; |
| 96 | 96 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | * |
| 111 | 111 | * @return self |
| 112 | 112 | */ |
| 113 | - public function setTarget(?TargetInterface $target): self |
|
| 113 | + public function setTarget(?TargetInterface $target) : self |
|
| 114 | 114 | { |
| 115 | 115 | $this->target = $target; |
| 116 | 116 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | * |
| 131 | 131 | * @return self |
| 132 | 132 | */ |
| 133 | - public function setCondition(?MethodInterface $condition): self |
|
| 133 | + public function setCondition(?MethodInterface $condition) : self |
|
| 134 | 134 | { |
| 135 | 135 | $this->condition = $condition; |
| 136 | 136 | |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | * |
| 151 | 151 | * @return self |
| 152 | 152 | */ |
| 153 | - public function setEffect(?MethodInterface $effect): self |
|
| 153 | + public function setEffect(?MethodInterface $effect) : self |
|
| 154 | 154 | { |
| 155 | 155 | $this->effect = $effect; |
| 156 | 156 | |
@@ -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 | } |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | array $optimizedTargets, |
| 43 | 43 | array $serializedRules, |
| 44 | 44 | ?LoggerInterface $logger |
| 45 | - ): array { |
|
| 45 | + ) : array { |
|
| 46 | 46 | return static::evaluateDenyOverrides($context, $optimizedTargets, $serializedRules, $logger); |
| 47 | 47 | } |
| 48 | 48 | } |