ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
CaseConvert.php
Go to the documentation of this file.
1 <?php
2 
4 
8 
10 {
18  public static function lower($mixedCaseValue): string
19  {
20  $mixedCaseValue = Functions::flattenSingleValue($mixedCaseValue);
21 
22  if (is_bool($mixedCaseValue)) {
23  $mixedCaseValue = ($mixedCaseValue === true) ? Calculation::getTRUE() : Calculation::getFALSE();
24  }
25 
26  return StringHelper::strToLower($mixedCaseValue);
27  }
28 
36  public static function upper($mixedCaseValue): string
37  {
38  $mixedCaseValue = Functions::flattenSingleValue($mixedCaseValue);
39 
40  if (is_bool($mixedCaseValue)) {
41  $mixedCaseValue = ($mixedCaseValue === true) ? Calculation::getTRUE() : Calculation::getFALSE();
42  }
43 
44  return StringHelper::strToUpper($mixedCaseValue);
45  }
46 
54  public static function proper($mixedCaseValue): string
55  {
56  $mixedCaseValue = Functions::flattenSingleValue($mixedCaseValue);
57 
58  if (is_bool($mixedCaseValue)) {
59  $mixedCaseValue = ($mixedCaseValue === true) ? Calculation::getTRUE() : Calculation::getFALSE();
60  }
61 
62  return StringHelper::strToTitle($mixedCaseValue);
63  }
64 }
static strToTitle($pValue)
Convert a UTF-8 encoded string to title/proper case (uppercase every first character in each word...
static strToUpper($pValue)
Convert a UTF-8 encoded string to upper case.
static getFALSE()
Return the locale-specific translation of FALSE.
static getTRUE()
Return the locale-specific translation of TRUE.
static strToLower($pValue)
Convert a UTF-8 encoded string to lower case.
static flattenSingleValue($value='')
Convert an array to a single scalar value by extracting the first element.
Definition: Functions.php:649