Skip to content

Fix PHPStan 2.3 varTag error; group Dependabot Actions bumps - #1042

Merged
JohnRDOrazio merged 1 commit into
developmentfrom
ccr-f7ec0a8e-0zhtoq
Oct 24, 2026
Merged

JohnRDOrazio merged 1 commit into
developmentfrom
ccr-f7ec0a8e-0zhtoq

Conversation

@JohnRDOrazio

@JohnRDOrazio JohnRDOrazio commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Pull Request

Description

This PR clears what stopped three Dependabot PRs from auto-merging.

PHPStan 2.3.1 error (blocks #1037). PHPStan 2.3.1 reports varTag.nativeType at src/Models/Calendar/LiturgicalEvent.php:146. The @var LitMassVariousNeeds[] cast there is wrong. The constructor's coherence check compared gettype(), which reports every enum case as 'object', so a LitCommon mixed into a LitMassVariousNeeds array passed the check and was stored as-is.

  • The check now compares get_debug_type(), the class names, so a mixed array throws InvalidArgumentException.
  • The cast is replaced with an instanceof filter that PHPStan can follow. It keeps every element of an array that passed the check.

Auto-merge turned off on #1038 and #1039. Both edit .github/workflows/main.yml, as #1036 did. Once #1036 merged, merging either one meant writing a combined workflow file. The GITHUB_TOKEN used by auto-merge can't have the workflows permission, so GitHub turned their auto-merge off (auto_merge_disabled in the timelines, shortly after their checks passed). dependabot.yml now groups minor and patch github-actions bumps into one PR; major bumps still get one PR each.

After this merges, ·@·d·ependabot r·ebase on #1037 lets its still-enabled auto-merge complete. #1038 and #1039 need a manual merge, or a rebase one at a time.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • PHPStan level 10 with 2.3.1: the error reproduces without the change, No errors with it.
  • PHPStan level 10 with the locked 2.2.16: No errors.
  • phpcs and parallel-lint on the changed PHP files: clean.
  • PHPUnit, including the new phpunit_tests/Models/Calendar/LiturgicalEventConstructorCommonTest.php (an array of only LitMassVariousNeeds is kept as given; a mixed array is rejected). Not run locally: the environment had PHP 8.3, which can't parse the project's 8.4 syntax. CI will be the first run.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Liturgical event construction now handles arrays of Masses for Various Needs consistently and rejects arrays that mix incompatible common types.
  • Chores

    • Minor and patch dependency updates are now grouped into a single automated pull request; major updates remain separate.

PHPStan 2.3.1 (Dependabot #1037) rejects the `@var LitMassVariousNeeds[]`
cast in LiturgicalEvent's constructor: it infers the array may still hold
LitCommon. It was right. The coherence check compared gettype(), which
calls every enum case 'object', so a LitCommon mixed into a
LitMassVariousNeeds array passed. Compare get_debug_type() instead, and
replace the cast with an instanceof filter the type checker can follow.

Group minor and patch github-actions bumps into one Dependabot PR. When
several PRs edit the same workflow file, merging the first leaves the
rest needing a combined workflow file that the auto-merge GITHUB_TOKEN
may not write, so GitHub disables their auto-merge (#1038, #1039).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fi2M7bQg1ZV2rDt9jwwfyW
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 0eae252 and 78143dc.

Files selected for processing: 3
  • .github/dependabot.yml
  • phpunit_tests/Models/Calendar/LiturgicalEventConstructorCommonTest.php
  • src/Models/Calendar/LiturgicalEvent.php

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

The constructor now distinguishes types in common arrays and filters LitMassVariousNeeds cases before assignment. Tests cover preservation and rejection of mixed cases. Dependabot groups minor and patch GitHub Actions updates.

Changes: Liturgical event common validation

Layer / File(s) Summary
Common array handling
src/Models/Calendar/LiturgicalEvent.php, phpunit_tests/Models/Calendar/LiturgicalEventConstructorCommonTest.php
The constructor uses get_debug_type() to identify mixed array element types. It filters LitMassVariousNeeds cases and reindexes the result. Tests check preservation of those cases and rejection of arrays mixed with LitCommon.

Dependabot update grouping

Layer / File(s) Summary
GitHub Actions update group
.github/dependabot.yml
Dependabot groups minor and patch GitHub Actions updates. Major updates remain separate.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to 78143

The constructor change and Dependabot grouping have no identified merge-blocking issue; proceed with normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names two changes: a PHPStan 2.3 varTag error fix in LiturgicalEvent, and grouping of Dependabot GitHub Actions bumps. Both appear in the changeset: the constructor type check moved to get_d…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names two changes: a PHPStan 2.3 varTag error fix in LiturgicalEvent, and grouping of Dependabot GitHub Actions bumps. Both appear in the changeset: the constructor type check moved to get_debug_type() with an instanceof filter, and dependabot.yml now groups minor and patch updates. The title is specific and short, and it mentions the two main changes. It does not mention the new PHPUnit test class, which is a minor part of the change set.

Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@codecov

codecov Bot commented Oct 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@JohnRDOrazio
JohnRDOrazio merged commit c45f396 into development Oct 24, 2026
16 checks passed
@JohnRDOrazio
JohnRDOrazio deleted the ccr-f7ec0a8e-0zhtoq branch October 24, 2026 20:02
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