ILIAS  release_8 Revision v8.24
Group.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Refinery\String;
22
24use ilLanguage;
27
28class Group
29{
32
34 {
35 $this->dataFactory = $dataFactory;
36 $this->language = $language;
37 }
38
47 public function hasMinLength(int $minimum): Constraint
48 {
49 return new HasMinLength($minimum, $this->dataFactory, $this->language);
50 }
51
60 public function hasMaxLength(int $maximum): Constraint
61 {
62 return new HasMaxLength($maximum, $this->dataFactory, $this->language);
63 }
64
69 public function splitString(string $delimiter): Transformation
70 {
71 return new SplitString($delimiter, $this->dataFactory);
72 }
73
74
80 public function stripTags(): Transformation
81 {
82 return new StripTags();
83 }
84
90 public function caseOfLabel(string $language_key): Transformation
91 {
92 return new CaseOfLabel($language_key);
93 }
94
104 public function estimatedReadingTime(bool $withImages = false): Transformation
105 {
106 return new EstimatedReadingTime($withImages);
107 }
108
113 public function makeClickable(): Transformation
114 {
115 return new MakeClickable();
116 }
117
125 public function levenshtein(): Levenshtein
126 {
127 return new Levenshtein();
128 }
129
135 public function utfnormal(): UTFNormal
136 {
137 return new UTFNormal();
138 }
139}
Builds data types.
Definition: Factory.php:21
makeClickable()
Creates a transformation to replace URL's like www.ilias.de to www.ilias.de.
Definition: Group.php:113
hasMinLength(int $minimum)
Creates a constraint that can be used to check if a string has reached a minimum length.
Definition: Group.php:47
caseOfLabel(string $language_key)
Creates a transformation that can be used to format a text for the title capitalization presentation ...
Definition: Group.php:90
levenshtein()
This method returns an instance of the Levenshtein class, to call the constructor of the LevenshteinT...
Definition: Group.php:125
estimatedReadingTime(bool $withImages=false)
Creates a transformation to determine the estimated reading time of a human adult (roughly 275 WPM) I...
Definition: Group.php:104
hasMaxLength(int $maximum)
Creates a constraint that can be used to check if a string has exceeded a maximum length.
Definition: Group.php:60
utfnormal()
This method returns an instance of the UTFNormal class which can be used to get Transformations that ...
Definition: Group.php:135
splitString(string $delimiter)
Creates a transformation that can be used to split a given string by given delimiter.
Definition: Group.php:69
__construct(Factory $dataFactory, ilLanguage $language)
Definition: Group.php:33
stripTags()
Creates a transformation that strips tags from a string.
Definition: Group.php:80
Split a string by delimiter into array.
Definition: SplitString.php:33
Strip tags from a string.
Definition: StripTags.php:32
language handling
A constraint encodes some resrtictions on values.
Definition: Constraint.php:32
A transformation is a function from one datatype to another.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: CaseOfLabel.php:21