Implicitly marking parameter as nullable is deprecated
-
Hello,
I am currently testing Ninja Tables on PHP 8.4 and noticed multiple deprecation warnings related to implicitly nullable parameters.
Example warning:
Deprecated: NinjaTables\Framework\Database\Query\Builder::__construct(): Implicitly marking parameter $grammar as nullable is deprecated, the explicit nullable type must be used instead
Affected files include:
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Database/Orm/Builder.php:227
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Database/Orm/Builder.php:577
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Database/Orm/Builder.php:682
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Database/Orm/Concerns/QueriesRelationships.php:126
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Database/Orm/Concerns/QueriesRelationships.php:151
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Database/Orm/Concerns/QueriesRelationships.php:167
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Database/Orm/Concerns/QueriesRelationships.php:182
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Database/Orm/Concerns/QueriesRelationships.php:194
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Database/Orm/Concerns/QueriesRelationships.php:206
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Database/Orm/Concerns/QueriesRelationships.php:222
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Database/Orm/Concerns/QueriesRelationships.php:305
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Database/Orm/Concerns/QueriesRelationships.php:33
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Database/Orm/Concerns/QueriesRelationships.php:332
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Database/Orm/Concerns/QueriesRelationships.php:347
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Database/Orm/Concerns/QueriesRelationships.php:360
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Database/Orm/Concerns/QueriesRelationships.php:373
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Database/Query/Builder.php:265
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Database/Query/Builder.php:266
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Database/Query/Builder.php:3109
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/Collection.php:394
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/Collection.php:424
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/Collection.php:738
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/Conditionable.php:53
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/Conditionable.php:53
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/Enumerable.php:268
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/Enumerable.php:278
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/Enumerable.php:28
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/Enumerable.php:287
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/Enumerable.php:296
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/Enumerable.php:306
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/Enumerable.php:315
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/Enumerable.php:324
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/Enumerable.php:432
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/Enumerable.php:555
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/EnumeratesValues.php:144
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/EnumeratesValues.php:447
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/EnumeratesValues.php:447
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/EnumeratesValues.php:469
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/EnumeratesValues.php:481
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/EnumeratesValues.php:494
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/EnumeratesValues.php:506
- wp-content/plugins/ninja-tables/vendor/wpfluent/framework/src/WPFluent/Support/EnumeratesValues.php:518
The issue appears to be caused by PHP 8.4 deprecating implicitly nullable typed parameters, for example:
public function example(callable $callback = null)
which should now be explicitly declared as:
public function example(?callable $callback = null)
or:
public function example(callable|null $callback = null)
The plugin still works, but PHP generates many deprecation notices in debug mode.
Environment:
- WordPress latest version
- PHP 8.4
- Ninja Tables latest version
Please consider updating the WPFluent framework for PHP 8.4 compatibility.
Thank you.
You must be logged in to reply to this topic.