Skip to content

Commit

Permalink
add getLatestVersionData
Browse files Browse the repository at this point in the history
  • Loading branch information
salahhusa9 committed Oct 24, 2023
1 parent 52bf6f8 commit 4737e7e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,21 @@ public function getCurrentVersion(): string

public function getLatestVersion(): string
{
return Cache::remember('latest_version', 60, function () {
return Cache::remember('latest_version', 5, function () {
return app(Repository::class)->getLatestVersion();
});
}

public function getLatestVersionData(): array
{
return Cache::remember('latest_version_data', 5, function () {

Check failure on line 155 in src/Updater.php

View workflow job for this annotation

GitHub Actions / phpstan

Method Salahhusa9\Updater\Updater::getLatestVersionData() should return array but returns Illuminate\Support\Collection.
return app(Repository::class)->getLatestVersionData();
});
}

public function versions(): array
{
return Cache::remember('versions', 60, function () {
return Cache::remember('versions', 5, function () {
return app(Repository::class)->getVersions();
});
}
Expand Down

0 comments on commit 4737e7e

Please sign in to comment.