original_string: public function validateArguments($methods, $handler): array
      {
          if (!$methods || !$handler) {
              throw new \InvalidArgumentException('The method and route handler is not allow empty.');
          }
  
          $allow = self::ALLOWED_METHODS_STR . ',';
          $hasAny = false;
  
          $methods = \array_map(function ($m) use ($allow, &$hasAny) {
              $m = \strtoupper(trim($m));
  
              if (!$m || false === \strpos($allow, $m . ',')) {
                  throw new \InvalidArgumentException("The method [$m] is not supported, Allow: " . trim($allow, ','));
              }
  
              if (!$hasAny && $m === self::ANY) {
                  $hasAny = true;
              }
  
              return $m;
          }, (array)$methods);
  
          return $hasAny ? self::ALLOWED_METHODS : $methods;
      }
code: public function validateArguments($methods, $handler): array
      {
          if (!$methods || !$handler) {
              throw new \InvalidArgumentException('The method and route handler is not allow empty.');
          }
  
          $allow = self::ALLOWED_METHODS_STR . ',';
          $hasAny = false;
  
          $methods = \array_map(function ($m) use ($allow, &$hasAny) {
              $m = \strtoupper(trim($m));
  
              if (!$m || false === \strpos($allow, $m . ',')) {
                  throw new \InvalidArgumentException("The method [$m] is not supported, Allow: " . trim($allow, ','));
              }
  
              if (!$hasAny && $m === self::ANY) {
                  $hasAny = true;
              }
  
              return $m;
          }, (array)$methods);
  
          return $hasAny ? self::ALLOWED_METHODS : $methods;
      }
code_tokens: public function validateArguments ( $ methods , $ handler ) : array { if ( ! $ methods || ! $ handler ) { throw new \ InvalidArgumentException ( 'The method and route handler is not allow empty.' ) ; } $ allow = self :: ALLOWED_METHODS_STR . ',' ; $ hasAny = false ; $ methods = \ array_map ( function ( $ m ) use ( $ allow , & $ hasAny ) { $ m = \ strtoupper ( trim ( $ m ) ) ; if ( ! $ m || false === \ strpos ( $ allow , $ m . ',' ) ) { throw new \ InvalidArgumentException ( "The method [$m] is not supported, Allow: " . trim ( $ allow , ',' ) ) ; } if ( ! $ hasAny && $ m === self :: ANY ) { $ hasAny = true ; } return $ m ; } , ( array ) $ methods ) ; return $ hasAny ? self :: ALLOWED_METHODS : $ methods ; }
docstring: validate and format arguments
  @param string|array $methods
  @param mixed $handler
  @return array
  @throws \InvalidArgumentException
docstring_tokens: validate and format arguments