ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
GreaterThan.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 2017 Stefan Hecken <stefan.hecken@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3
5
7use ILIAS\Data;
9
10class GreaterThan extends Custom implements Constraint
11{
15 protected $min;
16
17 public function __construct($min, Data\Factory $data_factory)
18 {
19 assert('is_int($min)');
20 $this->min = $min;
21 parent::__construct(
22 function ($value) {
23 return $value > $this->min;
24 },
25 function ($value) {
26 return "'$value' is not greater than '{$this->min}'.";
27 },
29 );
30 }
31}
An exception for terminatinating execution or to throw for unit testing.
Builds data types.
Definition: Factory.php:15
__construct($min, Data\Factory $data_factory)
Definition: GreaterThan.php:17
A constraint encodes some resrtictions on values.
Definition: Constraint.php:15