FriendsOfSymfony / FOSUserBundle

Provides user management for your Symfony project. Compatible with Doctrine ORM & ODM, and custom storages.
https://symfony.com/doc/master/bundles/FOSUserBundle/index.html
MIT License
3.25k stars 1.57k forks source link

PHP8.1 : deprecated function #3053

Closed ziedjlassi closed 1 year ago

ziedjlassi commented 1 year ago

Symfony FOSUserBundle versions: 3.1 PHP versions: 8.1 PHPUNIT versions: 9.6.3

Description of the problem including expected versus actual behavior: PHP8.1 : Deprecated: strtoupper()

Steps to reproduce:

  1. Run phpunit with symfony4.4

Provide logs (if relevant):

Deprecated: strtoupper(): Passing null to parameter #1 (string) of type string is deprecated in vendor/freindsosfymfony/user-bundle/Model/User.php on line 174

This message is repeated at least 150 times in launching phpunit with my application

Can you fix the problem. Thankyou

stof commented 1 year ago

our addRole method has a phpdoc saying @param string $role. If your testsuite passes null to this method, the issue is in your code, not in the bundle. The bundle never passes null to this method by itself.