← All changes
|
libraries/vendor/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/TextValue.php
+14
-1
3.3.1
→
3.4
View file →
| @@ -53,9 +53,10 @@ | ||
| 53 | 53 | |
| 54 | 54 | protected function operator(string $operator): void |
| 55 | 55 | { |
| 56 | 56 | if (!isset(self::OPERATORS[$operator])) { |
| 57 | - throw new Exception('Invalid Operator for Text Value CF Rule Wizard'); | |
| 57 | + // should not happen - compareKeys confirms | |
| 58 | + throw new Exception('Invalid Operator for Text Value CF Rule Wizard'); // @codeCoverageIgnore | |
| 58 | 59 | } |
| 59 | 60 | |
| 60 | 61 | $this->operator = $operator; |
| 61 | 62 | } |
| @@ -159,6 +160,18 @@ | ||
| 159 | 160 | $this->operand($arg0, $arg1); |
| 160 | 161 | } |
| 161 | 162 | |
| 162 | 163 | return $this; |
| 164 | + } | |
| 165 | + | |
| 166 | + /** @internal */ | |
| 167 | + public static function compareKeys(): bool | |
| 168 | + { | |
| 169 | + $retVal = true; | |
| 170 | + $array = array_keys(self::OPERATORS); | |
| 171 | + foreach ($array as $value) { | |
| 172 | + $retVal = $retVal && in_array($value, self::MAGIC_OPERATIONS, true); | |
| 173 | + } | |
| 174 | + | |
| 175 | + return $retVal; | |
| 163 | 176 | } |
| 164 | 177 | } |