ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
Group.php
Go to the documentation of this file.
1 <?php declare(strict_types=1);
2 /* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
8 namespace ILIAS\Refinery\String;
9 
14 
15 class Group
16 {
20  private $dataFactory;
21 
25  private $language;
26 
28  {
29  $this->dataFactory = $dataFactory;
30  $this->language = $language;
31  }
32 
41  public function hasMinLength(int $minimum) : HasMinLength
42  {
43  return new HasMinLength($minimum, $this->dataFactory, $this->language);
44  }
45 
54  public function hasMaxLength(int $maximum) : HasMaxLength
55  {
56  return new HasMaxLength($maximum, $this->dataFactory, $this->language);
57  }
58 
66  public function splitString(string $delimiter) : SplitString
67  {
68  return new SplitString($delimiter, $this->dataFactory);
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 }
splitString(string $delimiter)
Creates a transformation that can be used to split a given string by given delimiter.
Definition: Group.php:66
Split a string by delimiter into array.
Definition: SplitString.php:13
hasMaxLength(int $maximum)
Creates a constraint that can be used to check if a string has exceeded a maximum length...
Definition: Group.php:54
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 an human adult (roughly 275 WPM) ...
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:41
stripTags()
Creates a transformation that strips tags from a string.
Definition: Group.php:76
__construct(Factory $dataFactory, \ilLanguage $language)
Definition: Group.php:27
language handling
language()
Definition: language.php:2