I am using DoctrineBehaviors extension in my Symfony 3.0 project. Due to this change I have to override the UserCallable class. Is it possible to do this with bundle inheritance or any other way?
In more detail I want to override the original method:
class UserCallable {
...
public function __invoke() {
$token = $this->container->get('security.context')->getToken();
if (null !== $token) {
return $token->getUser();
}
}
}
probably in my custom bundle class:
class MyUserCallable extends UserCallable {
...
public function __invoke() {
$token = $this->container->get('security.token_storage')->getToken();
if (null !== $token) {
return $token->getUser();
}
}
}