Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]

   1  <?php
   2  
   3  namespace PhpOffice\PhpSpreadsheet\Calculation\TextData;
   4  
   5  use PhpOffice\PhpSpreadsheet\Calculation\Functions;
   6  use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
   7  
   8  class CaseConvert
   9  {
  10      /**
  11       * LOWERCASE.
  12       *
  13       * Converts a string value to upper case.
  14       *
  15       * @param mixed $mixedCaseValue The string value to convert to lower case
  16       */
  17      public static function lower($mixedCaseValue): string
  18      {
  19          $mixedCaseValue = Functions::flattenSingleValue($mixedCaseValue);
  20          $mixedCaseValue = Helpers::extractString($mixedCaseValue);
  21  
  22          return StringHelper::strToLower($mixedCaseValue);
  23      }
  24  
  25      /**
  26       * UPPERCASE.
  27       *
  28       * Converts a string value to upper case.
  29       *
  30       * @param mixed $mixedCaseValue The string value to convert to upper case
  31       */
  32      public static function upper($mixedCaseValue): string
  33      {
  34          $mixedCaseValue = Functions::flattenSingleValue($mixedCaseValue);
  35          $mixedCaseValue = Helpers::extractString($mixedCaseValue);
  36  
  37          return StringHelper::strToUpper($mixedCaseValue);
  38      }
  39  
  40      /**
  41       * PROPERCASE.
  42       *
  43       * Converts a string value to proper or title case.
  44       *
  45       * @param mixed $mixedCaseValue The string value to convert to title case
  46       */
  47      public static function proper($mixedCaseValue): string
  48      {
  49          $mixedCaseValue = Functions::flattenSingleValue($mixedCaseValue);
  50          $mixedCaseValue = Helpers::extractString($mixedCaseValue);
  51  
  52          return StringHelper::strToTitle($mixedCaseValue);
  53      }
  54  }