Skip to content

fix(books): drop dead guard on scraped traduttore/illustratore (PHPStan L5 green)#200

Open
fabiodalez-dev wants to merge 1 commit into
mainfrom
fix/phpstan-bookrepo-isset
Open

fix(books): drop dead guard on scraped traduttore/illustratore (PHPStan L5 green)#200
fabiodalez-dev wants to merge 1 commit into
mainfrom
fix/phpstan-bookrepo-isset

Conversation

@fabiodalez-dev

@fabiodalez-dev fabiodalez-dev commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Problem

phpstan analyse (level 5) over the whole project reported 2 errors in app/Models/BookRepository.php:1208/1211:

isset.offset / impossibleType — array_key_exists('traduttore'|'illustratore', $cols) will always evaluate to false

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/illustratore are 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 -l clean.
  • phpstan analyse level 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.

…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.
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@fabiodalez-dev, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0e31a106-6306-49d6-b33e-2d07c583aecb

📥 Commits

Reviewing files that changed from the base of the PR and between eab030e and 31122b7.

📒 Files selected for processing (1)
  • app/Models/BookRepository.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/phpstan-bookrepo-isset

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@fabiodalez-dev fabiodalez-dev changed the title fix(books): rimuovi guard morto su traduttore/illustratore scrapati (PHPStan L5 verde) fix(books): drop dead guard on scraped traduttore/illustratore (PHPStan L5 green) Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant