Skip to content

Drop PHP 8.2 and migrate to Image v4 API#2438

Open
ArnaudLigny wants to merge 5 commits into
masterfrom
php-8.3
Open

Drop PHP 8.2 and migrate to Image v4 API#2438
ArnaudLigny wants to merge 5 commits into
masterfrom
php-8.3

Conversation

@ArnaudLigny

Copy link
Copy Markdown
Member

This pull request updates the minimum supported PHP version to 8.3, upgrades several dependencies, and refactors the image processing code to support intervention/image v4. The changes modernize the codebase, improve compatibility, and leverage new APIs from updated libraries.

Dependency and Platform Updates:

  • Updated the minimum required PHP version to 8.3 in composer.json, GitHub Actions workflows, and environment configuration. PHP 8.2 support is dropped. (composer.json, .github/workflows/continuous-integration.yml, .github/workflows/release.yml) [1] [2] [3] [4] [5]
  • Upgraded intervention/image to ^4.0 and phpunit/phpunit to ^12.5. Also updated jolicode/jolinotif to ^3.3. (composer.json) [1] [2]

Image Processing Refactor (for intervention/image v4):

  • Refactored src/Asset/Image.php to use the new API from intervention/image v4:
    • Replaced deprecated methods (e.g., read, encodeByMediaType) with new equivalents (decodeBinary, encodeUsingFormat, etc.).
    • Updated image manipulation logic to use new method signatures and classes (e.g., Alignment::CENTER, Format::create, insert instead of place, etc.).
    • Adjusted type hints and interface usage for the image manager. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

Continuous Integration Adjustments:

  • Updated CI matrix and job conditions to use PHP 8.3 as the baseline for coverage, profiling, and build jobs. [1] [2]

These updates ensure the project is ready for PHP 8.3+ and takes advantage of the latest features and improvements in its dependencies.

Raises the project baseline to PHP 8.3 across Composer and GitHub workflows, including CI/release matrix updates and PHAR build gating. Also updates image handling code to Intervention Image 4 APIs (manager creation, decoding, alignment, format encoding, and color access methods) to stay compatible with the dependency upgrade.
Copilot AI review requested due to automatic review settings July 11, 2026 19:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR raises Cecil’s minimum PHP version to 8.3, upgrades key dependencies (notably intervention/image to v4 and PHPUnit to v12), and refactors the image-processing adapter to the new Intervention Image v4 API.

Changes:

  • Bumped platform/dependency constraints to PHP 8.3+ and updated lockfiles accordingly.
  • Migrated src/Asset/Image.php to Intervention Image v4 APIs (decode/encode, alignment, insertion).
  • Updated GitHub Actions workflows to target PHP 8.3 for release and key CI jobs.

Reviewed changes

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

Show a summary per file
File Description
composer.json Raises PHP requirement to 8.3+ and bumps key deps (intervention/image v4, PHPUnit v12, JoliNotif).
composer.lock Updates locked dependency graph to match new platform/dependency constraints.
tests/fixtures/website/composer.lock Updates fixture website lockfile (theme-hyde version bump).
src/Asset/Image.php Refactors image handling to the Intervention Image v4 API (decode/encode/alignment/etc.).
.github/workflows/release.yml Updates release workflow PHP version to 8.3.
.github/workflows/continuous-integration.yml Adjusts CI conditions for PHP 8.3 baseline (but currently still includes 8.2 in the matrix).

Comment thread src/Asset/Image.php Outdated
Comment thread src/Asset/Image.php Outdated
Comment thread src/Asset/Image.php
Comment thread .github/workflows/continuous-integration.yml
Updates the project’s PHP minimum version from 8.2 to 8.3 across CI providers, quality tooling config, build scripts, and documentation. The GitHub Actions matrix also drops PHP 8.2 so testing aligns with the new supported baseline.
Use the asset file extension when creating the image encoder format, with a fallback to a normalized MIME subtype. This avoids passing raw subtypes like `image/...` into `Format::create()` and keeps resize, thumbnail, and data URI encoding consistent.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 15 changed files in this pull request and generated 5 comments.

Comment thread src/Asset/Image.php
Comment thread src/Asset/Image.php
Comment thread src/Asset/Image.php
Comment thread src/Asset/Image.php
Comment thread .circleci/config.yml Outdated
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.

3 participants