diff --git a/src/GitHub/GetStargazersCount.php b/src/GitHub/GetStargazersCount.php index acda93f3..371c1f70 100644 --- a/src/GitHub/GetStargazersCount.php +++ b/src/GitHub/GetStargazersCount.php @@ -2,8 +2,6 @@ namespace App\GitHub; -use DateTimeImmutable; -use Tempest\Cache\Cache; use Tempest\HttpClient\HttpClient; use Throwable; @@ -11,28 +9,21 @@ final class GetStargazersCount { public function __construct( private HttpClient $httpClient, - private Cache $cache, ) { } public function __invoke(): ?string { - return $this->cache->resolve( - key: 'tempest-stargazers', - cache: function () { - try { - $body = $this->httpClient->get('https://api.github.com/repos/tempestphp/tempest-framework')->body; - $stargazers = json_decode($body)->stargazers_count ?? null; + try { + $body = $this->httpClient->get('https://api.github.com/repos/tempestphp/tempest-framework')->body; + $stargazers = json_decode($body)->stargazers_count ?? null; - return $stargazers > 999 - ? (round($stargazers / 1000, 1) . 'K') - : $stargazers; - } catch (Throwable $e) { - ll($e); - return null; - } - }, - expiresAt: new DateTimeImmutable('+12 hours'), - ); + return $stargazers > 999 + ? (round($stargazers / 1000, 1) . 'K') + : $stargazers; + } catch (Throwable $e) { + ll($e); + return null; + } } } diff --git a/src/Migrations/FixDateTimeFieldsMigration.php b/src/Migrations/FixDateTimeFieldsMigration.php index 9cffe45d..051e58bf 100644 --- a/src/Migrations/FixDateTimeFieldsMigration.php +++ b/src/Migrations/FixDateTimeFieldsMigration.php @@ -24,4 +24,4 @@ public function __invoke() $this->success('Done'); } -} \ No newline at end of file +} diff --git a/src/Web/Documentation/ChapterView.php b/src/Web/Documentation/ChapterView.php index c2ea0ef2..26345e5d 100644 --- a/src/Web/Documentation/ChapterView.php +++ b/src/Web/Documentation/ChapterView.php @@ -7,6 +7,7 @@ use Tempest\Support\Arr\ImmutableArray; use Tempest\View\IsView; use Tempest\View\View; + use function Tempest\Support\Arr\map_iterable; use function Tempest\Support\str; diff --git a/src/Web/x-header.view.php b/src/Web/x-header.view.php index 3a0925cc..ee42ea7b 100644 --- a/src/Web/x-header.view.php +++ b/src/Web/x-header.view.php @@ -40,7 +40,9 @@ class="transition hover:text-(--ui-text-highlighted) Blog