src/Listener/ApiListener.php
protected function _checkRequestMethods()
    {
        $action = $this->_action();
        $apiConfig = $action->getConfig('api');

        if (!isset($apiConfig['methods'])) {
            return false;
        }

        $request = $this->_request();
        foreach ($apiConfig['methods'] as $method) {
            if ($request->is($method)) {
                return true;
            }
        }

        throw new MethodNotAllowedException();
    }
protected function _checkRequestMethods()
    {
        $action = $this->_action();
        $apiConfig = $action->getConfig('api');

        if (!isset($apiConfig['methods'])) {
            return false;
        }

        $request = $this->_request();
        foreach ($apiConfig['methods'] as $method) {
            if ($request->is($method)) {
                return true;
            }
        }

        throw new MethodNotAllowedException();
    }
protected function _checkRequestMethods ( ) { $ action = $ this -> _action ( ) ; $ apiConfig = $ action -> getConfig ( 'api' ) ; if ( ! isset ( $ apiConfig [ 'methods' ] ) ) { return false ; } $ request = $ this -> _request ( ) ; foreach ( $ apiConfig [ 'methods' ] as $ method ) { if ( $ request -> is ( $ method ) ) { return true ; } } throw new MethodNotAllowedException ( ) ; }
Check for allowed HTTP request types

@throws \Cake\Http\Exception\MethodNotAllowedException
@return bool
Check for allowed HTTP request types