public function setMethods(array $methods)
    {
        $methods = array_map('strtoupper', $methods);
        $diff = array_diff($methods, static::VALID_METHODS);
        if ($diff !== []) {
            throw new InvalidArgumentException(
                sprintf('Invalid HTTP method received. %s is invalid.', implode(', ', $diff))
            );
        }
        $this->defaults['_method'] = $methods;

        return $this;
    }
public function setMethods(array $methods)
    {
        $methods = array_map('strtoupper', $methods);
        $diff = array_diff($methods, static::VALID_METHODS);
        if ($diff !== []) {
            throw new InvalidArgumentException(
                sprintf('Invalid HTTP method received. %s is invalid.', implode(', ', $diff))
            );
        }
        $this->defaults['_method'] = $methods;

        return $this;
    }
public function setMethods ( array $ methods ) { $ methods = array_map ( 'strtoupper' , $ methods ) ; $ diff = array_diff ( $ methods , static :: VALID_METHODS ) ; if ( $ diff !== [ ] ) { throw new InvalidArgumentException ( sprintf ( 'Invalid HTTP method received. %s is invalid.' , implode ( ', ' , $ diff ) ) ) ; } $ this -> defaults [ '_method' ] = $ methods ; return $ this ; }
Set the accepted HTTP methods for this route.

@param array $methods The HTTP methods to accept.
@return $this
@throws \InvalidArgumentException
Set the accepted HTTP methods for this route .