Skip to content

Conversation

@jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented Dec 12, 2025

Composer: improve version constraints for Mockery

This commit improves the version constraints for the mockery/mockery package by only allowing the highest point release of outdated minors (which are still needed for older PHP versions) and only allowing a wider range of versions for the current minor.

Notes:

  • Mockery 1.3.* has a PHP 5.6 minimum with no upper bound
  • Mockery 1.4.* has a PHP 7.3 minimum and - as of 1.4.1 - allows for PHP >= 8.0.
  • Mockery 1.5.* has a PHP 7.3 minimum and allows for PHP >= 8.0.
  • Mockery 1.6.* has a PHP 7.4 minimum and allows for PHP >= 8.0, with 1.6.3 and 1.6.4 explicitly being marked as incompatible with PHP 8.3 or higher.
    v1.6.0 also explicitly marks support for PHP <= 8.0 as deprecated, while v1.6.5 brings back support for PHP 7.3.

If we then look at the Mockery changelog:

  • Mockery 1.3.6 contains an essential fix for compatibility with PHP 8.2.
  • That same fix + an additional 8.2 fix are included in Mockery 1.5.1, as well a feature support for PHP 8.1 intersection types.
  • Mockery 1.6.1 contains feature support for PHP 8.2 stand-alone null types, improved handling of PHP 8.1 intersection types and improved handling of dynamic properties (PHP 8.2 deprecation).
  • Mockery 1.6.2 contains feature support for PHP 8.0 stand-alone false type and PHP 8.2 stand-alone true type.
  • Mockery 1.6.3 adds support for mocking classes using PHP 8.1 "new in initializers".
  • Mockery 1.6.5 adds support for mocking classes using PHP 8.2 disjunctive normal form types.
  • Mockery 1.6.10 contains an essential fix for compatibility with PHP 8.4.

Ref: https://github.com/mockery/mockery/blob/1.6.x/CHANGELOG.md

GH Actions: improve test workflow

The builds against PHP 8.4, 8.5 and 8.6 were so far only run against the "highest" (stable) versions of dependencies due to running the tests with --prefer-lowest running into trouble.

With the analysis I did for improving the Mockery version constraints in the composer.json file as per the previous commit, I've identified Mockery 1.6.10 as the lowest viable version to run the tests with for PHP 8.4, 8.5 and 8.6.

This commit changes the workflow to allow a certain form of running against "lowest" dependencies for PHP 8.4, 8.5, 8.6, by explicitly setting the "low" version of Mockery to 1.6.10.

This commit improves the version constraints for the `mockery/mockery` package by only allowing the highest point release of outdated minors (which are still needed for older PHP versions) and only allowing a wider range of versions for the current minor.

Notes:
* Mockery 1.3.* has a PHP 5.6 minimum with no upper bound
* Mockery 1.4.* has a PHP 7.3 minimum and - as of 1.4.1 - allows for PHP >= 8.0.
* Mockery 1.5.* has a PHP 7.3 minimum and allows for PHP >= 8.0.
* Mockery 1.6.* has a PHP 7.4 minimum and allows for PHP >= 8.0, with 1.6.3 and 1.6.4 explicitly being marked as incompatible with PHP 8.3 or higher.
    v1.6.0 also explicitly marks support for PHP <= 8.0 as deprecated, while v1.6.5 brings back support for PHP 7.3.

If we then look at the Mockery changelog:
* Mockery `1.3.6` contains an essential fix for compatibility with PHP 8.2.
* That same fix + an additional 8.2 fix are included in Mockery `1.5.1`, as well a feature support for PHP 8.1 intersection types.
* Mockery `1.6.1` contains feature support for PHP 8.2 stand-alone `null` types, improved handling of PHP 8.1 intersection types and improved handling of dynamic properties (PHP 8.2 deprecation).
* Mockery `1.6.2` contains feature support for PHP 8.0 stand-alone `false` type and PHP 8.2 stand-alone `true` type.
* Mockery `1.6.3` adds support for mocking classes using PHP 8.1 "new in initializers".
* Mockery `1.6.5` adds support for mocking classes using PHP 8.2 disjunctive normal form types.
* Mockery `1.6.10` contains an essential fix for compatibility with PHP 8.4.

Ref: https://github.com/mockery/mockery/blob/1.6.x/CHANGELOG.md
The builds against PHP 8.4, 8.5 and 8.6 were so far only run against the "highest" (stable) versions of dependencies due to running the tests with `--prefer-lowest` running into trouble.

With the analysis I did for improving the Mockery version constraints in the `composer.json` file as per the previous commit, I've identified Mockery `1.6.10` as the lowest viable version to run the tests with for PHP 8.4, 8.5 and 8.6.

This commit changes the workflow to allow a certain form of running against "lowest" dependencies for PHP 8.4, 8.5, 8.6, by explicitly setting the "low" version of Mockery to `1.6.10`.
@jrfnl jrfnl added this to the 2.7.0 milestone Dec 12, 2025
@jrfnl jrfnl requested a review from gmazzap December 12, 2025 20:30
@jrfnl jrfnl added the github_actions Pull requests that update GitHub Actions code label Dec 12, 2025
@gmazzap gmazzap merged commit 16a3def into master Dec 13, 2025
66 checks passed
@gmazzap gmazzap deleted the feature/improve-mockery-version-constraints-and-run-lowest-ci branch December 13, 2025 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants