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
21namespace ILIAS\Refinery\String;
22
26use ILIAS\Refinery\String\Encoding\Group as EncodingGroup;
27
28class Group
29{
31 private \ILIAS\Language\Language $language;
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
79 public function stripTags(): Transformation
80 {
81 return new StripTags();
82 }
83
89 public function caseOfLabel(string $language_key): Transformation
90 {
91 return new CaseOfLabel($language_key);
92 }
93
103 public function estimatedReadingTime(bool $withImages = false): Transformation
104 {
105 return new EstimatedReadingTime($withImages);
106 }
107
112 public function makeClickable(): Transformation
113 {
114 return new MakeClickable();
115 }
116
124 public function levenshtein(): Levenshtein
125 {
126 return new Levenshtein();
127 }
128
134 public function utfnormal(): UTFNormal
135 {
136 return new UTFNormal();
137 }
138
143 public function markdown(bool $escape = true): MarkdownFormattingToHTML
144 {
145 return new MarkdownFormattingToHTML($escape);
146 }
147
151 public function encoding(): EncodingGroup
152 {
153 return new EncodingGroup();
154 }
155}
Builds data types.
Definition: Factory.php:36
makeClickable()
Creates a transformation to replace URL's like www.ilias.de to www.ilias.de.
Definition: Group.php:112
hasMinLength(int $minimum)
Creates a constraint that can be used to check if a string has reached a minimum length.
Definition: Group.php:47
markdown(bool $escape=true)
This method returns an instance of the MarkdownFormattingToHTML class which can be used to tranform a...
Definition: Group.php:143
caseOfLabel(string $language_key)
Creates a transformation that can be used to format a text for the title capitalization presentation ...
Definition: Group.php:89
levenshtein()
This method returns an instance of the Levenshtein class, to call the constructor of the LevenshteinT...
Definition: Group.php:124
estimatedReadingTime(bool $withImages=false)
Creates a transformation to determine the estimated reading time of a human adult (roughly 275 WPM) I...
Definition: Group.php:103
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:134
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, \ILIAS\Language\Language $language)
Definition: Group.php:33
stripTags()
Creates a transformation that strips tags from a string.
Definition: Group.php:79
encoding()
This method returns a group of string encoding transformations.
Definition: Group.php:151
ILIAS Language Language $language
Definition: Group.php:31
This class provides a transformation that converts Markdown formatting to HTML using the CommonMark L...
Split a string by delimiter into array.
Definition: SplitString.php:33
Strip tags from a string.
Definition: StripTags.php:32
A constraint encodes some resrtictions on values.
Definition: Constraint.php:32
A transformation is a function from one datatype to another.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.