Skip to content

test: add PHP 8.5 swagger compatibility matrix - #17

Closed
ussaaass wants to merge 1 commit into
hyperf:masterfrom
ussaaass:compat/php85-swagger6
Closed

ussaaass wants to merge 1 commit into
hyperf:masterfrom
ussaaass:compat/php85-swagger6

Conversation

@ussaaass

Copy link
Copy Markdown

Summary

This PR adds a PHP compatibility matrix for Hyperf Swagger and prepares the package for newer swagger-php versions.

PHP 8.5 currently reports deprecation warnings from swagger-php 4.x because it uses deprecated SplObjectStorage::contains() and SplObjectStorage::attach() methods.

Changes

  • Add CI coverage for:
    • PHP 8.2, 8.4, and 8.5
    • swagger-php 4.x and 6.x
  • Add a dedicated Composer configuration for the swagger-php 6.x test path.
  • Update processor pipeline handling for the swagger-php 6.x API.
  • Make the custom Property attribute compatible with both 4.x and 6.x constructor signatures.
  • Add optional YAML generation through swagger.yaml_dir.
  • Add a minimal integration test covering:
    • Listener registration
    • Controller scanning
    • JSON generation
    • YAML generation
  • Add a README documenting installation, configuration, annotations, validation, and generation commands.
  • Replace PHPUnit doc-comment metadata with PHPUnit attributes.

Verification

The test suite passes on PHP 8.5 with:

  • swagger-php 4.11.1: 4 tests, 10 assertions
  • swagger-php 6.11.0: 4 tests, 10 assertions

The swagger-php 4.x path still reports the known PHP 8.5 deprecations from its internal Analysis implementation. The swagger-php 6.x path passes without those deprecations.

The PHP 8.2 and PHP 8.4 variants are covered by the GitHub Actions matrix.

@github-actions

Copy link
Copy Markdown

Hi, this is a READ-ONLY repository, please submit your PR on the https://github.com/hyperf/hyperf repository.

This Pull Request will close automatically.

Thanks!

@github-actions github-actions Bot closed this Sep 27, 2026
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