@@ -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 | * |
@@ -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 |
@@ -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 | */ |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | * |
238 | 238 | * @return string|null |
239 | 239 | */ |
240 | - public static function targetName(array $encodedTarget): ?string |
|
240 | + public static function targetName(array $encodedTarget): ? string |
|
241 | 241 | { |
242 | 242 | assert(static::isTarget($encodedTarget)); |
243 | 243 | |
@@ -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 | |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | * |
334 | 334 | * @return string|null |
335 | 335 | */ |
336 | - public static function policyName(array $encodedPolicy): ?string |
|
336 | + public static function policyName(array $encodedPolicy): ? string |
|
337 | 337 | { |
338 | 338 | assert(static::isPolicy($encodedPolicy)); |
339 | 339 | |
@@ -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 |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | ContextInterface $context, |
133 | 133 | array $optimizedTargets, |
134 | 134 | array $encodedItems, |
135 | - ?LoggerInterface $logger |
|
136 | - ): array { |
|
135 | + ? LoggerInterface $logger |
|
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); |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | ContextInterface $context, |
162 | 162 | array $optimizedTargets, |
163 | 163 | array $encodedItems, |
164 | - ?LoggerInterface $logger |
|
165 | - ): array { |
|
164 | + ? LoggerInterface $logger |
|
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); |
@@ -190,8 +190,8 @@ discard block |
||
190 | 190 | ContextInterface $context, |
191 | 191 | array $optimizedTargets, |
192 | 192 | array $encodedItems, |
193 | - ?LoggerInterface $logger |
|
194 | - ): array { |
|
193 | + ? LoggerInterface $logger |
|
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); |
@@ -223,8 +223,8 @@ discard block |
||
223 | 223 | ContextInterface $context, |
224 | 224 | array $optimizedTargets, |
225 | 225 | array $encodedItems, |
226 | - ?LoggerInterface $logger |
|
227 | - ): array { |
|
226 | + ? LoggerInterface $logger |
|
227 | + ) : array { |
|
228 | 228 | $foundDeny = false; |
229 | 229 | $foundPermit = false; |
230 | 230 | $foundIntDeny = false; |
@@ -301,8 +301,8 @@ discard block |
||
301 | 301 | ContextInterface $context, |
302 | 302 | array $optimizedTargets, |
303 | 303 | array $encodedItems, |
304 | - ?LoggerInterface $logger |
|
305 | - ): array { |
|
304 | + ? LoggerInterface $logger |
|
305 | + ) : array { |
|
306 | 306 | $foundDeny = false; |
307 | 307 | $foundPermit = false; |
308 | 308 | $foundIntDeny = false; |
@@ -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 |