/** * @throws BadAuthenticationException */ public function authorize() { if (!$this->sessionContainer->offsetExists('data')) { throw new BadAuthenticationException('You must be first authenticated'); } $this->instagramWrapper->setAccessToken($this->sessionContainer->data); }