Skip to content

Updates for php8.1+#164

Open
stephenreay wants to merge 2 commits intopdffiller:masterfrom
Koalephant:Updates-PHP8x
Open

Updates for php8.1+#164
stephenreay wants to merge 2 commits intopdffiller:masterfrom
Koalephant:Updates-PHP8x

Conversation

@stephenreay
Copy link
Contributor

@stephenreay stephenreay commented Feb 25, 2026

Hello!

  • Type: code quality
  • Link to issue:

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the Contributing Guidelines?
  • I have checked that another pull request for this purpose does not exist.
  • I wrote some tests for this PR.

Small description of change:

Adding return types/attributes to suppress class hierarchy messages on PHP8.1+

Thanks

Summary by CodeRabbit

  • Chores
    • Enhanced code quality and type safety through explicit return type declarations in core internal components.

@stephenreay stephenreay requested a review from a team as a code owner February 25, 2026 09:23
@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4e59b8e and 557c2a5.

📒 Files selected for processing (5)
  • src/Jobs/BaseJob.php
  • src/Jobs/Collection.php
  • src/Jobs/JobData.php
  • src/Queues/Collection.php
  • src/Workers/Collection.php

Walkthrough

The changes add explicit return type hints to ArrayAccess interface methods across five collection and job-related classes, and introduce a jsonSerialize() return type declaration. No functional logic or control flow is modified.

Changes

Cohort / File(s) Summary
Jobs ArrayAccess Implementations
src/Jobs/BaseJob.php, src/Jobs/Collection.php
Added explicit return types to offsetExists (bool), offsetSet (void), and offsetUnset (void). Added #[\ReturnTypeWillChange] attribute to offsetGet to signal forthcoming return type changes.
Jobs Serialization
src/Jobs/JobData.php
Added explicit array return type to jsonSerialize() method. Updated docblock references.
Queues and Workers Collections
src/Queues/Collection.php, src/Workers/Collection.php
Added explicit return types to ArrayAccess methods: offsetExists returns bool, offsetGet returns Queue (Queues) or array (Workers), offsetSet and offsetUnset return void.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 78.95% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Updates for php8.1+' is vague and does not clearly convey the specific changes made. It lacks detail about what type of updates were implemented and which files or functionality were affected. Consider a more descriptive title such as 'Add return type hints and attributes to ArrayAccess methods for PHP 8.1+ compatibility' to better communicate the specific nature of the changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@Snyk-Agent
Copy link

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

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