Skip to content

Fix CI: regenerate stale PHPStan baseline and code-quality drift - #240

Merged
LukeTowers merged 1 commit into
wip/1.3from
ci/fix-wip-1.3
Aug 11, 2026
Merged

Fix CI: regenerate stale PHPStan baseline and code-quality drift#240
LukeTowers merged 1 commit into
wip/1.3from
ci/fix-wip-1.3

Conversation

@LukeTowers

Copy link
Copy Markdown
Member

What this fixes

CI on wip/1.3 had 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:

  • Stale function.alreadyNarrowedType ignore patterns (src/Auth/Models/User.php) that no longer occur.
  • ignore.unmatched for patterns in src/Auth/Models/User.php and src/Database/Relations/HasOneThrough.php.
  • New argument.type builder-covariance findings (src/Database/Concerns/HasRelationships.php) surfaced by the current Illuminate version.
  • Two non-baselineable ignore.unmatchedLine errors in src/Filesystem/FilesystemServiceProvider.php.

Fix: regenerated the baseline with composer baseline. phpstan analyse --memory-limit=2G now reports [OK] No errors.

2. Stale inline ignores in FilesystemServiceProvider

The two @phpstan-ignore-next-line comments guarding $this->prefixer no 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.php had a blank line before the class closing brace, failing composer sniff. Removed it. (Note: CI's phpcs-pr only diffs changed files so this didn't block the PR check, but composer sniff now passes cleanly.)

Local verification (PHP 8.4.23)

  • phpstan analyse — No errors
  • composer sniff (PHPCS) — clean, exit 0
  • php -l across all src/ + tests/ — no syntax errors (parallel-lint equivalent)
  • ✅ PHPUnit — 839/839 non-SQLite-grammar tests pass

⚠️ Not fixed here — needs maintainer action

A) The Tests job has 2 pre-existing failures owned by #239.
tests/Database/Schema/Grammars/SQLiteSchemaGrammarTest:

  • testNullableInitialModifierAddDefault
  • testTypeTinyintTypeIsValid

These fail on current wip/1.3 and 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.php entries 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 install with Failed 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/invalid COMPOSER_GITHUB_TOKEN repo secret. This needs the token rotated in repo settings; it blocks the Tests and Code Analysis jobs regardless of code changes. (The dms/phpunit-arraysubset-asserts:dev-add-phpunit-11-support fork 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

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

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a2206b4d-bcd2-4b3e-ab6d-19426a688e71

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@LukeTowers
LukeTowers merged commit a69604a into wip/1.3 Aug 11, 2026
10 of 18 checks passed
@LukeTowers
LukeTowers deleted the ci/fix-wip-1.3 branch August 11, 2026 16:16
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