| Conditions | 5 |
| Paths | 5 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5.025 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | { |
||
| 23 | 20 | if ($userId = $this->value()) { |
|
| 24 | 2 | return $userId; |
|
| 25 | } |
||
| 26 | 20 | $fallback = $this->args[0]; |
|
| 27 | 20 | if ('current_user' === $fallback) { |
|
| 28 | 18 | return $this->userValue(wp_get_current_user()); |
|
| 29 | } |
||
| 30 | 20 | return $this->userValue($fallback); |
|
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @param mixed $value |
||
| 35 | */ |
||
| 36 | 20 | protected function userValue($value): int |
|
| 60 |