protected function getMatchingAuthzGroup($permissionAuthzGroup, array $authzGroups)
    {
        $invert = $this->stringStartsWith($permissionAuthzGroup, '!');
        
        if ($invert) {
            $permissionAuthzGroup = substr($permissionAuthzGroup, 1);
        }
        
        $matches = [];
        
        foreach ($authzGroups as $authzGroup) {
            $match = $this->authzGroupsAreEqual($permissionAuthzGroup, $authzGroup);
            
            if ($match && $invert) {
                return null;
            }
            
            if ($match && !$invert || !$match && $invert) {
                $matches[] = $authzGroup;
            }
        }
        
        return !empty($matches) ? $matches[0] : null;
    }
protected function getMatchingAuthzGroup($permissionAuthzGroup, array $authzGroups)
    {
        $invert = $this->stringStartsWith($permissionAuthzGroup, '!');
        
        if ($invert) {
            $permissionAuthzGroup = substr($permissionAuthzGroup, 1);
        }
        
        $matches = [];
        
        foreach ($authzGroups as $authzGroup) {
            $match = $this->authzGroupsAreEqual($permissionAuthzGroup, $authzGroup);
            
            if ($match && $invert) {
                return null;
            }
            
            if ($match && !$invert || !$match && $invert) {
                $matches[] = $authzGroup;
            }
        }
        
        return !empty($matches) ? $matches[0] : null;
    }
protected function getMatchingAuthzGroup ( $ permissionAuthzGroup , array $ authzGroups ) { $ invert = $ this -> stringStartsWith ( $ permissionAuthzGroup , '!' ) ; if ( $ invert ) { $ permissionAuthzGroup = substr ( $ permissionAuthzGroup , 1 ) ; } $ matches = [ ] ; foreach ( $ authzGroups as $ authzGroup ) { $ match = $ this -> authzGroupsAreEqual ( $ permissionAuthzGroup , $ authzGroup ) ; if ( $ match && $ invert ) { return null ; } if ( $ match && ! $ invert || ! $ match && $ invert ) { $ matches [ ] = $ authzGroup ; } } return ! empty ( $ matches ) ? $ matches [ 0 ] : null ; }
Check if one of the authz groups match

@param string $permissionAuthzGroup
@param array  $authzGroups
@return string|null
Check if one of the authz groups match