From 55beb067dbd20e192fb31ca0a5027d678bc4b233 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Thu, 14 Nov 2019 09:02:24 +0100 Subject: [PATCH] Remove deprecated extension of \Symfony\Component\Security\Core\Role\Role class --- Entity/Group.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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 * -- 2.41.0