Skip to content

Commit 25600f2

Browse files
committed
Update some incorrect type annotations.
1 parent 906e3e3 commit 25600f2

File tree

5 files changed

+30
-31
lines changed

5 files changed

+30
-31
lines changed

src/Ruler/Context.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function offsetExists($name): bool
8585
*
8686
* @return mixed The resolved value of the fact
8787
*
88-
* @throws InvalidArgumentException if the name is not defined
88+
* @throws \InvalidArgumentException if the name is not defined
8989
*/
9090
public function offsetGet($name): mixed
9191
{
@@ -121,7 +121,7 @@ public function offsetGet($name): mixed
121121
* @param string $name The unique name for the fact
122122
* @param mixed $value The value or a closure to lazily define the value
123123
*
124-
* @throws RuntimeException if a frozen fact overridden
124+
* @throws \RuntimeException if a frozen fact overridden
125125
*/
126126
public function offsetSet($name, $value): void
127127
{
@@ -160,7 +160,7 @@ public function offsetUnset($name): void
160160
*
161161
* @return callable The passed callable
162162
*
163-
* @throws InvalidArgumentException if the callable is not a Closure or invokable object
163+
* @throws \InvalidArgumentException if the callable is not a Closure or invokable object
164164
*/
165165
public function share($callable)
166166
{
@@ -183,7 +183,7 @@ public function share($callable)
183183
*
184184
* @return callable The passed callable
185185
*
186-
* @throws InvalidArgumentException if the callable is not a Closure or invokable object
186+
* @throws \InvalidArgumentException if the callable is not a Closure or invokable object
187187
*/
188188
public function protect($callable)
189189
{
@@ -203,7 +203,7 @@ public function protect($callable)
203203
*
204204
* @return mixed The value of the fact or the closure defining the fact
205205
*
206-
* @throws InvalidArgumentException if the name is not defined
206+
* @throws \InvalidArgumentException if the name is not defined
207207
*/
208208
public function raw($name)
209209
{

src/Ruler/Rule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Rule implements Proposition
2828
* Rule constructor.
2929
*
3030
* @param Proposition $condition Propositional condition for this Rule
31-
* @param callback $action Action (callable) to take upon successful Rule execution (default: null)
31+
* @param callable $action Action (callable) to take upon successful Rule execution (default: null)
3232
*/
3333
public function __construct(Proposition $condition, $action = null)
3434
{

src/Ruler/RuleBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class RuleBuilder implements \ArrayAccess
2828
* Create a Rule with the given propositional condition.
2929
*
3030
* @param Proposition $condition Propositional condition for this Rule
31-
* @param callback $action Action (callable) to take upon successful Rule execution (default: null)
31+
* @param callable $action Action (callable) to take upon successful Rule execution (default: null)
3232
*
3333
* @return Rule
3434
*/

src/Ruler/RuleBuilder/Variable.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ public function sameAs($variable)
250250
*
251251
* @param mixed $variable Right side of comparison operator
252252
*
253-
* @return Operator\SameAs
253+
* @return Operator\NotSameAs
254254
*/
255255
public function notSameAs($variable)
256256
{
@@ -260,7 +260,7 @@ public function notSameAs($variable)
260260
/**
261261
* @param $variable
262262
*
263-
* @return Variable
263+
* @return self
264264
*/
265265
public function union($variable)
266266
{
@@ -270,7 +270,7 @@ public function union($variable)
270270
/**
271271
* @param $variable
272272
*
273-
* @return Variable
273+
* @return self
274274
*/
275275
public function intersect($variable)
276276
{
@@ -280,7 +280,7 @@ public function intersect($variable)
280280
/**
281281
* @param $variable
282282
*
283-
* @return Variable
283+
* @return self
284284
*/
285285
public function complement($variable)
286286
{
@@ -290,23 +290,23 @@ public function complement($variable)
290290
/**
291291
* @param $variable
292292
*
293-
* @return Variable
293+
* @return self
294294
*/
295295
public function symmetricDifference($variable)
296296
{
297297
return $this->applySetOperator('SymmetricDifference', func_get_args());
298298
}
299299

300300
/**
301-
* @return Variable
301+
* @return self
302302
*/
303303
public function min()
304304
{
305305
return $this->wrap(new Operator\Min($this));
306306
}
307307

308308
/**
309-
* @return Variable
309+
* @return self
310310
*/
311311
public function max()
312312
{
@@ -360,7 +360,7 @@ public function setDoesNotContain($variable)
360360
/**
361361
* @param $variable
362362
*
363-
* @return Operator\Addition
363+
* @return self
364364
*/
365365
public function add($variable)
366366
{
@@ -370,7 +370,7 @@ public function add($variable)
370370
/**
371371
* @param $variable
372372
*
373-
* @return Operator\Division
373+
* @return self
374374
*/
375375
public function divide($variable)
376376
{
@@ -380,7 +380,7 @@ public function divide($variable)
380380
/**
381381
* @param $variable
382382
*
383-
* @return Operator\Modulo
383+
* @return self
384384
*/
385385
public function modulo($variable)
386386
{
@@ -390,7 +390,7 @@ public function modulo($variable)
390390
/**
391391
* @param $variable
392392
*
393-
* @return Operator\Multiplication
393+
* @return self
394394
*/
395395
public function multiply($variable)
396396
{
@@ -400,31 +400,31 @@ public function multiply($variable)
400400
/**
401401
* @param $variable
402402
*
403-
* @return Operator\Subtraction
403+
* @return self
404404
*/
405405
public function subtract($variable)
406406
{
407407
return $this->wrap(new Operator\Subtraction($this, $this->asVariable($variable)));
408408
}
409409

410410
/**
411-
* @return Operator\Negation
411+
* @return self
412412
*/
413413
public function negate()
414414
{
415415
return $this->wrap(new Operator\Negation($this));
416416
}
417417

418418
/**
419-
* @return Operator\Ceil
419+
* @return self
420420
*/
421421
public function ceil()
422422
{
423423
return $this->wrap(new Operator\Ceil($this));
424424
}
425425

426426
/**
427-
* @return Operator\Floor
427+
* @return self
428428
*/
429429
public function floor()
430430
{
@@ -434,7 +434,7 @@ public function floor()
434434
/**
435435
* @param $variable
436436
*
437-
* @return Operator\Exponentiate
437+
* @return self
438438
*/
439439
public function exponentiate($variable)
440440
{
@@ -459,7 +459,7 @@ private function asVariable($variable)
459459
* @param string $name
460460
* @param array $args
461461
*
462-
* @return Variable
462+
* @return self
463463
*/
464464
private function applySetOperator($name, array $args)
465465
{
@@ -474,7 +474,7 @@ private function applySetOperator($name, array $args)
474474
*
475475
* @param VariableOperator $op
476476
*
477-
* @return Variable
477+
* @return self
478478
*/
479479
private function wrap(VariableOperator $op)
480480
{
@@ -539,7 +539,7 @@ public function startsWithInsensitive($variable)
539539
* @param string $name
540540
* @param array $args
541541
*
542-
* @return Operator
542+
* @return Operator|self
543543
*/
544544
public function __call($name, array $args)
545545
{

src/Ruler/RuleBuilder/VariableProperty.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Ruler\Context;
1515
use Ruler\Value;
16-
use Ruler\Variable as BaseVariable;
1716

1817
/**
1918
* A propositional VariableProperty.
@@ -42,11 +41,11 @@ class VariableProperty extends Variable
4241
/**
4342
* VariableProperty class constructor.
4443
*
45-
* @param BaseVariable $parent Parent Variable instance
46-
* @param string $name Property name
47-
* @param mixed $value Default Property value (default: null)
44+
* @param Variable $parent Parent Variable instance
45+
* @param string $name Property name
46+
* @param mixed $value Default Property value (default: null)
4847
*/
49-
public function __construct(BaseVariable $parent, $name, $value = null)
48+
public function __construct(Variable $parent, $name, $value = null)
5049
{
5150
$this->parent = $parent;
5251
parent::__construct($parent->getRuleBuilder(), $name, $value);

0 commit comments

Comments
 (0)