Skip to content

Conversation

@cmuench
Copy link
Member

@cmuench cmuench commented Jun 13, 2025

This commit addresses deprecation warnings identified by PHPCompatibility and PHPStan related to implicitly nullable parameters. In PHP 8.4, implicitly marking a parameter as nullable by providing a default null value without using the explicit '?' nullable type hint will be deprecated.

The following changes were made:

  • In src/N98/Util/Http/DownloadException.php:

    • The $previous parameter in the __construct method is now explicitly nullable (?Throwable).
  • In src/N98/Magento/Command/Developer/Console/Shell.php:

    • The $input parameter in the run method is now explicitly nullable (?InputInterface).
    • The $output parameter in the run method is now explicitly nullable (?OutputInterface).

These changes ensure that the codebase remains compatible with upcoming PHP versions and adheres to stricter type checking.

Magerun pull-request check-list:

  • Pull request against develop branch (if not, just close and create a new one against it)
  • README.md reflects changes (if any)
  • phar fuctional test (in tests/phar-test.sh)

Summary: (some words as summary)

Fixes #1659

This commit addresses deprecation warnings identified by PHPCompatibility
and PHPStan related to implicitly nullable parameters. In PHP 8.4,
implicitly marking a parameter as nullable by providing a default null
value without using the explicit '?' nullable type hint will be
deprecated.

The following changes were made:

- In `src/N98/Util/Http/DownloadException.php`:
    - The `$previous` parameter in the `__construct` method is now
      explicitly nullable (`?Throwable`).

- In `src/N98/Magento/Command/Developer/Console/Shell.php`:
    - The `$input` parameter in the `run` method is now explicitly
      nullable (`?InputInterface`).
    - The `$output` parameter in the `run` method is now explicitly
      nullable (`?OutputInterface`).

These changes ensure that the codebase remains compatible with upcoming
PHP versions and adheres to stricter type checking.
@github-actions
Copy link

Download the artifacts for this pull request:

@cmuench cmuench merged commit 85c9252 into develop Jun 13, 2025
18 checks passed
@cmuench cmuench deleted the fix/php84-nullable-param-deprecation branch June 14, 2025 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants