Skip to content

Fixed PHP and Symfony support across full version range#18

Merged
mSprunskas merged 35 commits intopaysera:masterfrom
mSprunskas:DEPENDENCY-FIX
Oct 24, 2025
Merged

Fixed PHP and Symfony support across full version range#18
mSprunskas merged 35 commits intopaysera:masterfrom
mSprunskas:DEPENDENCY-FIX

Conversation

@mSprunskas
Copy link
Contributor

@mSprunskas mSprunskas commented Oct 16, 2025

  • Removed support for PHP 7.2 version
  • Fixed CI by adding ignored PHP and Symfony version matrix
  • Fixed Monolog library support in all PHP and Symfony version ranges

Marius Sprunskas and others added 27 commits October 16, 2025 13:10
The previous fix used method_exists(Utils::class, 'jsonEncode') to detect
Monolog 2.x, but this method exists in both Monolog 1.x and 2.x.

Changed to use Logger::API constant which correctly identifies:
- Monolog 1.x: API = 1
- Monolog 2.x: API = 2
- Monolog 3.x: API = 3

This ensures the correct depth threshold is used for each version:
- Monolog 1.x: depth <= 3 for expansion
- Monolog 2.x+: depth <= 2 for expansion
Symfony 6.* requires PHP >= 8.1, so exclude:
- PHP 7.4 + Symfony 6.*
- PHP 8.0 + Symfony 6.*

This prevents CI failures due to dependency resolution errors.
This script allows developers to test different Symfony versions and
dependency levels locally before pushing to CI, matching the CI
environment configuration.
Changes:
- Added Symfony 7.* to test matrix (as it's supported in composer.json)
- Added exclusions for Symfony 7.* with PHP < 8.2
- Complete coverage: 19 valid combinations × 2 dependency levels = 38 CI jobs
- Prevents 10 invalid combination failures

Valid combinations now tested:
- PHP 7.4-8.0: Symfony 4.*, 5.*
- PHP 8.1: Symfony 4.*, 5.*, 6.*
- PHP 8.2-8.4: Symfony 4.*, 5.*, 6.*, 7.*
Add composer/package-versions-deprecated to allow-plugins to fix
OutOfBoundsException from jean85/pretty-package-versions when running
tests with --prefer-lowest dependencies.

The plugin needs to be explicitly allowed in Composer 2+ to generate
the package versions file that jean85/pretty-package-versions requires.

Tested with PHP 8.0 + Symfony 4.* + lowest dependencies using Docker.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add composer/package-versions-deprecated to allow-plugins to fix
OutOfBoundsException from jean85/pretty-package-versions when running
tests with --prefer-lowest dependencies.

The plugin needs to be explicitly allowed in Composer 2+ to generate
the package versions file that jean85/pretty-package-versions requires.

Tested with PHP 8.0 + Symfony 4.* + lowest dependencies using Docker.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…PHP version

The trait was incorrectly checking PHP_VERSION_ID >= 80000 to decide
whether to use 'mixed' type hints in the normalize() method. This caused
fatal errors on PHP 8.0 with Symfony 4.* (which uses Monolog v1).

The correct approach is to check for Monolog version using
class_exists('Monolog\LogRecord'):
- Monolog v3+ has LogRecord class and requires mixed type hints
- Monolog v1/v2 don't have LogRecord class and use no type hints

This ensures proper compatibility:
- PHP 7.4-8.x with Monolog v1/v2: no type hints
- PHP 8.1+ with Monolog v3: mixed type hints

Also adds Docker-based testing infrastructure (Dockerfile.test, .dockerignore)
to enable local testing across different PHP and Symfony versions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Marius Sprunskas added 2 commits October 20, 2025 10:44
Marius Sprunskas added 2 commits October 20, 2025 10:57
@mSprunskas mSprunskas changed the title Fix Fixed PHP and Symfony support across full version range Oct 20, 2025
@mSprunskas mSprunskas merged commit c8cc741 into paysera:master Oct 24, 2025
38 checks passed
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