@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | /** |
| 82 | 82 | * @inheritdoc |
| 83 | 83 | */ |
| 84 | - public function getName(): ?string |
|
| 84 | + public function getName(): ? string |
|
| 85 | 85 | { |
| 86 | 86 | return $this->name; |
| 87 | 87 | } |
@@ -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 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | /** |
| 102 | 102 | * @inheritdoc |
| 103 | 103 | */ |
| 104 | - public function getTarget(): ?TargetInterface |
|
| 104 | + public function getTarget(): ? TargetInterface |
|
| 105 | 105 | { |
| 106 | 106 | return $this->target; |
| 107 | 107 | } |
@@ -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 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | /** |
| 81 | 81 | * @inheritdoc |
| 82 | 82 | */ |
| 83 | - public function getName(): ?string |
|
| 83 | + public function getName(): ? string |
|
| 84 | 84 | { |
| 85 | 85 | return $this->name; |
| 86 | 86 | } |
@@ -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 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | /** |
| 101 | 101 | * @inheritdoc |
| 102 | 102 | */ |
| 103 | - public function getTarget(): ?TargetInterface |
|
| 103 | + public function getTarget(): ? TargetInterface |
|
| 104 | 104 | { |
| 105 | 105 | return $this->target; |
| 106 | 106 | } |
@@ -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 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | /** |
| 121 | 121 | * @inheritdoc |
| 122 | 122 | */ |
| 123 | - public function getCondition(): ?MethodInterface |
|
| 123 | + public function getCondition(): ? MethodInterface |
|
| 124 | 124 | { |
| 125 | 125 | return $this->condition; |
| 126 | 126 | } |
@@ -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 | |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | /** |
| 141 | 141 | * @inheritdoc |
| 142 | 142 | */ |
| 143 | - public function effect(): ?MethodInterface |
|
| 143 | + public function effect(): ? MethodInterface |
|
| 144 | 144 | { |
| 145 | 145 | return $this->effect; |
| 146 | 146 | } |
@@ -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 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | /** |
| 55 | 55 | * @inheritdoc |
| 56 | 56 | */ |
| 57 | - public function getName(): ?string |
|
| 57 | + public function getName(): ? string |
|
| 58 | 58 | { |
| 59 | 59 | return $this->name; |
| 60 | 60 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | * |
| 65 | 65 | * @return $this |
| 66 | 66 | */ |
| 67 | - public function setName(?string $name) |
|
| 67 | + public function setName(? string $name) |
|
| 68 | 68 | { |
| 69 | 69 | $this->name = $name; |
| 70 | 70 | |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | /** |
| 82 | 82 | * @return LoggerInterface|null |
| 83 | 83 | */ |
| 84 | - protected function getLogger(): ?LoggerInterface |
|
| 84 | + protected function getLogger(): ? LoggerInterface |
|
| 85 | 85 | { |
| 86 | 86 | return $this->logger; |
| 87 | 87 | } |
@@ -48,8 +48,8 @@ discard block |
||
| 48 | 48 | public static function callPolicyAlgorithm( |
| 49 | 49 | ContextInterface $context, |
| 50 | 50 | array $policiesAndSetsData, |
| 51 | - ?LoggerInterface $logger |
|
| 52 | - ): array { |
|
| 51 | + ? LoggerInterface $logger |
|
| 52 | + ) : array { |
|
| 53 | 53 | return static::callAlgorithm( |
| 54 | 54 | static::getCallable($policiesAndSetsData), |
| 55 | 55 | $context, |
@@ -109,8 +109,8 @@ discard block |
||
| 109 | 109 | ContextInterface $context, |
| 110 | 110 | int $match, |
| 111 | 111 | array $encodedPolicy, |
| 112 | - ?LoggerInterface $logger |
|
| 113 | - ): array { |
|
| 112 | + ? LoggerInterface $logger |
|
| 113 | + ) : array { |
|
| 114 | 114 | assert(Encoder::isPolicy($encodedPolicy)); |
| 115 | 115 | assert($match !== TargetMatchEnum::NO_TARGET); |
| 116 | 116 | |
@@ -177,8 +177,8 @@ discard block |
||
| 177 | 177 | ContextInterface $context, |
| 178 | 178 | int $match, |
| 179 | 179 | array $encodedPolicySet, |
| 180 | - ?LoggerInterface $logger |
|
| 181 | - ): array { |
|
| 180 | + ? LoggerInterface $logger |
|
| 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) */ |
@@ -241,13 +241,12 @@ discard block |
||
| 241 | 241 | ContextInterface $context, |
| 242 | 242 | int $match, |
| 243 | 243 | array $encodedItem, |
| 244 | - ?LoggerInterface $logger |
|
| 245 | - ): array { |
|
| 244 | + ? LoggerInterface $logger |
|
| 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 | |
@@ -41,8 +41,8 @@ |
||
| 41 | 41 | ContextInterface $context, |
| 42 | 42 | array $optimizedTargets, |
| 43 | 43 | array $encPoliciesOrSets, |
| 44 | - ?LoggerInterface $logger |
|
| 45 | - ): array { |
|
| 44 | + ? LoggerInterface $logger |
|
| 45 | + ) : array { |
|
| 46 | 46 | return static::evaluatePermitOverrides($context, $optimizedTargets, $encPoliciesOrSets, $logger); |
| 47 | 47 | } |
| 48 | 48 | } |
@@ -41,8 +41,8 @@ |
||
| 41 | 41 | ContextInterface $context, |
| 42 | 42 | array $optimizedTargets, |
| 43 | 43 | array $encPoliciesOrSets, |
| 44 | - ?LoggerInterface $logger |
|
| 45 | - ): array { |
|
| 44 | + ? LoggerInterface $logger |
|
| 45 | + ) : array { |
|
| 46 | 46 | return self::evaluateFirstApplicable($context, $optimizedTargets, $encPoliciesOrSets, $logger); |
| 47 | 47 | } |
| 48 | 48 | } |
@@ -41,8 +41,8 @@ |
||
| 41 | 41 | ContextInterface $context, |
| 42 | 42 | array $optimizedTargets, |
| 43 | 43 | array $encodedRules, |
| 44 | - ?LoggerInterface $logger |
|
| 45 | - ): array { |
|
| 44 | + ? LoggerInterface $logger |
|
| 45 | + ) : array { |
|
| 46 | 46 | return self::evaluatePermitUnlessDeny($context, $optimizedTargets, $encodedRules, $logger); |
| 47 | 47 | } |
| 48 | 48 | } |
@@ -41,8 +41,8 @@ |
||
| 41 | 41 | ContextInterface $context, |
| 42 | 42 | array $optimizedTargets, |
| 43 | 43 | array $encPoliciesOrSets, |
| 44 | - ?LoggerInterface $logger |
|
| 45 | - ): array { |
|
| 44 | + ? LoggerInterface $logger |
|
| 45 | + ) : array { |
|
| 46 | 46 | return static::evaluateDenyOverrides($context, $optimizedTargets, $encPoliciesOrSets, $logger); |
| 47 | 47 | } |
| 48 | 48 | } |