ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
Group.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Refinery\String;
22 
24 use ilLanguage;
27 
28 class Group
29 {
32 
33  public function __construct(Factory $dataFactory, ilLanguage $language)
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 }
splitString(string $delimiter)
Creates a transformation that can be used to split a given string by given delimiter.
Definition: Group.php:69
Split a string by delimiter into array.
Definition: SplitString.php:32
A constraint encodes some resrtictions on values.
Definition: Constraint.php:31
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
levenshtein()
This method returns an instance of the Levenshtein class, to call the constructor of the LevenshteinT...
Definition: Group.php:125
__construct(Factory $dataFactory, ilLanguage $language)
Definition: Group.php:33
caseOfLabel(string $language_key)
Creates a transformation that can be used to format a text for the title capitalization presentation ...
Definition: Group.php:90
makeClickable()
Creates a transformation to replace URL&#39;s like www.ilias.de to www.ilias.de.
Definition: Group.php:113
Strip tags from a string.
Definition: StripTags.php:31
hasMinLength(int $minimum)
Creates a constraint that can be used to check if a string has reached a minimum length.
Definition: Group.php:47
stripTags()
Creates a transformation that strips tags from a string.
Definition: Group.php:80
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
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