Skip to content

refactor: Require php 8.4 and upgrade pest - #21

Merged
tymondesigns merged 2 commits into
mainfrom
refactor/upgrade-php-pest
Sep 16, 2026
Merged

tymondesigns merged 2 commits into
mainfrom
refactor/upgrade-php-pest

Conversation

@tymondesigns

@tymondesigns tymondesigns commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

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:

  • Require PHP 8.4+ in composer.json, README, docs, and CI. PHP 8.3 is no longer tested or supported.
  • Upgrade to Pest 5 and the matching plugins (phpstan, rector, type-coverage).
  • Pin pestphp/pest-plugin-mutate to ^5.0.1 so prefer-lowest CI cannot install 5.0.0, which crashes mutation testing against PHPUnit's --coverage-php array dump.

Tooling:

  • ECS targets PHP 8.4; Rector uses the PHP 8.4 set plus Pest coding style.
  • PHPStan now analyzes tests via pest-plugin-phpstan instead of a custom expectation stub.
  • composer test runs Pest in parallel.
  • CI matrix is PHP 8.4/8.5 with fail-fast: false.

Tests:

  • Bootstrap uses Pest 5 pest()->extend().
  • OpenAPI validation assertions are helper functions (assertOpenApiValidationPasses, assertOpenApiValidationErrors, assertOpenApiValidationFailsAt) rather than expect()->extend() matchers, so PHPStan and the IDE can follow them without stubs.

@tymondesigns
tymondesigns marked this pull request as ready for review September 16, 2026 07:35
@tymondesigns
tymondesigns requested a balanced review from Copilot September 16, 2026 07:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 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.

@tymondesigns
tymondesigns merged commit 9b69928 into main Sep 16, 2026
14 checks passed
@tymondesigns
tymondesigns deleted the refactor/upgrade-php-pest branch September 16, 2026 07:39
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