From: Raphaƫl Gertz Date: Thu, 14 Nov 2019 08:02:24 +0000 (+0100) Subject: Remove deprecated extension of \Symfony\Component\Security\Core\Role\Role class X-Git-Tag: 0.1.0~6 X-Git-Url: https://git.rapsys.eu/userbundle/commitdiff_plain/55beb067dbd20e192fb31ca0a5027d678bc4b233?ds=sidebyside Remove deprecated extension of \Symfony\Component\Security\Core\Role\Role class --- diff --git a/Entity/Group.php b/Entity/Group.php index c7000ea..dad79b0 100644 --- a/Entity/Group.php +++ b/Entity/Group.php @@ -3,7 +3,7 @@ // src/Rapsys/UserBundle/Entity/Group.php namespace Rapsys\UserBundle\Entity; -class Group extends \Symfony\Component\Security\Core\Role\Role { +class Group { /** * @var integer */ @@ -33,7 +33,7 @@ class Group extends \Symfony\Component\Security\Core\Role\Role { * 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(); } @@ -60,6 +60,17 @@ class Group extends \Symfony\Component\Security\Core\Role\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 *