Skip to content

fix: remove dead statement referencing undefined variables in MediaRepository#485

Merged
turegjorup merged 2 commits into
release/3.0.0from
feature/fix-media-repository-undefined-vars
Jun 9, 2026
Merged

fix: remove dead statement referencing undefined variables in MediaRepository#485
turegjorup merged 2 commits into
release/3.0.0from
feature/fix-media-repository-undefined-vars

Conversation

@turegjorup

Copy link
Copy Markdown
Contributor

Summary

Removes a dead statement in MediaRepository::getPaginator() found while reviewing the PHPStan baseline (variable.undefined × 2):

$firstResult = ($page - 1) * $itemsPerPage;

$page and $itemsPerPage are undefined in that scope and $firstResult is never used — the statement only emits PHP warnings if executed.

Note: MediaRepository::getPaginator() itself appears to have no callers in src/ or tests/; this PR sticks to the minimal fix, but the whole method may be a candidate for removal in a follow-up.

Files Changed

  • src/Repository/MediaRepository.php — dead statement removed
  • phpstan-baseline.neon — regenerated via task phpstan:generate-baseline; drops the two stale variable.undefined entries
  • CHANGELOG.md — entry under [Unreleased]

Test Plan

  • task test:api -- --filter MediaTest — OK (5 tests, 16 assertions)
  • task code-analysis — no errors

🤖 Generated with Claude Code

…pository

MediaRepository::getPaginator() computed $firstResult from the undefined
variables $page and $itemsPerPage and never used the result. Remove the
statement and drop the two corresponding variable.undefined entries from
the PHPStan baseline.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@turegjorup
turegjorup requested a review from tuj June 9, 2026 07:57
@turegjorup turegjorup self-assigned this Jun 9, 2026
…media-repository-undefined-vars

# Conflicts:
#	CHANGELOG.md
@turegjorup
turegjorup merged commit 770df91 into release/3.0.0 Jun 9, 2026
@turegjorup
turegjorup deleted the feature/fix-media-repository-undefined-vars branch June 9, 2026 14:21
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.

2 participants