Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/ProgramScraper.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Carbon\CarbonInterface;

/**
* @psalm-import-type ScrapedRaces from ScraperInterface
* @psalm-import-type ScrapedStadiumRaces from ScraperInterface
*
* @author shimomo
Expand All @@ -26,7 +27,7 @@ public function __construct(private readonly ScraperInterface $scraper)

/**
* @psalm-param \Carbon\CarbonInterface|string $date
* @psalm-return ScrapedStadiumRaces
* @psalm-return ScrapedRaces
*
* @param \Carbon\CarbonInterface|string $date
* @return array
Expand All @@ -41,7 +42,7 @@ public function scrape(CarbonInterface|string $date = 'today'): array

/**
* @psalm-param ScrapedStadiumRaces $programs
* @psalm-return ScrapedStadiumRaces
* @psalm-return ScrapedRaces
*
* @param array $programs
* @return array
Expand All @@ -59,7 +60,7 @@ private function normalize(array $programs): array
}
}

/** @psalm-var ScrapedStadiumRaces */
/** @psalm-var ScrapedRaces */
Copy link
Copy Markdown

@coderabbitai coderabbitai bot Aug 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

psalm-var に変数名が欠落しています($newPrograms を明示してください)。

変数名なしの @psalm-var は型付与されず、Psalm の恩恵が得られません。$newPrograms を対象に指定してください。

適用案:

-        /** @psalm-var ScrapedRaces */
+        /** @psalm-var ScrapedRaces $newPrograms */
         return $newPrograms;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/** @psalm-var ScrapedRaces */
/** @psalm-var ScrapedRaces $newPrograms */
return $newPrograms;
🤖 Prompt for AI Agents
In src/ProgramScraper.php around line 63, the @psalm-var annotation is missing
the variable name so Psalm won't apply the type to $newPrograms; update the
docblock to include the variable name after the type (e.g. use "@psalm-var
ScrapedRaces $newPrograms") so that $newPrograms is correctly type-annotated for
static analysis.

Copy link
Copy Markdown
Contributor Author

@shimomo shimomo Aug 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Psalm は変数名なしの型付与が可能なので無視します。
Off-label usage of the @var tag

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

return $newPrograms;
}
}