chengkun
2025-09-15 3c9050e82e582414dc7b208c8283fe47be37eeba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
 
namespace PhpOffice\PhpSpreadsheet\Helper;
 
class Handler
{
    private static string $invalidHex = 'Y';
 
    // A bunch of methods to show that we continue
    // to capture messages even using PhpUnit 10.
    public static function suppressed(): bool
    {
        return @trigger_error('hello');
    }
 
    public static function deprecated(): string
    {
        return (string) hexdec(self::$invalidHex);
    }
 
    public static function notice(string $value): void
    {
        date_default_timezone_set($value);
    }
 
    public static function warning(): bool
    {
        return file_get_contents(__FILE__ . 'noexist') !== false;
    }
 
    public static function userDeprecated(): bool
    {
        return trigger_error('hello', E_USER_DEPRECATED);
    }
 
    public static function userNotice(): bool
    {
        return trigger_error('userNotice', E_USER_NOTICE);
    }
 
    public static function userWarning(): bool
    {
        return trigger_error('userWarning', E_USER_WARNING);
    }
}