Skip to content

Make 8.5 the main PHP version#249

Closed
W0rma wants to merge 2 commits intoUnleash:mainfrom
W0rma:php85
Closed

Make 8.5 the main PHP version#249
W0rma wants to merge 2 commits intoUnleash:mainfrom
W0rma:php85

Conversation

@W0rma
Copy link
Copy Markdown
Contributor

@W0rma W0rma commented Dec 27, 2025

Description

  • Changes the default, dev version to PHP 8.5, adds transpilation to PHP 8.4.
  • Fixes deprecated setAccessible() calls which are noop since PHP 8.1.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 20537035017

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 20365687605: 0.0%
Covered Lines: 1586
Relevant Lines: 1586

💛 - Coveralls

@W0rma W0rma marked this pull request as ready for review December 27, 2025 09:10
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request attempts to upgrade the project's main PHP version from 8.4 to 8.5 and adds transpilation support to PHP 8.4. However, there is a critical issue: PHP 8.5 does not exist yet. As of January 2026, PHP 8.4 is the latest stable version (released November 2024). The PR also updates test code to conditionally call setAccessible() on reflection properties only for PHP versions before 8.1, since this method became a no-op in PHP 8.1.

Key Changes:

  • Updates PHP requirement from ^8.4 to ^8.5 across configuration files
  • Adds conditional checks for setAccessible() calls in test files (only called for PHP < 8.1)
  • Adds new rector.84.php configuration for transpiling to PHP 8.4

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
composer.json Updates PHP requirement to ^8.5 (version does not exist)
rector.php Adds SetList::PHP_85 to configuration (constant may not exist)
rector.84.php New file adding PHP 8.4 downgrade configuration (constant may not exist)
tests/UnleashBuilderTest.php Adds PHP_VERSION_ID checks before setAccessible() calls throughout test methods
tests/Helper/NetworkCalculatorTest.php Adds PHP_VERSION_ID checks before setAccessible() calls in helper methods
.github/workflows/transpile.yaml Updates PHP version to 8.5 and adds 8.4 to transpilation matrix
.github/workflows/tests.yaml Updates PHP version references to 8.5 and adds 8.4 to test matrix
.github/workflows/tests-8.x.yaml Adds 8.4 to the PHP version test matrix
.github/workflows/release.yaml Updates PHP version to 8.5, changes release tags to v${VERSION}85, adds 8.4 to matrix
.github/workflows/code-coverage.yml Updates PHP version to 8.5

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

run: composer require symfony/polyfill-php73:^1.0
- name: Update composer.json version
run: 'sed -i -e ''s/"php": "\^8.4"/"php": "\^${{ matrix.version }}"/'' composer.json'
run: 'sed -i -e ''s/"php": "\^8.5"/"php": "\^${{ matrix.version }}"/'' composer.json'
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sed pattern replacement expects the composer.json to contain "php": "^8.5", but since PHP 8.5 doesn't exist, this will cause issues. The pattern should match the actual PHP version in composer.json.

Copilot uses AI. Check for mistakes.
run: composer require symfony/polyfill-php73:^1.0
- name: Update composer.json version
run: 'sed -i -e ''s/"php": "\^8.4"/"php": "\^${{ matrix.version }}"/'' composer.json'
run: 'sed -i -e ''s/"php": "\^8.5"/"php": "\^${{ matrix.version }}"/'' composer.json'
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sed pattern replacement expects the composer.json to contain "php": "^8.5", but since PHP 8.5 doesn't exist, this will cause issues. The pattern should match the actual PHP version in composer.json.

Copilot uses AI. Check for mistakes.
run: composer require symfony/polyfill-php73:^1.0
- name: Update composer.json version
run: 'sed -i -e ''s/"php": "\^8.4"/"php": "\^${{ matrix.version }}"/'' composer.json'
run: 'sed -i -e ''s/"php": "\^8.5"/"php": "\^${{ matrix.version }}"/'' composer.json'
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sed pattern replacement expects the composer.json to contain "php": "^8.5", but since PHP 8.5 doesn't exist, this will cause issues. The pattern should match the actual PHP version in composer.json.

Suggested change
run: 'sed -i -e ''s/"php": "\^8.5"/"php": "\^${{ matrix.version }}"/'' composer.json'
run: 'sed -i -e ''s/"php": "[^"]*"/"php": "\^${{ matrix.version }}"/'' composer.json'

Copilot uses AI. Check for mistakes.
Comment on lines +93 to +95
if (PHP_VERSION_ID < 80100) {
$strategiesProperty->setAccessible(true);
}
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A helper method 'getProperty' already exists at line 1139 that encapsulates the PHP_VERSION_ID check for setAccessible. Consider refactoring the repeated inline version checks throughout this file to use this existing helper method instead, which would reduce code duplication and improve maintainability.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

@RikudouSage RikudouSage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I didn't check whether all setAccessible() calls are updated, I'm gonna assume they are.

@github-project-automation github-project-automation Bot moved this from New to Approved PRs in Issues and PRs Jan 6, 2026
@W0rma
Copy link
Copy Markdown
Contributor Author

W0rma commented Jan 8, 2026

I didn't check whether all setAccessible() calls are updated, I'm gonna assume they are.

@RikudouSage Yes, I added a PHP version check to all of them.

@stale
Copy link
Copy Markdown

stale Bot commented Feb 7, 2026

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label Feb 7, 2026
@stale stale Bot closed this Feb 18, 2026
@github-project-automation github-project-automation Bot moved this from Approved PRs to Done in Issues and PRs Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants