According to Symfony begining with version 3.0 The Symfony\Component\Security\Core\SecurityContext
will be removed. This was already discussed here: Symfony 2 SecurityContext class deprecated
My symfony reports the following error:
Error: 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.
I am using annotations
to manage my security roles in symfony e.g.
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; // Security annotation bundle
/**
* @Route("/account/list", name="Account_list")
* @Security("has_role('ROLE_USER')")
*/
How should I switch into non-depreciated class?
Using either of the classes listed in error results in:
[Semantical Error] The annotation "@Security" in method AppBundle\Controller\AccountController::listAction() was never imported. Did you maybe forget to add a "use" statement for this annotation? in /var/www/gra.investmentopportunities.pl/src/AppBundle/Controller/ (which is being imported from "/var/www/gra.investmentopportunities.pl/app/config/routing.yml").