]> Raphaël G. Git Repositories - userbundle/commitdiff
Remove deprecated extension of \Symfony\Component\Security\Core\Role\Role class
authorRaphaël Gertz <git@rapsys.eu>
Thu, 14 Nov 2019 08:02:24 +0000 (09:02 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Thu, 14 Nov 2019 08:02:24 +0000 (09:02 +0100)
Entity/Group.php

index c7000ea8627aa3d0fa01468e04938e1579ca8728..dad79b0132c1a17902541465aa54d317211df0af 100644 (file)
@@ -3,7 +3,7 @@
 // src/Rapsys/UserBundle/Entity/Group.php
 namespace Rapsys\UserBundle\Entity;
 
 // src/Rapsys/UserBundle/Entity/Group.php
 namespace Rapsys\UserBundle\Entity;
 
-class Group extends \Symfony\Component\Security\Core\Role\Role {
+class Group {
        /**
         * @var integer
         */
        /**
         * @var integer
         */
@@ -33,7 +33,7 @@ class Group extends \Symfony\Component\Security\Core\Role\Role {
         * Constructor
         * @param string $role The role name
         */
         * Constructor
         * @param string $role The role name
         */
-       public function __construct($role) {
+       public function __construct(string $role) {
                $this->role = (string) $role;
                $this->users = new \Doctrine\Common\Collections\ArrayCollection();
        }
                $this->role = (string) $role;
                $this->users = new \Doctrine\Common\Collections\ArrayCollection();
        }
@@ -60,6 +60,17 @@ class Group extends \Symfony\Component\Security\Core\Role\Role {
                return $this->role;
        }
 
                return $this->role;
        }
 
+       /**
+        * Returns a string representation of the role.
+        *
+        * @xxx Replace the deprecated "extends \Symfony\Component\Security\Core\Role\Role"
+        *
+        * @return string
+        */
+       public function __toString(): string {
+               return $this->role;
+       }
+
        /**
         * Set created
         *
        /**
         * Set created
         *