| Conditions | 3 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 15 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | 10 | public function __invoke() |
|
| 25 | { |
||
| 26 | 10 | $command = new FindResourceOptionsCommand($this->resourceDO, $this->filesystem); |
|
| 27 | 10 | $result = $command([ |
|
| 28 | 10 | 'version', |
|
| 29 | 10 | ]); |
|
| 30 | 8 | $lastVersion = 0; |
|
| 31 | 8 | if (!empty($result)) { |
|
| 32 | 8 | array_filter($result, function ($found) use (&$lastVersion) { |
|
| 33 | 8 | $found = (int)$found['version']; |
|
| 34 | $lastVersion = $found > $lastVersion |
||
| 35 | 8 | ? $found |
|
| 36 | 8 | : $lastVersion; |
|
| 37 | |||
| 38 | 8 | return false; |
|
| 39 | 8 | }); |
|
| 40 | 8 | } |
|
| 41 | |||
| 42 | 8 | return $lastVersion; |
|
| 43 | } |
||
| 44 | } |