| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 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 | ]); |
|
| 44 |