original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Check if one of the authz groups match
  
  @param string $permissionAuthzGroup
  @param array  $authzGroups
  @return string|null
docstring_tokens: Check if one of the authz groups match