ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Group.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Refinery\Integer;
22 
25 use ILIAS\Refinery\In\Group as In;
27 
28 class 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 }
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
A constraint encodes some resrtictions on values.
Definition: Constraint.php:31
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
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(private readonly Factory $dataFactory, private readonly Language $language, private readonly In $in)
Definition: Group.php:30
Builds data types.
Definition: Factory.php:35
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
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
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