1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace PhpOffice\PhpSpreadsheet\Reader\Xls; |
4
|
|
|
|
5
|
|
|
use PhpOffice\PhpSpreadsheet\Style\Conditional; |
6
|
|
|
|
7
|
|
|
class ConditionalFormatting |
8
|
|
|
{ |
9
|
|
|
/** |
10
|
|
|
* @var array<int, string> |
11
|
|
|
*/ |
12
|
|
|
private static array $types = [ |
13
|
|
|
0x01 => Conditional::CONDITION_CELLIS, |
14
|
|
|
0x02 => Conditional::CONDITION_EXPRESSION, |
15
|
|
|
]; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* @var array<int, string> |
19
|
|
|
*/ |
20
|
|
|
private static array $operators = [ |
21
|
|
|
0x00 => Conditional::OPERATOR_NONE, |
22
|
|
|
0x01 => Conditional::OPERATOR_BETWEEN, |
23
|
|
|
0x02 => Conditional::OPERATOR_NOTBETWEEN, |
24
|
|
|
0x03 => Conditional::OPERATOR_EQUAL, |
25
|
|
|
0x04 => Conditional::OPERATOR_NOTEQUAL, |
26
|
|
|
0x05 => Conditional::OPERATOR_GREATERTHAN, |
27
|
|
|
0x06 => Conditional::OPERATOR_LESSTHAN, |
28
|
|
|
0x07 => Conditional::OPERATOR_GREATERTHANOREQUAL, |
29
|
|
|
0x08 => Conditional::OPERATOR_LESSTHANOREQUAL, |
30
|
|
|
]; |
31
|
|
|
|
32
|
15 |
|
public static function type(int $type): ?string |
33
|
|
|
{ |
34
|
15 |
|
return self::$types[$type] ?? null; |
35
|
|
|
} |
36
|
|
|
|
37
|
15 |
|
public static function operator(int $operator): ?string |
38
|
|
|
{ |
39
|
15 |
|
return self::$operators[$operator] ?? null; |
40
|
|
|
} |
41
|
|
|
} |
42
|
|
|
|