thephpleague / container

Small but powerful dependency injection container
http://container.thephpleague.com
MIT License
844 stars 102 forks source link

PHP 8.4 support #262

Open leewillis77 opened 2 weeks ago

leewillis77 commented 2 weeks ago

Hi;

I'm just wondering if the 4.x branch will provide support for PHP 8.4 when available. Currently v4.2.2 generates a number of warnings due to the deprecation of implicitly null types (https://wiki.php.net/rfc/deprecate-implicitly-nullable-types).

List of identified issues:

FILE: vendor/league/container/src/Container.php
----------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------
  43 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found
     |         | implicitly nullable parameter: $definitions.
  44 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found
     |         | implicitly nullable parameter: $providers.
  45 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found
     |         | implicitly nullable parameter: $inflectors.
 156 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found
     |         | implicitly nullable parameter: $callback.
----------------------------------------------------------------------------------------------------------------------------------------------------

FILE: vendor/league/container/src/Argument/LiteralArgument.php
----------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------------
 27 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found
    |         | implicitly nullable parameter: $type.
----------------------------------------------------------------------------------------------------------------------------------------------------

FILE: vendor/league/container/src/DefinitionContainerInterface.php
----------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------------
 19 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found
    |         | implicitly nullable parameter: $callback.
----------------------------------------------------------------------------------------------------------------------------------------------------

FILE: vendor/league/container/src/Inflector/InflectorAggregate.php
----------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------------
 19 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found
    |         | implicitly nullable parameter: $callback.
----------------------------------------------------------------------------------------------------------------------------------------------------

FILE: vendor/league/container/src/Inflector/InflectorAggregateInterface.php
----------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------------
 12 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found
    |         | implicitly nullable parameter: $callback.
----------------------------------------------------------------------------------------------------------------------------------------------------

FILE: vendor/league/container/src/Inflector/Inflector.php
----------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------------
 36 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found
    |         | implicitly nullable parameter: $callback.
----------------------------------------------------------------------------------------------------------------------------------------------------

I'm happy to provide a patch, but wanted to check if the intention was that 4.x would support PHP 8.4 (I'm hoping so).

philipobenito commented 2 weeks ago

I'm currently working on 5.x which drops support for older PHP versions but see no reason why additional explicit support for PHP 8.4 can't be added to 4.x, would be more than happy to merge a PR and tag a patch or minor version for it. Otherwise I can get to it after 5.x work.

Cheers, Phil

Sent from Proton Mail Android

-------- Original Message -------- On 14/10/2024 11:38, Lee Willis wrote:

Hi;

I'm just wondering if the 4.x branch will provide support for PHP 8.4 when available. Currently v4.2.2 generates a number of warnings due to the deprecation of implicitly null types (https://wiki.php.net/rfc/deprecate-implicitly-nullable-types).

List of identified issues:

FILE: vendor/league/container/src/Container.php

FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES

43 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found | | implicitly nullable parameter: $definitions. 44 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found | | implicitly nullable parameter: $providers. 45 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found | | implicitly nullable parameter: $inflectors. 156 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found | | implicitly nullable parameter: $callback.

FILE: vendor/league/container/src/Argument/LiteralArgument.php

FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE

27 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found | | implicitly nullable parameter: $type.

FILE: vendor/league/container/src/DefinitionContainerInterface.php

FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE

19 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found | | implicitly nullable parameter: $callback.

FILE: vendor/league/container/src/Inflector/InflectorAggregate.php

FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE

19 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found | | implicitly nullable parameter: $callback.

FILE: vendor/league/container/src/Inflector/InflectorAggregateInterface.php

FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE

12 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found | | implicitly nullable parameter: $callback.

FILE: vendor/league/container/src/Inflector/Inflector.php

FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE

36 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found | | implicitly nullable parameter: $callback.

I'm happy to provide a patch, but wanted to check if the intention was that 4.x would support PHP 8.4 (I'm hoping so).

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>