Skip to content

Conversation

MarcinOrlowski
Copy link
Owner

No description provided.

@MarcinOrlowski MarcinOrlowski requested a review from Copilot July 15, 2025 22:06
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR prepares the v12.1.1 release by addressing PHP 8.4 deprecation warnings for non-nullable parameters with default null, updating docs, and bumping the package version.

  • Convert several method parameters from int to ?int to silence PHP 8.4 deprecations.
  • Add a CHANGELOG entry for v12.1.1.
  • Bump composer.json version to 12.1.1.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/Traits/TestingHelpers.php Allow $expected_http_code to be nullable in getResponseSuccessObject
src/ResponseBuilder.php Make $http_code, $json_opts, and $api_code nullable in error() and asSuccess()
docs/CHANGES.md Added v12.1.1 entry for PHP 8.4 deprecation fixes
composer.json Updated package version to 12.1.1
Comments suppressed due to low confidence (5)

tests/Traits/TestingHelpers.php:158

  • The docblock for getResponseSuccessObject doesn’t list the newly nullable $expected_http_code param. Please add @param int|null $expected_http_code to keep docs in sync with the signature.
                                             ?int    $expected_http_code = null,

src/ResponseBuilder.php:122

  • Update the docblock above error() to reflect @param int|null $http_code and @param int|null $json_opts since these parameters are now nullable.
                                 ?int   $http_code = null,

src/ResponseBuilder.php:142

  • The docblock for asSuccess() still lists @param int $api_code; please change it to @param int|null $api_code to match the updated signature.
    public static function asSuccess(?int $api_code = null): self

tests/Traits/TestingHelpers.php:158

  • [nitpick] Consider adding a test case where $expected_http_code is explicitly null to ensure getResponseSuccessObject handles nullable input as intended.
                                             ?int    $expected_http_code = null,

src/ResponseBuilder.php:122

  • [nitpick] Add unit tests for error() with default null values for $http_code and $json_opts to verify default behavior hasn’t changed.
                                 ?int   $http_code = null,

@MarcinOrlowski MarcinOrlowski merged commit e1a2a47 into master Jul 15, 2025
8 checks passed
@MarcinOrlowski MarcinOrlowski deleted the dev branch July 15, 2025 22:21
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.

1 participant