refactor: Require php 8.4 and upgrade pest - #21
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The migration is internally consistent, and the complete test, mutation, formatting, PHPStan, and type-coverage matrix passes.
Pull request overview
Raises the project baseline to PHP 8.4 and modernizes testing and analysis for Pest 5.
Changes:
- Updates PHP requirements, dependencies, CI, and documentation.
- Migrates Pest configuration and validation assertions to typed helpers.
- Applies PHP 8.4/Pest formatting and expands PHPStan analysis to tests.
File summaries
| File | Description |
|---|---|
composer.json |
Updates PHP and Pest dependencies and parallel testing. |
.github/workflows/run-tests.yml |
Tests PHP 8.4/8.5 across platforms and stability levels. |
.github/actions/setup-php-composer/action.yml |
Defaults setup to PHP 8.4. |
README.md |
Documents PHP 8.4 requirement. |
docs/openapi/introduction.mdx |
Updates documented PHP baseline. |
docs/openapi/installation.mdx |
Updates installation requirements. |
phpstan.dist.neon |
Enables Pest integration and test analysis. |
rector.php |
Targets PHP 8.4 and Pest style. |
ecs.php |
Enables PHP 8.4 migration rules. |
tests/Pest.php |
Uses the Pest 5 bootstrap API. |
tests/Expectations.php |
Replaces custom expectations with typed helpers. |
tests/phpstan/pest-expectations.stub |
Removes the obsolete expectation stub. |
src/OpenApi.php |
Applies PHP 8.4 constructor dereferencing. |
src/Concerns/BuildsArray.php |
Adds targeted PHPStan suppressions. |
tests/Unit/IntegrationTest.php |
Adds typed array narrowing and chained assertions. |
tests/Unit/OpenApiTest.php |
Modernizes assertions for Pest 5 analysis. |
tests/Unit/Concerns/BuildsArrayTest.php |
Adopts PHP 8.4 syntax and chained assertions. |
tests/Unit/Concerns/HasExtensionsTest.php |
Adopts PHP 8.4 syntax and removes redundant documentation. |
tests/Unit/Objects/ComponentsTest.php |
Modernizes empty-array assertion. |
tests/Unit/Objects/ExampleTest.php |
Modernizes empty-array assertions. |
tests/Unit/Objects/ExternalDocsTest.php |
Chains related assertions. |
tests/Unit/Objects/HeaderTest.php |
Modernizes empty-array assertion. |
tests/Unit/Objects/LinkTest.php |
Uses typed key-position helpers and chains assertions. |
tests/Unit/Objects/MediaTypeTest.php |
Uses typed key-position helpers and chains assertions. |
tests/Unit/Objects/OAuthFlowsTest.php |
Modernizes empty-array assertion. |
tests/Unit/Objects/OperationTest.php |
Chains method and callback assertions. |
tests/Unit/Objects/PathItemTest.php |
Narrows list values to arrays. |
tests/Unit/Objects/ReferenceTest.php |
Consolidates component shortcut assertions. |
tests/Unit/Objects/RequestBodyTest.php |
Narrows response content to an array. |
tests/Unit/Objects/ResponseTest.php |
Modernizes and narrows response assertions. |
tests/Unit/Objects/SecurityRequirementTest.php |
Modernizes empty-array assertion. |
tests/Unit/Objects/XmlTest.php |
Modernizes empty-array assertion. |
tests/Unit/Validation/ComponentsTest.php |
Uses typed validation helper. |
tests/Unit/Validation/DocumentTest.php |
Uses typed validation helpers. |
tests/Unit/Validation/ExampleTest.php |
Uses typed validation helper. |
tests/Unit/Validation/LicenseTest.php |
Uses typed validation helper. |
tests/Unit/Validation/ParameterTest.php |
Uses typed validation helpers. |
tests/Unit/Validation/PathsTest.php |
Uses typed validation helper. |
tests/Unit/Validation/RequestBodyTest.php |
Uses typed validation helpers. |
tests/Unit/Validation/ResponseTest.php |
Uses typed validation helpers. |
tests/Unit/Validation/SecuritySchemeTest.php |
Uses typed validation helpers. |
tests/Unit/Validation/ValidationExceptionTest.php |
Uses PHPUnit failure assertions and array narrowing. |
Review details
- Files reviewed: 42/42 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request requires PHP 8.4+, upgrades the test toolchain to Pest 5, and aligns CI, static analysis, and docs with that baseline.
PHP version and dependencies:
composer.json, README, docs, and CI. PHP 8.3 is no longer tested or supported.phpstan,rector,type-coverage).pestphp/pest-plugin-mutateto^5.0.1so prefer-lowest CI cannot install 5.0.0, which crashes mutation testing against PHPUnit's--coverage-phparray dump.Tooling:
testsviapest-plugin-phpstaninstead of a custom expectation stub.composer testruns Pest in parallel.fail-fast: false.Tests:
pest()->extend().assertOpenApiValidationPasses,assertOpenApiValidationErrors,assertOpenApiValidationFailsAt) rather thanexpect()->extend()matchers, so PHPStan and the IDE can follow them without stubs.