original_string: protected function createPrivilegesFromMethods(array $methods, $denyByDefault)
      {
          $privileges = [];
  
          if (isset($methods['default']) && $methods['default']) {
              $privileges = $this->httpMethods;
              unset($methods['default']);
          }
  
          foreach ($methods as $method => $flag) {
              // If the flag evaluates true and we're denying by default, OR
              // if the flag evaluates false and we're allowing by default,
              // THEN no rule needs to be added
              if (( $denyByDefault && $flag)
                  || (! $denyByDefault && ! $flag)
              ) {
                  if (isset($privileges[$method])) {
                      unset($privileges[$method]);
                  }
                  continue;
              }
  
              // Otherwise, we need to add a rule
              $privileges[$method] = true;
          }
  
          if (empty($privileges)) {
              return null;
          }
  
          return array_keys($privileges);
      }
code: protected function createPrivilegesFromMethods(array $methods, $denyByDefault)
      {
          $privileges = [];
  
          if (isset($methods['default']) && $methods['default']) {
              $privileges = $this->httpMethods;
              unset($methods['default']);
          }
  
          foreach ($methods as $method => $flag) {
              // If the flag evaluates true and we're denying by default, OR
              // if the flag evaluates false and we're allowing by default,
              // THEN no rule needs to be added
              if (( $denyByDefault && $flag)
                  || (! $denyByDefault && ! $flag)
              ) {
                  if (isset($privileges[$method])) {
                      unset($privileges[$method]);
                  }
                  continue;
              }
  
              // Otherwise, we need to add a rule
              $privileges[$method] = true;
          }
  
          if (empty($privileges)) {
              return null;
          }
  
          return array_keys($privileges);
      }
code_tokens: protected function createPrivilegesFromMethods ( array $ methods , $ denyByDefault ) { $ privileges = [ ] ; if ( isset ( $ methods [ 'default' ] ) && $ methods [ 'default' ] ) { $ privileges = $ this -> httpMethods ; unset ( $ methods [ 'default' ] ) ; } foreach ( $ methods as $ method => $ flag ) { // If the flag evaluates true and we're denying by default, OR // if the flag evaluates false and we're allowing by default, // THEN no rule needs to be added if ( ( $ denyByDefault && $ flag ) || ( ! $ denyByDefault && ! $ flag ) ) { if ( isset ( $ privileges [ $ method ] ) ) { unset ( $ privileges [ $ method ] ) ; } continue ; } // Otherwise, we need to add a rule $ privileges [ $ method ] = true ; } if ( empty ( $ privileges ) ) { return null ; } return array_keys ( $ privileges ) ; }
docstring: Create the list of HTTP methods defining privileges
  
  @param array $methods
  @param bool $denyByDefault
  @return array|null
docstring_tokens: Create the list of HTTP methods defining privileges