ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Refinery\String\Group Class Reference
+ Collaboration diagram for ILIAS\Refinery\String\Group:

Public Member Functions

 __construct (Factory $dataFactory, \ILIAS\Language\Language $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 (bool $withImages=false)
 Creates a transformation to determine the estimated reading time of a 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...
 
 makeClickable ()
 Creates a transformation to replace URL's like www.ilias.de to www.ilias.de. More...
 
 levenshtein ()
 This method returns an instance of the Levenshtein class, to call the constructor of the LevenshteinTransformation class with either default values already set, or custom values for the cost calculation of the Levenshtein distance function. More...
 
 utfnormal ()
 This method returns an instance of the UTFNormal class which can be used to get Transformations that can be used to normalize a string to one of the Unicode Normalization Form (C, D, KC, KD). More...
 
 markdown (bool $escape=true)
 This method returns an instance of the MarkdownFormattingToHTML class which can be used to tranform a markdown formatted string to HTML. More...
 
 encoding ()
 This method returns a group of string encoding transformations. More...
 

Private Attributes

Factory $dataFactory
 
ILIAS Language Language $language
 

Detailed Description

Definition at line 28 of file Group.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 33 of file Group.php.

References ILIAS\Refinery\String\Group\$dataFactory, ILIAS\Refinery\String\Group\$language, and ILIAS\UI\examples\Symbol\Glyph\Language\language().

34  {
35  $this->dataFactory = $dataFactory;
36  $this->language = $language;
37  }
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
ILIAS Language Language $language
Definition: Group.php:31
+ 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

Definition at line 89 of file Group.php.

89  : Transformation
90  {
91  return new CaseOfLabel($language_key);
92  }

◆ encoding()

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

This method returns a group of string encoding transformations.

Definition at line 151 of file Group.php.

151  : EncodingGroup
152  {
153  return new EncodingGroup();
154  }

◆ estimatedReadingTime()

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

Creates a transformation to determine the estimated reading time of a 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.

Definition at line 103 of file Group.php.

103  : Transformation
104  {
105  return new EstimatedReadingTime($withImages);
106  }

◆ 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
Constraint

Definition at line 60 of file Group.php.

References ILIAS\UI\examples\Symbol\Glyph\Language\language().

60  : Constraint
61  {
62  return new HasMaxLength($maximum, $this->dataFactory, $this->language);
63  }
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ 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
Constraint

Definition at line 47 of file Group.php.

References ILIAS\UI\examples\Symbol\Glyph\Language\language().

47  : Constraint
48  {
49  return new HasMinLength($minimum, $this->dataFactory, $this->language);
50  }
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:

◆ levenshtein()

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

This method returns an instance of the Levenshtein class, to call the constructor of the LevenshteinTransformation class with either default values already set, or custom values for the cost calculation of the Levenshtein distance function.

Returns
Levenshtein

Definition at line 124 of file Group.php.

124  : Levenshtein
125  {
126  return new Levenshtein();
127  }

◆ makeClickable()

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

Creates a transformation to replace URL's like www.ilias.de to www.ilias.de.

But does not replace URL's already in anchor tags. Expects a string of mixed HTML and plain text.

Definition at line 112 of file Group.php.

112  : Transformation
113  {
114  return new MakeClickable();
115  }

◆ markdown()

ILIAS\Refinery\String\Group::markdown ( bool  $escape = true)

This method returns an instance of the MarkdownFormattingToHTML class which can be used to tranform a markdown formatted string to HTML.

Definition at line 143 of file Group.php.

143  : MarkdownFormattingToHTML
144  {
145  return new MarkdownFormattingToHTML($escape);
146  }

◆ splitString()

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

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

Definition at line 69 of file Group.php.

69  : Transformation
70  {
71  return new SplitString($delimiter, $this->dataFactory);
72  }

◆ 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 79 of file Group.php.

79  : Transformation
80  {
81  return new StripTags();
82  }

◆ utfnormal()

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

This method returns an instance of the UTFNormal class which can be used to get Transformations that can be used to normalize a string to one of the Unicode Normalization Form (C, D, KC, KD).

See https://unicode.org/reports/tr15/ for more information.

Definition at line 134 of file Group.php.

134  : UTFNormal
135  {
136  return new UTFNormal();
137  }

Field Documentation

◆ $dataFactory

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

Definition at line 30 of file Group.php.

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

◆ $language

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

Definition at line 31 of file Group.php.

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


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