Skip to content

Commit a86601f

Browse files
committed
Add version into phar
1 parent 8923d76 commit a86601f

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

box.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
"vendor/zhamao"
1414
],
1515
"git-commit-short": "git_commit_short",
16+
"metadata": "Version::getVersion",
1617
"output": "spc.phar"
1718
}

src/SPC/ConsoleApplication.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@
2424
*/
2525
final class ConsoleApplication extends Application
2626
{
27-
public const VERSION = '2.0-rc6';
28-
2927
public function __construct()
3028
{
31-
parent::__construct('static-php-cli', self::VERSION);
29+
parent::__construct('static-php-cli', Version::getVersion());
3230

3331
global $argv;
3432

src/SPC/Version.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SPC;
6+
7+
final class Version
8+
{
9+
private const VERSION = '2.0-rc6';
10+
11+
private function __construct() {}
12+
13+
public static function getVersion(): string
14+
{
15+
return self::VERSION;
16+
}
17+
}

0 commit comments

Comments
 (0)