ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
Group.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 /* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
5 
10 namespace ILIAS\Refinery\String;
11 
13 
14 class Group
15 {
19  private $dataFactory;
20 
24  private $language;
25 
27  {
28  $this->dataFactory = $dataFactory;
29  $this->language = $language;
30  }
31 
40  public function hasMinLength(int $minimum): HasMinLength
41  {
42  return new HasMinLength($minimum, $this->dataFactory, $this->language);
43  }
44 
53  public function hasMaxLength(int $maximum): HasMaxLength
54  {
55  return new HasMaxLength($maximum, $this->dataFactory, $this->language);
56  }
57 
65  public function splitString(string $delimiter): SplitString
66  {
67  return new SplitString($delimiter, $this->dataFactory);
68  }
69 
70 
76  public function stripTags(): StripTags
77  {
78  return new StripTags();
79  }
80 
90  public function caseOfLabel(string $language_key): CaseOfLabel
91  {
92  return new CaseOfLabel($language_key, $this->dataFactory);
93  }
94 
107  public function estimatedReadingTime($withImages = false): EstimatedReadingTime
108  {
109  return new EstimatedReadingTime($withImages);
110  }
111 
119  public function levenshtein(): Levenshtein
120  {
121  return new Levenshtein();
122  }
123 }
splitString(string $delimiter)
Creates a transformation that can be used to split a given string by given delimiter.
Definition: Group.php:65
Split a string by delimiter into array.
Definition: SplitString.php:14
hasMaxLength(int $maximum)
Creates a constraint that can be used to check if a string has exceeded a maximum length...
Definition: Group.php:53
levenshtein()
This method returns an instance of the Levenshtein class, to call the constructor of the LevenshteinT...
Definition: Group.php:119
caseOfLabel(string $language_key)
Creates a transformation that can be used to format a text for the title capitalization presentation ...
Definition: Group.php:90
estimatedReadingTime($withImages=false)
Creates a transformation to determine the estimated reading time of a human adult (roughly 275 WPM) I...
Definition: Group.php:107
Builds data types.
Definition: Factory.php:19
Strip tags from a string.
Definition: StripTags.php:13
hasMinLength(int $minimum)
Creates a constraint that can be used to check if a string has reached a minimum length.
Definition: Group.php:40
stripTags()
Creates a transformation that strips tags from a string.
Definition: Group.php:76
__construct(Factory $dataFactory, \ilLanguage $language)
Definition: Group.php:26
language()
Definition: language.php:2