laravel / pint

Laravel Pint is an opinionated PHP code style fixer for minimalists.
https://laravel.com/docs/pint
MIT License
2.81k stars 143 forks source link

Deprecation Warnings - PHP 8.4 #311

Closed Fludem closed 36 minutes ago

Fludem commented 2 days ago

Pint Version

1.18.3

PHP Version

8.4

Description

Summary

I've not read previous PRs or Issues fully; I apologise for missing anything.

Running Pint generates numerous deprecation warnings. The warnings are about implicitly declaring a type as nullable in a parameter. The warnings stem from using outdated Illuminate/* packages that implementations of implicitly null types.

Potential solution

Both laravel 10 and 11 have recently released versions addressing the deprecation of implicit null parameters.

Laravel 11

If there are no blockers, publishing a release with updated dependencies would make sense.

Example Output

I've only included 2 of the 50+ warnings. Including more isn't necessary.

Deprecated: Illuminate\Contracts\Container\Container::resolving(): Implicitly marking parameter $callback as nullable is deprecated, the explicit nullable type must be used instead in phar://{{REDACTED}}vendor/laravel/pint/builds/pint/vendor/illuminate/contracts/Container/Container.php on line 209 PHP Deprecated: Illuminate\Contracts\Container\Container::afterResolving(): Implicitly marking parameter $callback as nullable is deprecated, the explicit nullable type must be used instead in phar://{{REDACTED}}vendor/laravel/pint/builds/pint/vendor/illuminate/contracts/Container/Container.php on line 218

Related:

304 #310

Steps To Reproduce

Install pint using PHP8.4. Run ./vendor/bin/pint See Warnings

Jubeki commented 2 days ago

The underlying library PHP-CS-Fixer is currently working on PHP 8.4 compatibility (this does not include PHP 8.4 syntax specific fixers). See the following milestone for more information: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/milestone/173

Furthermore is Laravel Pint working on PHP 8.4 compatibility: See https://github.com/laravel/pint/pull/304

Because this is a CLI tool and not Laravel/Illuminate directly, it is also waiting on laravel-zero to be compatible with PHP 8.4.

Fludem commented 1 day ago

The underlying library PHP-CS-Fixer is currently working on PHP 8.4 compatibility (this does not include PHP 8.4 syntax specific fixers). See the following milestone for more information: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/milestone/173

Furthermore is Laravel Pint working on PHP 8.4 compatibility: See #304

Because this is a CLI tool and not Laravel/Illuminate directly, it is also waiting on laravel-zero to be compatible with PHP 8.4.

Hey, I understand. I knew you guys were working on it before I tagged PR 304; I just wasn't sure what was preventing Herd from updating the illuminate dependencies to a version without implicit nulls.

Thank you for clearing it up

crynobone commented 36 minutes ago

Duplicate of https://github.com/laravel/pint/pull/304

Let's just monitor the status using the posted PR.