Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix: address new cubic-dev review comments (round 2)

Devin AIffa5bf7e8d73
diff --git a/.github/scripts/check_version_has_incremented.py b/.github/scripts/check_version_has_incremented.py
index cbab64e0d..336230bdc 100644
--- a/.github/scripts/check_version_has_incremented.py
+++ b/.github/scripts/check_version_has_incremented.py
@@ -109,8 +109,13 @@ def get_packagist_version(package_name: str) -> str:
stable_versions = []
for v in versions:
normalized = v.lstrip("v")
- parsed = parse_version(normalized)
- if "dev" not in v and not parsed.is_prerelease and re.match(r"^\d", normalized):
+ if "dev" in v or not re.match(r"^\d", normalized):
+ continue
+ try:
+ parsed = parse_version(normalized)
+ except Exception:
+ continue
+ if not parsed.is_prerelease:
stable_versions.append(normalized)
if not stable_versions:
return "0.0.0"
diff --git a/.github/workflows/test-php-sdk.yml b/.github/workflows/test-php-sdk.yml
index 3a1ffc63c..c716f35fa 100644
--- a/.github/workflows/test-php-sdk.yml
+++ b/.github/workflows/test-php-sdk.yml
@@ -62,7 +62,7 @@ jobs:
run: vendor/bin/pest --ci
- name: Run E2E tests
- if: env.FIRECRAWL_API_KEY != ''
+ if: ${{ secrets.FIRECRAWL_API_KEY != '' }}
working-directory: ./apps/php-sdk
env:
FIRECRAWL_API_KEY: ${{ secrets.FIRECRAWL_API_KEY }}
diff --git a/apps/php-sdk/src/Models/BrowserListResponse.php b/apps/php-sdk/src/Models/BrowserListResponse.php
index 184a8614c..8370d14a2 100644
--- a/apps/php-sdk/src/Models/BrowserListResponse.php
+++ b/apps/php-sdk/src/Models/BrowserListResponse.php
@@ -19,8 +19,11 @@ final class BrowserListResponse
public static function fromArray(array $data): self
{
$sessions = [];
- foreach (($data['sessions'] ?? []) as $session) {
- $sessions[] = BrowserSession::fromArray($session);
+ $rawSessions = $data['sessions'] ?? [];
+ if (is_array($rawSessions)) {
+ foreach ($rawSessions as $session) {
+ $sessions[] = BrowserSession::fromArray($session);
+ }
}
return new self(
diff --git a/apps/php-sdk/src/Models/SearchData.php b/apps/php-sdk/src/Models/SearchData.php
index 9236964ed..241238d70 100644
--- a/apps/php-sdk/src/Models/SearchData.php
+++ b/apps/php-sdk/src/Models/SearchData.php
@@ -20,10 +20,14 @@ final class SearchData
/** @param array<string, mixed> $data */
public static function fromArray(array $data): self
{
+ $web = $data['web'] ?? [];
+ $news = $data['news'] ?? [];
+ $images = $data['images'] ?? [];
+
return new self(
- web: $data['web'] ?? [],
- news: $data['news'] ?? [],
- images: $data['images'] ?? [],
+ web: is_array($web) ? $web : [],
+ news: is_array($news) ? $news : [],
+ images: is_array($images) ? $images : [],
);
}