/** * @param Client $client * @return array */ public function getClientScope(Client $client) { $authorizations = $this->getAuthorizations(); foreach ($authorizations as $auth) { $c = $auth->getClient(); if ($c->getId() == $client->getId()) { return $auth->getScope(); } } return null; }