Skip to content

Commit eb0893c

Browse files
committed
add missing annotation
1 parent 7d2f1eb commit eb0893c

File tree

12 files changed

+56
-0
lines changed

12 files changed

+56
-0
lines changed

src/AndConstraint.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ private function __construct(Constraint $a, Constraint $b)
3232
$this->b = $b;
3333
}
3434

35+
#[\Override]
3536
public function __invoke(mixed $input): Validation
3637
{
3738
/** @psalm-suppress MixedArgument */
@@ -63,6 +64,7 @@ public static function of(Constraint $a, Constraint $b): self
6364
*
6465
* @return self<A, C, T>
6566
*/
67+
#[\Override]
6668
public function and(Constraint $constraint): self
6769
{
6870
return new self($this, $constraint);
@@ -75,6 +77,7 @@ public function and(Constraint $constraint): self
7577
*
7678
* @return Constraint<A, C|T>
7779
*/
80+
#[\Override]
7881
public function or(Constraint $constraint): Constraint
7982
{
8083
return OrConstraint::of($this, $constraint);
@@ -87,6 +90,7 @@ public function or(Constraint $constraint): Constraint
8790
*
8891
* @return Constraint<A, T>
8992
*/
93+
#[\Override]
9094
public function map(callable $map): Constraint
9195
{
9296
return Map::of($this, $map);
@@ -95,6 +99,7 @@ public function map(callable $map): Constraint
9599
/**
96100
* @return PredicateInterface<C>
97101
*/
102+
#[\Override]
98103
public function asPredicate(): PredicateInterface
99104
{
100105
return Predicate::of($this);

src/AssociativeArray.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ private function __construct(
2626
) {
2727
}
2828

29+
#[\Override]
2930
public function __invoke(mixed $value): Validation
3031
{
3132
return Is::array()($value)->flatMap($this->validate(...));
@@ -53,6 +54,7 @@ public static function of(Constraint $key, Constraint $value): self
5354
*
5455
* @return Constraint<mixed, T>
5556
*/
57+
#[\Override]
5658
public function and(Constraint $constraint): Constraint
5759
{
5860
return AndConstraint::of($this, $constraint);
@@ -65,6 +67,7 @@ public function and(Constraint $constraint): Constraint
6567
*
6668
* @return Constraint<mixed, Map<K, V>|T>
6769
*/
70+
#[\Override]
6871
public function or(Constraint $constraint): Constraint
6972
{
7073
return OrConstraint::of($this, $constraint);
@@ -77,6 +80,7 @@ public function or(Constraint $constraint): Constraint
7780
*
7881
* @return Constraint<mixed, T>
7982
*/
83+
#[\Override]
8084
public function map(callable $map): Constraint
8185
{
8286
return namespace\Map::of($this, $map);
@@ -85,6 +89,7 @@ public function map(callable $map): Constraint
8589
/**
8690
* @return Predicate<Map<K, V>>
8791
*/
92+
#[\Override]
8893
public function asPredicate(): Predicate
8994
{
9095
return namespace\Predicate::of($this);

src/Each.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ private function __construct(Constraint $constraint)
2626
$this->constraint = $constraint;
2727
}
2828

29+
#[\Override]
2930
public function __invoke(mixed $value): Validation
3031
{
3132
/** @var Validation<Failure, list<T>> */
@@ -63,6 +64,7 @@ public static function of(Constraint $constraint): self
6364
*
6465
* @return Constraint<list, V>
6566
*/
67+
#[\Override]
6668
public function and(Constraint $constraint): Constraint
6769
{
6870
return AndConstraint::of($this, $constraint);
@@ -75,6 +77,7 @@ public function and(Constraint $constraint): Constraint
7577
*
7678
* @return Constraint<list, list<T>|V>
7779
*/
80+
#[\Override]
7881
public function or(Constraint $constraint): Constraint
7982
{
8083
return OrConstraint::of($this, $constraint);
@@ -87,6 +90,7 @@ public function or(Constraint $constraint): Constraint
8790
*
8891
* @return Constraint<list, V>
8992
*/
93+
#[\Override]
9094
public function map(callable $map): Constraint
9195
{
9296
return Map::of($this, $map);
@@ -95,6 +99,7 @@ public function map(callable $map): Constraint
9599
/**
96100
* @return PredicateInterface<list<T>>
97101
*/
102+
#[\Override]
98103
public function asPredicate(): PredicateInterface
99104
{
100105
return Predicate::of($this);

src/Has.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ private function __construct(string $key, callable $message)
2929
$this->message = $message;
3030
}
3131

32+
#[\Override]
3233
public function __invoke(mixed $value): Validation
3334
{
3435
/** @psalm-suppress ImpureFunctionCall */
@@ -70,6 +71,7 @@ public function withFailure(callable $message): self
7071
*
7172
* @return Constraint<array, T>
7273
*/
74+
#[\Override]
7375
public function and(Constraint $constraint): Constraint
7476
{
7577
return AndConstraint::of($this, $constraint);
@@ -82,6 +84,7 @@ public function and(Constraint $constraint): Constraint
8284
*
8385
* @return Constraint<array, mixed|T>
8486
*/
87+
#[\Override]
8588
public function or(Constraint $constraint): Constraint
8689
{
8790
return OrConstraint::of($this, $constraint);
@@ -94,6 +97,7 @@ public function or(Constraint $constraint): Constraint
9497
*
9598
* @return Constraint<array, T>
9699
*/
100+
#[\Override]
97101
public function map(callable $map): Constraint
98102
{
99103
return Map::of($this, $map);
@@ -102,6 +106,7 @@ public function map(callable $map): Constraint
102106
/**
103107
* @return PredicateInterface<mixed>
104108
*/
109+
#[\Override]
105110
public function asPredicate(): PredicateInterface
106111
{
107112
return Predicate::of($this);

src/Instance.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ private function __construct(Predicate\Instance $assert, string $class)
3030
$this->class = $class;
3131
}
3232

33+
#[\Override]
3334
public function __invoke(mixed $value): Validation
3435
{
3536
/** @var Validation<Failure, T> */
@@ -59,6 +60,7 @@ public static function of(string $class): self
5960
*
6061
* @return Constraint<mixed, V>
6162
*/
63+
#[\Override]
6264
public function and(Constraint $constraint): Constraint
6365
{
6466
return AndConstraint::of($this, $constraint);
@@ -71,6 +73,7 @@ public function and(Constraint $constraint): Constraint
7173
*
7274
* @return Constraint<mixed, T|V>
7375
*/
76+
#[\Override]
7477
public function or(Constraint $constraint): Constraint
7578
{
7679
return OrConstraint::of($this, $constraint);
@@ -83,6 +86,7 @@ public function or(Constraint $constraint): Constraint
8386
*
8487
* @return Constraint<mixed, V>
8588
*/
89+
#[\Override]
8690
public function map(callable $map): Constraint
8791
{
8892
return Map::of($this, $map);
@@ -91,6 +95,7 @@ public function map(callable $map): Constraint
9195
/**
9296
* @return Predicate<T>
9397
*/
98+
#[\Override]
9499
public function asPredicate(): Predicate
95100
{
96101
return $this->assert;

src/Is.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ private function __construct(
3939
$this->message = $message;
4040
}
4141

42+
#[\Override]
4243
public function __invoke(mixed $value): Validation
4344
{
4445
/** @var Validation<Failure, U> */
@@ -221,6 +222,7 @@ public function withFailure(string $message): self
221222
*
222223
* @return Constraint<T, V>
223224
*/
225+
#[\Override]
224226
public function and(Constraint $constraint): Constraint
225227
{
226228
return AndConstraint::of($this, $constraint);
@@ -233,6 +235,7 @@ public function and(Constraint $constraint): Constraint
233235
*
234236
* @return Constraint<T, U|V>
235237
*/
238+
#[\Override]
236239
public function or(Constraint $constraint): Constraint
237240
{
238241
return OrConstraint::of($this, $constraint);
@@ -245,6 +248,7 @@ public function or(Constraint $constraint): Constraint
245248
*
246249
* @return Constraint<T, V>
247250
*/
251+
#[\Override]
248252
public function map(callable $map): Constraint
249253
{
250254
return Map::of($this, $map);
@@ -253,6 +257,7 @@ public function map(callable $map): Constraint
253257
/**
254258
* @return PredicateInterface<U>
255259
*/
260+
#[\Override]
256261
public function asPredicate(): PredicateInterface
257262
{
258263
return Predicate::of($this);

src/Map.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ private function __construct(Constraint $constraint, callable $map)
3232
$this->map = $map;
3333
}
3434

35+
#[\Override]
3536
public function __invoke(mixed $value): Validation
3637
{
3738
/** @psalm-suppress ImpureFunctionCall */
@@ -61,6 +62,7 @@ public static function of(Constraint $constraint, callable $map): self
6162
*
6263
* @return Constraint<I, V>
6364
*/
65+
#[\Override]
6466
public function and(Constraint $constraint): Constraint
6567
{
6668
return AndConstraint::of($this, $constraint);
@@ -73,6 +75,7 @@ public function and(Constraint $constraint): Constraint
7375
*
7476
* @return Constraint<I, T|V>
7577
*/
78+
#[\Override]
7679
public function or(Constraint $constraint): Constraint
7780
{
7881
return OrConstraint::of($this, $constraint);
@@ -85,6 +88,7 @@ public function or(Constraint $constraint): Constraint
8588
*
8689
* @return self<I, T, V>
8790
*/
91+
#[\Override]
8892
public function map(callable $map): self
8993
{
9094
return new self($this, $map);
@@ -93,6 +97,7 @@ public function map(callable $map): self
9397
/**
9498
* @return PredicateInterface<T>
9599
*/
100+
#[\Override]
96101
public function asPredicate(): PredicateInterface
97102
{
98103
return Predicate::of($this);

src/Of.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ private function __construct(callable $assert)
2727
$this->assert = $assert;
2828
}
2929

30+
#[\Override]
3031
public function __invoke(mixed $value): Validation
3132
{
3233
return ($this->assert)($value);
@@ -53,6 +54,7 @@ public static function callable(callable $assert): self
5354
*
5455
* @return Constraint<A, T>
5556
*/
57+
#[\Override]
5658
public function and(Constraint $constraint): Constraint
5759
{
5860
return AndConstraint::of($this, $constraint);
@@ -65,6 +67,7 @@ public function and(Constraint $constraint): Constraint
6567
*
6668
* @return Constraint<A, B|T>
6769
*/
70+
#[\Override]
6871
public function or(Constraint $constraint): Constraint
6972
{
7073
return OrConstraint::of($this, $constraint);
@@ -77,6 +80,7 @@ public function or(Constraint $constraint): Constraint
7780
*
7881
* @return Constraint<A, T>
7982
*/
83+
#[\Override]
8084
public function map(callable $map): Constraint
8185
{
8286
return Map::of($this, $map);
@@ -85,6 +89,7 @@ public function map(callable $map): Constraint
8589
/**
8690
* @return PredicateInterface<B>
8791
*/
92+
#[\Override]
8893
public function asPredicate(): PredicateInterface
8994
{
9095
return Predicate::of($this);

src/OrConstraint.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ private function __construct(Constraint $a, Constraint $b)
3232
$this->b = $b;
3333
}
3434

35+
#[\Override]
3536
public function __invoke(mixed $input): Validation
3637
{
3738
/** @psalm-suppress MixedArgument */
@@ -63,6 +64,7 @@ public static function of(Constraint $a, Constraint $b): self
6364
*
6465
* @return Constraint<A, T>
6566
*/
67+
#[\Override]
6668
public function and(Constraint $constraint): Constraint
6769
{
6870
return AndConstraint::of($this, $constraint);
@@ -75,6 +77,7 @@ public function and(Constraint $constraint): Constraint
7577
*
7678
* @return self<A, B|C, T>
7779
*/
80+
#[\Override]
7881
public function or(Constraint $constraint): self
7982
{
8083
return new self($this, $constraint);
@@ -87,6 +90,7 @@ public function or(Constraint $constraint): self
8790
*
8891
* @return Constraint<A, T>
8992
*/
93+
#[\Override]
9094
public function map(callable $map): Constraint
9195
{
9296
return Map::of($this, $map);
@@ -95,6 +99,7 @@ public function map(callable $map): Constraint
9599
/**
96100
* @return PredicateInterface<B|C>
97101
*/
102+
#[\Override]
98103
public function asPredicate(): PredicateInterface
99104
{
100105
return Predicate::of($this);

src/PointInTime.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ private function __construct(
3737
$this->message = $message;
3838
}
3939

40+
#[\Override]
4041
public function __invoke(mixed $value): Validation
4142
{
4243
if ($value === '') {
@@ -76,6 +77,7 @@ public function withFailure(string $message): self
7677
*
7778
* @return Constraint<string, T>
7879
*/
80+
#[\Override]
7981
public function and(Constraint $constraint): Constraint
8082
{
8183
return AndConstraint::of($this, $constraint);
@@ -88,6 +90,7 @@ public function and(Constraint $constraint): Constraint
8890
*
8991
* @return Constraint<string, PointInTimeInterface|T>
9092
*/
93+
#[\Override]
9194
public function or(Constraint $constraint): Constraint
9295
{
9396
return OrConstraint::of($this, $constraint);
@@ -100,6 +103,7 @@ public function or(Constraint $constraint): Constraint
100103
*
101104
* @return Constraint<string, T>
102105
*/
106+
#[\Override]
103107
public function map(callable $map): Constraint
104108
{
105109
return Map::of($this, $map);
@@ -108,6 +112,7 @@ public function map(callable $map): Constraint
108112
/**
109113
* @return PredicateInterface<PointInTimeInterface>
110114
*/
115+
#[\Override]
111116
public function asPredicate(): PredicateInterface
112117
{
113118
return Predicate::of($this);

0 commit comments

Comments
 (0)