ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Group.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27
28class Group
29{
30 public function __construct(
31 private readonly Factory $dataFactory,
32 private readonly Language $language,
33 private readonly In $in
34 ) {
35 }
36
41 public function isGreaterThan(int $minimum): Constraint
42 {
43 return new GreaterThan($minimum, $this->dataFactory, $this->language);
44 }
45
50 public function isLessThan(int $maximum): Constraint
51 {
52 return new LessThan($maximum, $this->dataFactory, $this->language);
53 }
54
59 public function isGreaterThanOrEqual(int $minimum): Constraint
60 {
61 return new GreaterThanOrEqual($minimum, $this->dataFactory, $this->language);
62 }
63
68 public function isLessThanOrEqual(int $maximum): Constraint
69 {
70 return new LessThanOrEqual($maximum, $this->dataFactory, $this->language);
71 }
72
77 public function isBetween(int $lower_bound, int $upper_bound): Constraint
78 {
79 return $this->in->series([
80 $this->isGreaterThanOrEqual($lower_bound),
81 $this->isLessThanOrEqual($upper_bound),
82 ]);
83 }
84}
Builds data types.
Definition: Factory.php:36
__construct(private readonly Factory $dataFactory, private readonly Language $language, private readonly In $in)
Definition: Group.php:30
isLessThan(int $maximum)
Creates a constraint that can be used to check if an integer value is less than the defined upper lim...
Definition: Group.php:50
isGreaterThan(int $minimum)
Creates a constraint that can be used to check if an integer value is greater than the defined lower ...
Definition: Group.php:41
isBetween(int $lower_bound, int $upper_bound)
Creates a constraint that can be used to check if an integer value is between the given lower and upp...
Definition: Group.php:77
isLessThanOrEqual(int $maximum)
Creates a constraint that can be used to check if an integer value is less than or equal the defined ...
Definition: Group.php:68
isGreaterThanOrEqual(int $minimum)
Creates a constraint that can be used to check if an integer value is greater than or equal the defin...
Definition: Group.php:59
A constraint encodes some resrtictions on values.
Definition: Constraint.php:32