Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.
   1  <?php
   2  
   3  namespace PhpOffice\PhpSpreadsheet\Helper;
   4  
   5  class Handler
   6  {
   7      /** @var string */
   8      private static $invalidHex = 'Y';
   9  
  10      // A bunch of methods to show that we continue
  11      // to capture messages even using PhpUnit 10.
  12      public static function suppressed(): bool
  13      {
  14          return @trigger_error('hello');
  15      }
  16  
  17      public static function deprecated(): string
  18      {
  19          return (string) hexdec(self::$invalidHex);
  20      }
  21  
  22      public static function notice(string $value): void
  23      {
  24          date_default_timezone_set($value);
  25      }
  26  
  27      public static function warning(): bool
  28      {
  29          return file_get_contents(__FILE__ . 'noexist') !== false;
  30      }
  31  
  32      public static function userDeprecated(): bool
  33      {
  34          return trigger_error('hello', E_USER_DEPRECATED);
  35      }
  36  
  37      public static function userNotice(): bool
  38      {
  39          return trigger_error('userNotice', E_USER_NOTICE);
  40      }
  41  
  42      public static function userWarning(): bool
  43      {
  44          return trigger_error('userWarning', E_USER_WARNING);
  45      }
  46  }