Skip to content

Commit ed2e861

Browse files
authored
Remove version from composer.json (#462)
* Remove version from composer.json * Update Version.php * Delete VersionTest
1 parent d373e33 commit ed2e861

File tree

3 files changed

+4
-30
lines changed

3 files changed

+4
-30
lines changed

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"description": "Enforce architectural constraints in your PHP applications",
44
"type": "library",
55
"license": "MIT",
6-
"version": "0.5.2",
76
"authors": [
87
{
98
"name": "Pietro Campagnano",
@@ -60,4 +59,4 @@
6059
"bin": [
6160
"bin-stub/phparkitect"
6261
]
63-
}
62+
}

src/CLI/Version.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,12 @@
44

55
namespace Arkitect\CLI;
66

7+
use Composer\InstalledVersions;
8+
79
class Version
810
{
911
public static function get(): string
1012
{
11-
$pharPath = \Phar::running();
12-
13-
if ($pharPath) {
14-
$content = file_get_contents("$pharPath/composer.json");
15-
} else {
16-
$phparkitectRootPath = __DIR__.'/../../';
17-
$content = file_get_contents($phparkitectRootPath.'composer.json');
18-
}
19-
20-
$composerData = json_decode($content, true);
21-
22-
return $composerData['version'] ?? 'UNKNOWN';
13+
return InstalledVersions::getVersion('phparkitect/phparkitect') ?? 'UNKNOWN';
2314
}
2415
}

tests/Unit/CLI/VersionTest.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)