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
35
47class Group
48{
50
52 {
53 $this->dataFactory = $dataFactory;
54 }
55
76 public function int(): Transformation
77 {
78 return new IntegerTransformation();
79 }
80
102 public function float(): Transformation
103 {
104 return new FloatTransformation();
105 }
106
128 public function string(): Transformation
129 {
130 return new StringTransformation();
131 }
132
133
159 public function bool(): Transformation
160 {
161 return new BooleanTransformation();
162 }
163
174 public function dateTime(): Transformation
175 {
176 return new DateTimeTransformation();
177 }
178
185 public function listOf(Transformation $transformation): Transformation
186 {
187 return new ListTransformation($transformation);
188 }
189
195 public function dictOf(Transformation $transformation): Transformation
196 {
197 return new DictionaryTransformation($transformation);
198 }
199
209 public function tupleOf(array $transformation): Transformation
210 {
211 return new TupleTransformation($transformation);
212 }
213
222 public function recordOf(array $transformations): Transformation
223 {
224 return new RecordTransformation($transformations);
225 }
226
234 public function null(): Transformation
235 {
236 return new NullTransformation();
237 }
238}
Builds data types.
Definition: Factory.php:36
Transformations in this group transform data to primitive types to establish a baseline for more comp...
Definition: Group.php:48
string()
Get a kind transformation to a string.
Definition: Group.php:128
dateTime()
Get a kind transformation to a DateTimeImmutable.
Definition: Group.php:174
float()
Get a kind transformation to a float.
Definition: Group.php:102
__construct(Factory $dataFactory)
Definition: Group.php:51
dictOf(Transformation $transformation)
Get a kind transformation to a dictionary.
Definition: Group.php:195
listOf(Transformation $transformation)
Get a kind transformation to a list.
Definition: Group.php:185
bool()
Get a kind transformation to a bool.
Definition: Group.php:159
tupleOf(array $transformation)
Get a kind transformation to a tuple.
Definition: Group.php:209
int()
Get a kind transformation to an int.
Definition: Group.php:76
recordOf(array $transformations)
Get a kind transformation to a record.
Definition: Group.php:222
Transform date format to DateTimeImmutable Please note:
A transformation is a function from one datatype to another.