| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 19 | public static function getVersion() { |
||
| 20 | // Nextcloud 14 introduced a new API for this which is not available on ownCloud. |
||
| 21 | // Nextcloud 25 removed the old API for good. |
||
| 22 | $appManager = \OC::$server->getAppManager(); |
||
| 23 | if (\method_exists($appManager, 'getAppVersion')) { |
||
| 24 | return $appManager->getAppVersion(self::APP_ID); // NC14+ |
||
| 25 | } else { |
||
| 26 | return \OCP\App::getAppVersion(self::APP_ID); // OC or NC13 |
||
| 27 | } |
||
| 29 | } |