Coduo\TuTu\Config\Element\Request::setAllowedMethods PHP Method

setAllowedMethods() public method

public setAllowedMethods ( $methods )
$methods
    public function setAllowedMethods($methods)
    {
        $this->allowedMethods = array_map(function ($method) {
            return strtoupper($method);
        }, $methods);
    }

Usage Example

Example #1
0
 public static function fromArray(array $arrayConfig)
 {
     $configResolver = self::createArrayConfigResolver();
     $config = $configResolver->resolve($arrayConfig);
     $responseConfig = new Request($config['path']);
     $responseConfig->setAllowedMethods($config['methods']);
     $responseConfig->setBodyParameters($config['request']);
     $responseConfig->setQueryParameters($config['query']);
     $responseConfig->setHeaders($config['headers']);
     $responseConfig->setBody($config['body']);
     return $responseConfig;
 }