fkooman\OAuth\Client\Scope::hasScope PHP Method

hasScope() public method

public hasScope ( Scope $that )
$that Scope
    public function hasScope(Scope $that)
    {
        foreach ($that->toArray() as $s) {
            if (!in_array($s, $this->toArray())) {
                return false;
            }
        }
        return true;
    }

Usage Example

Esempio n. 1
0
 public function testEmptyScope()
 {
     $s = new Scope();
     $this->assertTrue($s->isEmpty());
     $this->assertTrue($s->equals(new Scope()));
     $this->assertFalse($s->hasScope(new Scope(array('foo'))));
     $this->assertTrue($s->hasScope(new Scope()));
     $this->assertTrue($s->hasAnyScope(new Scope()));
 }