diff --git a/src/Command/Run.php b/src/Command/Run.php index acbd4460..519d2762 100644 --- a/src/Command/Run.php +++ b/src/Command/Run.php @@ -81,7 +81,7 @@ protected function execute( ): int { try { // Print intro - $output->writeln(\sprintf('%s v%s', Info::NAME, Info::VERSION)); + $output->writeln(\sprintf('%s v%s', Info::NAME, Info::version())); $output->write(Info::LOGO_CLI_COLOR . "\n", true, OutputInterface::OUTPUT_RAW); /** @var non-empty-string[] $senders */ diff --git a/src/Info.php b/src/Info.php index 59846fac..ee97a046 100644 --- a/src/Info.php +++ b/src/Info.php @@ -10,7 +10,6 @@ class Info { public const NAME = 'Buggregator Trap'; - public const VERSION = '1.7.0'; public const LOGO_CLI_COLOR = << $this->client, - 'version' => Info::VERSION, + 'version' => Info::version(), 'subs' => [ 'events' => (object) [], ], diff --git a/src/Sender/Frontend/Message/Settings.php b/src/Sender/Frontend/Message/Settings.php index 990410a5..19f62fe0 100644 --- a/src/Sender/Frontend/Message/Settings.php +++ b/src/Sender/Frontend/Message/Settings.php @@ -12,9 +12,12 @@ */ final class Settings implements JsonSerializable { - public function __construct( - public readonly string $number = Info::VERSION, - ) {} + public readonly string $number; + + public function __construct() + { + $this->number = Info::version(); + } public function jsonSerialize(): array { @@ -23,7 +26,7 @@ public function jsonSerialize(): array 'enabled' => false, 'login_url' => '/auth/sso/login', ], - 'version' => Info::VERSION, + 'version' => $this->number, ]; } } diff --git a/src/Sender/Frontend/Message/Version.php b/src/Sender/Frontend/Message/Version.php index 9837920c..c463007a 100644 --- a/src/Sender/Frontend/Message/Version.php +++ b/src/Sender/Frontend/Message/Version.php @@ -12,9 +12,12 @@ */ final class Version implements JsonSerializable { - public function __construct( - public readonly string $number = Info::VERSION, - ) {} + public readonly string $number; + + public function __construct() + { + $this->number = Info::version(); + } public function jsonSerialize(): array { diff --git a/src/Sender/RemoteSender.php b/src/Sender/RemoteSender.php index 6279903f..10509487 100644 --- a/src/Sender/RemoteSender.php +++ b/src/Sender/RemoteSender.php @@ -14,12 +14,14 @@ final class RemoteSender extends SocketSender { private string $uuid; + private readonly string $clientVersion; + public function __construct( string $uuid = null, string $host = '127.0.0.1', int $port = 9912, - private readonly string $clientVersion = Info::VERSION, ) { + $this->clientVersion = Info::version(); $this->uuid = $uuid ?? Uuid::generate(); parent::__construct($host, $port);