File tree 1 file changed +2
-22
lines changed
1 file changed +2
-22
lines changed Original file line number Diff line number Diff line change 5
5
namespace Artemeon \M2G \Helper ;
6
6
7
7
use ahinkle \PackagistLatestVersion \PackagistLatestVersion ;
8
+ use Composer \InstalledVersions ;
8
9
use Exception ;
9
10
10
11
class VersionHelper
@@ -18,28 +19,7 @@ public static function getPackageName(): ?string
18
19
19
20
public static function fetchVersion (): string
20
21
{
21
- $ name = self ::getPackageName ();
22
-
23
- $ version = null ;
24
-
25
- foreach (
26
- [
27
- __DIR__ . '/../../../../composer/installed.php ' ,
28
- __DIR__ . '/../../../vendor/composer/installed.php ' ,
29
- __DIR__ . '/../../vendor/composer/installed.php '
30
- ] as $ file
31
- ) {
32
- if (file_exists ($ file )) {
33
- $ installed = require $ file ;
34
- $ version = $ installed ['versions ' ][$ name ]['pretty_version ' ] ?? null ;
35
-
36
- break ;
37
- }
38
- }
39
-
40
- unset($ file , $ installed );
41
-
42
- return $ version ;
22
+ return InstalledVersions::getPrettyVersion ('artemeon/mantis2github ' );
43
23
}
44
24
45
25
/**
You can’t perform that action at this time.
0 commit comments