@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | * @throws TInvalidDataValueException if the original value is not in the string array. |
| 156 | 156 | * @return string|\UnitEnum the valid enumeration value |
| 157 | 157 | */ |
| 158 | - public static function ensureEnum($value, $enums): string|\UnitEnum |
|
| 158 | + public static function ensureEnum($value, $enums): string | \UnitEnum |
|
| 159 | 159 | { |
| 160 | 160 | static $types = []; |
| 161 | 161 | if (func_num_args() === 2 && is_string($enums)) { |
@@ -163,13 +163,13 @@ discard block |
||
| 163 | 163 | $types[$enums] = new \ReflectionClass($enums); |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | - if($types[$enums]->isEnum()) { |
|
| 166 | + if ($types[$enums]->isEnum()) { |
|
| 167 | 167 | // Php 8.1 native enum instances |
| 168 | - if($value instanceof $enums) { |
|
| 168 | + if ($value instanceof $enums) { |
|
| 169 | 169 | return $value; |
| 170 | 170 | } |
| 171 | 171 | $enumValue = $enums::tryFrom($value); |
| 172 | - if($enumValue !== null) { |
|
| 172 | + if ($enumValue !== null) { |
|
| 173 | 173 | return $enumValue; |
| 174 | 174 | } |
| 175 | 175 | |
@@ -26,6 +26,6 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | enum TActiveRecordInvalidFinderResult: string |
| 28 | 28 | { |
| 29 | - case Null = 'Null'; |
|
| 29 | + case null = 'Null'; |
|
| 30 | 30 | case Exception = 'Exception'; |
| 31 | 31 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | protected function getTagName() |
| 59 | 59 | { |
| 60 | - switch($this->getButtonTag()) { |
|
| 60 | + switch ($this->getButtonTag()) { |
|
| 61 | 61 | case TButtonTag::Input: |
| 62 | 62 | return 'input'; |
| 63 | 63 | case TButtonTag::Button: |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | { |
| 108 | 108 | $page = $this->getPage(); |
| 109 | 109 | $page->ensureRenderInForm($this); |
| 110 | - switch($this->getButtonType()) { |
|
| 110 | + switch ($this->getButtonType()) { |
|
| 111 | 111 | case TButtonType::Submit: |
| 112 | 112 | $writer->addAttribute('type', 'submit'); |
| 113 | 113 | break; |