| Total Complexity | 7 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class Text extends AbstractFieldElement |
||
| 9 | { |
||
| 10 | 55 | public function defaults(): array |
|
| 11 | { |
||
| 12 | 55 | $settingInputSizeClass = 1 !== preg_match('/(tiny|small|regular|large)-text/', $this->field->class) |
|
| 13 | 50 | ? 'regular-text' |
|
| 14 | 5 | : ''; |
|
| 15 | 55 | $locations = [ |
|
| 16 | 55 | 'setting' => $settingInputSizeClass, |
|
| 17 | 55 | 'widget' => 'widefat', |
|
| 18 | 55 | ]; |
|
| 19 | 55 | return array_filter([ |
|
| 20 | 55 | 'class' => $locations[$this->field->location()] ?? '', |
|
| 21 | 55 | ]); |
|
| 22 | } |
||
| 23 | |||
| 24 | 55 | public function tag(): string |
|
| 27 | } |
||
| 28 | |||
| 29 | 53 | protected function normalizeValue(): void |
|
| 42 | } |
||
| 43 | } |
||
| 44 |