fix(books): drop dead guard on scraped traduttore/illustratore (PHPStan L5 green)#200
fix(books): drop dead guard on scraped traduttore/illustratore (PHPStan L5 green)#200fabiodalez-dev wants to merge 1 commit into
Conversation
…tratore PHPStan level 5 flagged BookRepository's scraped-field merge: the `!isset($cols['traduttore'])` / `!isset($cols['illustratore'])` guards are dead code — no earlier branch assigns those keys, so the condition is always true (isset.offset → impossibleType). Unlike the sibling fields (ean, collana, data_pubblicazione) which a prior branch can set, traduttore/illustratore are assigned only here, so the guard never fires. Remove the redundant guard (behavior-identical: the removed condition was always true) so the project-wide PHPStan gate is green again. Verified: php -l clean, `phpstan analyse` (level 5) reports no errors across the whole project.
|
Warning Review limit reached
More reviews will be available in 44 minutes and 35 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
phpstan analyse(level 5) over the whole project reported 2 errors inapp/Models/BookRepository.php:1208/1211:Cause
The
!isset($cols['traduttore'])/!isset($cols['illustratore'])guards are dead code: no earlier branch sets those keys in$cols, so the condition is always true. Unlike the sibling fields (ean,collana,data_pubblicazione) which an earlier branch can set,traduttore/illustratoreare assigned only there.Fix
Removed the redundant guard (behavior is identical — the removed condition was always true), so the project-wide PHPStan gate is green again.
Verification
php -lclean.phpstan analyselevel 5 over the whole project →[OK] No errors(was: 2 errors).Pre-existing on
main, independent of the other PRs. Surfaced by running full-project PHPStan.