Conditions | 5 |
Paths | 15 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
39 | public static function getLeagueCsvVersion(): int |
||
40 | { |
||
41 | $version = 0; |
||
42 | $installedVersion = null; |
||
43 | try { |
||
44 | $pv = PrettyVersions::getVersion(self::LEAGUE_CSV_PACKAGE); |
||
45 | $installedVersion = $pv->getPrettyVersion(); |
||
46 | } catch (Throwable $e) { |
||
47 | Craft::error($e, __METHOD__); |
||
48 | } |
||
49 | if ($installedVersion) { |
||
50 | if (Semver::satisfies($installedVersion, '^8.0.0')) { |
||
51 | $version = 8; |
||
52 | } |
||
53 | if (Semver::satisfies($installedVersion, '^9.0.0')) { |
||
54 | $version = 9; |
||
55 | } |
||
56 | } |
||
57 | |||
58 | return $version; |
||
59 | } |
||
61 |