ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\Refinery\String\Group Class Reference
+ Collaboration diagram for ILIAS\Refinery\String\Group:

Public Member Functions

 __construct (Factory $dataFactory, \ilLanguage $language)
 
 hasMinLength (int $minimum)
 Creates a constraint that can be used to check if a string has reached a minimum length. More...
 
 hasMaxLength (int $maximum)
 Creates a constraint that can be used to check if a string has exceeded a maximum length. More...
 
 splitString (string $delimiter)
 Creates a transformation that can be used to split a given string by given delimiter. More...
 
 stripTags ()
 Creates a transformation that strips tags from a string. More...
 
 caseOfLabel (string $language_key)
 Creates a transformation that can be used to format a text for the title capitalization presentation (Specification at https://docu.ilias.de/goto_docu_pg_1430_42.html) More...
 
 estimatedReadingTime ($withImages=false)
 Creates a transformation to determine the estimated reading time of an human adult (roughly 275 WPM) If images should be taken into consideration, 12 seconds are added to the first image, 11 for the second, and minus an additional second for each subsequent image. More...
 

Private Attributes

 $dataFactory
 
 $language
 

Detailed Description

Definition at line 15 of file Group.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Refinery\String\Group::__construct ( Factory  $dataFactory,
\ilLanguage  $language 
)

Definition at line 27 of file Group.php.

References ILIAS\Refinery\String\Group\$dataFactory, ILIAS\Refinery\String\Group\$language, and language().

28  {
29  $this->dataFactory = $dataFactory;
30  $this->language = $language;
31  }
language()
Definition: language.php:2
+ Here is the call graph for this function:

Member Function Documentation

◆ caseOfLabel()

ILIAS\Refinery\String\Group::caseOfLabel ( string  $language_key)

Creates a transformation that can be used to format a text for the title capitalization presentation (Specification at https://docu.ilias.de/goto_docu_pg_1430_42.html)

Throws a LogicException in the transform method, if a not supported language is passed

Parameters
string$language_key
Returns
CaseOfLabel

Definition at line 90 of file Group.php.

90  : CaseOfLabel
91  {
92  return new CaseOfLabel($language_key, $this->dataFactory);
93  }

◆ estimatedReadingTime()

ILIAS\Refinery\String\Group::estimatedReadingTime (   $withImages = false)

Creates a transformation to determine the estimated reading time of an human adult (roughly 275 WPM) If images should be taken into consideration, 12 seconds are added to the first image, 11 for the second, and minus an additional second for each subsequent image.

Any images after the tenth image are counted at three seconds. The reading time returned in minutes as a integer value.

Parameters
bool$withImages
Returns
EstimatedReadingTime

Definition at line 107 of file Group.php.

107  : EstimatedReadingTime
108  {
109  return new EstimatedReadingTime($withImages);
110  }

◆ hasMaxLength()

ILIAS\Refinery\String\Group::hasMaxLength ( int  $maximum)

Creates a constraint that can be used to check if a string has exceeded a maximum length.

Parameters
int$maximum- maximum length of a strings that will be checked with the new constraint
Returns
HasMaxLength

Definition at line 54 of file Group.php.

References language().

54  : HasMaxLength
55  {
56  return new HasMaxLength($maximum, $this->dataFactory, $this->language);
57  }
language()
Definition: language.php:2
+ Here is the call graph for this function:

◆ hasMinLength()

ILIAS\Refinery\String\Group::hasMinLength ( int  $minimum)

Creates a constraint that can be used to check if a string has reached a minimum length.

Parameters
int$minimum- minimum length of a string that will be checked with the new constraint
Returns
HasMinLength

Definition at line 41 of file Group.php.

References language().

41  : HasMinLength
42  {
43  return new HasMinLength($minimum, $this->dataFactory, $this->language);
44  }
language()
Definition: language.php:2
+ Here is the call graph for this function:

◆ splitString()

ILIAS\Refinery\String\Group::splitString ( string  $delimiter)

Creates a transformation that can be used to split a given string by given delimiter.

Parameters
string$delimiter
Returns
SplitString

Definition at line 66 of file Group.php.

66  : SplitString
67  {
68  return new SplitString($delimiter, $this->dataFactory);
69  }

◆ stripTags()

ILIAS\Refinery\String\Group::stripTags ( )

Creates a transformation that strips tags from a string.

Uses php's strip_tags under the hood.

Definition at line 76 of file Group.php.

76  : StripTags
77  {
78  return new StripTags();
79  }

Field Documentation

◆ $dataFactory

ILIAS\Refinery\String\Group::$dataFactory
private

Definition at line 20 of file Group.php.

Referenced by ILIAS\Refinery\String\Group\__construct().

◆ $language

ILIAS\Refinery\String\Group::$language
private

Definition at line 25 of file Group.php.

Referenced by ILIAS\Refinery\String\Group\__construct().


The documentation for this class was generated from the following file: