Fix CI: regenerate stale PHPStan baseline and code-quality drift - #240
Merged
Conversation
The phpstan-baseline.neon on wip/1.3 had drifted against the PHP 8.4 / PHPStan 2.2.8 / Laravel 12 versions CI actually resolves, producing 16 findings (stale ignore patterns, unmatched inline ignores, and new Illuminate builder covariance warnings). Regenerated the baseline with `composer baseline` so `phpstan analyse` is green again. Removed two stale `@phpstan-ignore-next-line` comments in FilesystemServiceProvider that no longer match any reported error under the current Laravel version (they were themselves reported as non-baselineable ignore.unmatchedLine errors). Fixed a pre-existing PHPCS violation (blank line before class closing brace) in LessCompilerTest so `composer sniff` passes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
CI on
wip/1.3had drifted in two static-analysis dimensions. This PR restores the Code Analysis (PHPStan) and Code Quality (PHPCS) signals to green.1. Stale
phpstan-baseline.neon(Code Analysis job — PHP 8.4 / PHPStan 2.2.8)Reproduced locally against the exact versions CI resolves (PHP 8.4.23, phpstan/phpstan 2.2.8, laravel/framework 12.65). The committed baseline produced 16 errors:
function.alreadyNarrowedTypeignore patterns (src/Auth/Models/User.php) that no longer occur.ignore.unmatchedfor patterns insrc/Auth/Models/User.phpandsrc/Database/Relations/HasOneThrough.php.argument.typebuilder-covariance findings (src/Database/Concerns/HasRelationships.php) surfaced by the current Illuminate version.ignore.unmatchedLineerrors insrc/Filesystem/FilesystemServiceProvider.php.Fix: regenerated the baseline with
composer baseline.phpstan analyse --memory-limit=2Gnow reports[OK] No errors.2. Stale inline ignores in
FilesystemServiceProviderThe two
@phpstan-ignore-next-linecomments guarding$this->prefixerno longer match any reported error under the current Laravel version, so PHPStan itself reported them as errors (they can't be baselined). Removed them.3. Pre-existing PHPCS violation
tests/Parse/Assetic/LessCompilerTest.phphad a blank line before the class closing brace, failingcomposer sniff. Removed it. (Note: CI'sphpcs-pronly diffs changed files so this didn't block the PR check, butcomposer sniffnow passes cleanly.)Local verification (PHP 8.4.23)
phpstan analyse— No errorscomposer sniff(PHPCS) — clean, exit 0php -lacross allsrc/+tests/— no syntax errors (parallel-lint equivalent)A) The Tests job has 2 pre-existing failures owned by #239.
tests/Database/Schema/Grammars/SQLiteSchemaGrammarTest:testNullableInitialModifierAddDefaulttestTypeTinyintTypeIsValidThese fail on current
wip/1.3and are exactly the SQLite->change()rebuild bug that PR #239 fixes. Those tests and their source live entirely in #239's files, so this PR intentionally does not touch them. The Tests job cannot go fully green until #239 merges.B) Baseline overlap with #239 — sequencing note.
The regenerated baseline still contains the 6
src/Database/Schema/Grammars/SQLiteGrammar.phpentries that #239 removes (its baseline diff is+0/-36). This is the expected overlap. Recommended merge order: this PR first, then #239 (which will drop those now-obsolete entries as part of its grammar fix). Merging #239 first will leave 6 unmatched-baseline errors until this PR's regeneration is reconciled.C) Composer install auth failure (infra — not fixable in code).
Every recent CI run on this repo (including #239's) fails
composer installwithFailed to download winter/laravel-config-writer from dist: Could not authenticate against github.com/ "Source fallback is disabled". Dependency resolution succeeds; only the authenticated dist download fails — the classic symptom of an expired/invalidCOMPOSER_GITHUB_TOKENrepo secret. This needs the token rotated in repo settings; it blocks the Tests and Code Analysis jobs regardless of code changes. (Thedms/phpunit-arraysubset-asserts:dev-add-phpunit-11-supportfork VCS repo is still genuinely required — upstream has no PHPUnit 11 release — so it can't be dropped to sidestep the auth path.)🤖 Generated with Claude Code