/** * Init * * @param Notifier $notifier * @param ErrorHandler $errorHandler * @param SecurityContextInterface $securityContext * @param UserHelper $userHelper */ public function __construct(Notifier $notifier, ErrorHandler $errorHandler, SecurityContextInterface $securityContext, UserHelper $userHelper) { $this->notifier = $notifier; $this->errorHandler = $errorHandler; $this->securityContext = $securityContext; $this->userHelper = $userHelper; $self = $this; $this->notifier->getEnvironment()->setOption('person_callback', function () use($self) { return $self->getUserData(); }); }
/** * Init * * @param Notifier $notifier * @param ErrorHandler $errorHandler * @param TokenStorageInterface $tokenStorage * @param AuthorizationCheckerInterface $authorizationChecker * @param UserHelper $userHelper */ public function __construct(Notifier $notifier, ErrorHandler $errorHandler, TokenStorageInterface $tokenStorage, AuthorizationCheckerInterface $authorizationChecker, UserHelper $userHelper) { $this->notifier = $notifier; $this->errorHandler = $errorHandler; $this->tokenStorage = $tokenStorage; $this->authorizationChecker = $authorizationChecker; $this->userHelper = $userHelper; $self = $this; $this->notifier->getEnvironment()->setOption('person_callback', function () use($self) { return $self->getUserData(); }); }
function let(Notifier $notifier, ErrorHandler $errorHandler, TokenStorageInterface $tokenStorage, AuthorizationCheckerInterface $authorizationChecker, Environment $environment, UserHelper $userHelper) { $notifier->getEnvironment()->willReturn($environment); $environment->setOption('person_callback', Argument::type('\\Closure'))->shouldBeCalled(); $this->beConstructedWith($notifier, $errorHandler, $tokenStorage, $authorizationChecker, $userHelper); }
function let(Notifier $notifier, ErrorHandler $errorHandler, SecurityContextInterface $securityContext, Environment $environment, UserHelper $userHelper) { $notifier->getEnvironment()->willReturn($environment); $environment->setOption('person_callback', Argument::type('\\Closure'))->shouldBeCalled(); $this->beConstructedWith($notifier, $errorHandler, $securityContext, $userHelper); }