File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,16 +31,9 @@ public function latestStableVersion(string $packageName): ?string
3131
3232 public function isAvailable (): bool
3333 {
34- return rescue (
35- static function (): bool {
36- Http::timeout (5 )
37- ->get ('https://packagist.org/packages/justbetter/statamic-base.json ' )
38- ->throw ();
39-
40- return true ;
41- },
42- false ,
43- );
34+ return Http::timeout (5 )
35+ ->get ('https://packagist.org/packages/justbetter/statamic-base.json ' )
36+ ->successful ();
4437 }
4538
4639 protected function fetchLatestStableVersion (string $ packageName ): ?string
Original file line number Diff line number Diff line change @@ -128,12 +128,4 @@ public function it_detects_when_packagist_is_unavailable(): void
128128
129129 $ this ->assertFalse ($ this ->client ->isAvailable ());
130130 }
131-
132- #[Test]
133- public function it_detects_when_packagist_throws (): void
134- {
135- Http::fake (fn () => throw new ConnectionException ('Connection failed ' ));
136-
137- $ this ->assertFalse ($ this ->client ->isAvailable ());
138- }
139131}
You can’t perform that action at this time.
0 commit comments