-
Notifications
You must be signed in to change notification settings - Fork 139
Closed
Description
Describe the bug
When compiling the Magento codebase using bin/magento setup:di:compile, multiple deprecation warnings are triggered due to PHP 8.4's and magento 2.4.8 stricter type enforcement. Specifically, the Magefan Blog module contains constructors with parameters that are implicitly nullable but not explicitly marked as nullable, which is deprecated in PHP 8.4.
Preconditions:
- Magento Version: 2.4.8
- Magefan Blog Module Version: 2.12.4
- PHP Version: 8.4
To Reproduce
Steps to reproduce the behavior:
-
Install Magento 2.4.8 with PHP 8.4
-
Install Magefan Blog module version 2.12.4
-
Run the following command:
php bin/magento setup:di:compile
4. Observe the deprecation warnings during compilation.
---
### **Expected behavior**
Magento compilation should complete without deprecated functionality warnings. Constructors should explicitly define nullable parameters using `?Type`.
---
### **Actual behavior**
Compilation results in deprecated warnings like the following:
```bash
Deprecated Functionality: Magefan\Blog\Controller\Router::__construct(): Implicitly marking parameter $urlResolver as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/vendor/magefan/module-blog/Controller/Router.php on line 116
This issue is repeated across multiple files where constructor parameters are defaulted to null but are not explicitly marked as nullable.
Metadata
Metadata
Assignees
Labels
No labels