diff --git a/app/Console/Commands/Version.php b/app/Console/Commands/Version.php index 2a5b9b84e..a53e07b56 100644 --- a/app/Console/Commands/Version.php +++ b/app/Console/Commands/Version.php @@ -39,14 +39,14 @@ public function handle() // If a version is being passed in, the update the build, etc data against this if ($this->argument('version')) { - $version = \SemVer\SemVer\Version::fromString($this->argument('version')); + $version = \Version\Version::fromString($this->argument('version')); if ($this->option('write-full-version')) { $cfg['current']['major'] = $version->getMajor(); $cfg['current']['minor'] = $version->getMinor(); $cfg['current']['patch'] = $version->getPatch(); } - $prerelease = $version->getPreRelease(); + $prerelease = $version->getPreRelease()?->toString(); if (strpos($prerelease, '.') !== false) { $prerelease = explode('.', $prerelease); $cfg['current']['prerelease'] = $prerelease[0]; diff --git a/app/Services/VersionService.php b/app/Services/VersionService.php index 2fd6a8264..690ee54ed 100644 --- a/app/Services/VersionService.php +++ b/app/Services/VersionService.php @@ -7,8 +7,8 @@ use App\Support\HttpClient; use GuzzleHttp\Exception\GuzzleException; use Illuminate\Support\Facades\Log; -use SemVer\SemVer\Version; use Symfony\Component\Yaml\Yaml; +use Version\Version; class VersionService extends Service { @@ -232,8 +232,8 @@ public function isNewVersionAvailable($current_version = null) */ public function isGreaterThan($version1, $version2): bool { - $version1 = Version::fromString($version1); - $version2 = Version::fromString($version2); - return $version1->isGreaterThan($version2); + $parsedVersion1 = Version::fromString($version1); + $parsedVersion2 = Version::fromString($version2); + return $parsedVersion1->isGreaterThan($parsedVersion2); } } diff --git a/composer.json b/composer.json index 1df702c43..e908ee097 100644 --- a/composer.json +++ b/composer.json @@ -64,7 +64,6 @@ "phpvms/sample-module": "~1.0", "prettus/l5-repository": "~2.9.0", "santigarcor/laratrust": "^8.2.2", - "semver/semver": "~1.1.0", "spatie/valuestore": "~1.3.2", "tivie/php-os-detector": "~1.1.0", "vlucas/phpdotenv": "~5.5", @@ -88,7 +87,8 @@ "symfony/postmark-mailer": "^6.0", "league/html-to-markdown": "^5.1", "league/flysystem-aws-s3-v3": "^3.0", - "league/flysystem-sftp-v3": "^3.0" + "league/flysystem-sftp-v3": "^3.0", + "nikolaposa/version": "^4.2" }, "require-dev": { "barryvdh/laravel-debugbar": "^3.8.1", diff --git a/composer.lock b/composer.lock index c517b16f4..514aea56b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6277e708db3cbb945c624a2e3d2f08aa", + "content-hash": "ef7737deb0f2ff111ac7cd91fad67934", "packages": [ { "name": "akaunting/laravel-money", @@ -290,6 +290,73 @@ }, "time": "2024-02-02T19:05:34+00:00" }, + { + "name": "beberlei/assert", + "version": "v3.3.2", + "source": { + "type": "git", + "url": "https://github.com/beberlei/assert.git", + "reference": "cb70015c04be1baee6f5f5c953703347c0ac1655" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/beberlei/assert/zipball/cb70015c04be1baee6f5f5c953703347c0ac1655", + "reference": "cb70015c04be1baee6f5f5c953703347c0ac1655", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-simplexml": "*", + "php": "^7.0 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "*", + "phpstan/phpstan": "*", + "phpunit/phpunit": ">=6.0.0", + "yoast/phpunit-polyfills": "^0.1.0" + }, + "suggest": { + "ext-intl": "Needed to allow Assertion::count(), Assertion::isCountable(), Assertion::minCount(), and Assertion::maxCount() to operate on ResourceBundles" + }, + "type": "library", + "autoload": { + "files": [ + "lib/Assert/functions.php" + ], + "psr-4": { + "Assert\\": "lib/Assert" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de", + "role": "Lead Developer" + }, + { + "name": "Richard Quadling", + "email": "rquadling@gmail.com", + "role": "Collaborator" + } + ], + "description": "Thin assertion library for input validation in business models.", + "keywords": [ + "assert", + "assertion", + "validation" + ], + "support": { + "issues": "https://github.com/beberlei/assert/issues", + "source": "https://github.com/beberlei/assert/tree/v3.3.2" + }, + "time": "2021-12-16T21:41:27+00:00" + }, { "name": "brick/math", "version": "0.11.0", @@ -5866,6 +5933,67 @@ }, "time": "2023-12-10T21:03:43+00:00" }, + { + "name": "nikolaposa/version", + "version": "4.2.0", + "source": { + "type": "git", + "url": "https://github.com/nikolaposa/version.git", + "reference": "003fefa14f47cd44917546285e39d196af062a95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikolaposa/version/zipball/003fefa14f47cd44917546285e39d196af062a95", + "reference": "003fefa14f47cd44917546285e39d196af062a95", + "shasum": "" + }, + "require": { + "beberlei/assert": "^3.2", + "php": "^8.1" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.44", + "phpstan/phpstan": "^1.10", + "phpstan/phpstan-beberlei-assert": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^10.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Version\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nikola Poša", + "email": "posa.nikola@gmail.com", + "homepage": "https://www.nikolaposa.in.rs" + } + ], + "description": "Value Object that represents a SemVer-compliant version number.", + "homepage": "https://github.com/nikolaposa/version", + "keywords": [ + "semantic", + "semver", + "version", + "versioning" + ], + "support": { + "issues": "https://github.com/nikolaposa/version/issues", + "source": "https://github.com/nikolaposa/version/tree/4.2.0" + }, + "time": "2023-12-29T22:07:54+00:00" + }, { "name": "nunomaduro/termwind", "version": "v1.15.1", @@ -7822,58 +7950,6 @@ }, "time": "2023-09-03T09:24:00+00:00" }, - { - "name": "semver/semver", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/git-pull-request/php-semver.git", - "reference": "eb7a8fbda082b5c9dcdfc579a1b74c16ea04f7ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/git-pull-request/php-semver/zipball/eb7a8fbda082b5c9dcdfc579a1b74c16ea04f7ce", - "reference": "eb7a8fbda082b5c9dcdfc579a1b74c16ea04f7ce", - "shasum": "" - }, - "require": { - "php": ">=7.0.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "2.0.x-dev", - "phpmetrics/phpmetrics": "^1.10", - "phpunit/phpunit": "^5.3", - "satooshi/php-coveralls": "^1.0", - "symfony/var-dumper": "^3.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "SemVer\\SemVer\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Julien Dufresne", - "email": "github@dfrsn.me" - } - ], - "description": "The semver parser for PHP", - "homepage": "http://semver.org", - "support": { - "issues": "https://github.com/git-pull-request/php-semver/issues", - "source": "https://github.com/git-pull-request/php-semver/tree/master" - }, - "abandoned": true, - "time": "2016-05-28T13:26:32+00:00" - }, { "name": "socialiteproviders/discord", "version": "4.2.0", diff --git a/symfony.lock b/symfony.lock index 2e9254589..909cf16fd 100644 --- a/symfony.lock +++ b/symfony.lock @@ -403,9 +403,6 @@ "sempro/phpunit-pretty-print": { "version": "1.4.0" }, - "semver/semver": { - "version": "1.1.0" - }, "spatie/backtrace": { "version": "1.2.1" },