DEPRECATED : The Symfony\Component\Security\Core\SecurityContext class is deprecated since version 2.6
Hello les amis,
je viens de passer sous Symfony2.7 et je pars à la chasse aux DEPRECATED.
Code:
1 2
|
DEPRECATED - The Symfony\Component\Security\Core\SecurityContext class is deprecated since version 2.6 and will be removed in 3.0. Use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage or Symfony\Component\Security\Core\Authorization\AuthorizationChecker instead |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
/**
*
* @Route("/instance")
*/
class InstanceController extends Controller {
/**
* @Route("/liste-des-instances", name="page_instance_liste_index")
*/
public function instanceListeIndexAction() {
$user = $this->get('security.token_storage')->getToken()->getUser();
if (true === $this->get('security.authorization_checker')->isGranted('ROLE_USER')) {
...
return $this->render( ... );
}
return $this->redirect( $this->generateUrl('page_index') );
} |
je ne comprends pas comment remédier ?