public function resolve(Context $context)
 {
     $isScopeAllowed = [$context->getClient(), 'hasAllowedScope'];
     $scopeNames = $context->getScopes()->getNames();
     if (f\some(f\not_fn($isScopeAllowed), $scopeNames)) {
         throw new UnauthorizedClientForScopeOAuthErrorException();
     }
     return $context;
 }
 public function resolve(Context $context)
 {
     $scopeExists = [$this->repository, 'find'];
     $scopeNames = $context->getScopes()->getNames();
     if (f\some(f\not_fn($scopeExists), $scopeNames)) {
         throw new ScopeNotFoundOAuthErrorException();
     }
     return $context;
 }
Example #3
0
 /**
  * @dataProvider provideSome
  */
 public function testSome($exp, $coll, $fn)
 {
     $this->assertSame($exp, f\some($fn, $coll));
 }