Skip to content

Commit

Permalink
Replace semver/semver by nikolaposa/version (#1754)
Browse files Browse the repository at this point in the history
* Apply fixes from StyleCI

* Replace semver/semver by nikolaposa/version

* Update composer.lock

* Update composer.lock

* Update composer.lock

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 5, 2024
1 parent 15bac3a commit 1f5b83b
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 64 deletions.
4 changes: 2 additions & 2 deletions app/Console/Commands/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
8 changes: 4 additions & 4 deletions app/Services/VersionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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);
}
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
182 changes: 129 additions & 53 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions symfony.lock
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,6 @@
"sempro/phpunit-pretty-print": {
"version": "1.4.0"
},
"semver/semver": {
"version": "1.1.0"
},
"spatie/backtrace": {
"version": "1.2.1"
},
Expand Down

0 comments on commit 1f5b83b

Please sign in to comment.