original_string: public function checkOptions(MvcEvent $e)
      {
          $matches  = $e->getRouteMatch();
          $response = $e->getResponse();
          $request  = $e->getRequest();
          $method   = $request->getMethod();
  
          // test if we matched an individual resource, and then test
          // if we allow the particular request method
          if ($matches->getParam('id', false)) {
              if (!in_array($method, $this->allowedResourceMethods)) {
                  $response->setStatusCode(405);
                  return $response;
              }
              return;
          }
  
          // We matched a collection; test if we allow the particular request 
          // method
          if (!in_array($method, $this->allowedCollectionMethods)) {
              $response->setStatusCode(405);
              return $response;
          }
      }
code: public function checkOptions(MvcEvent $e)
      {
          $matches  = $e->getRouteMatch();
          $response = $e->getResponse();
          $request  = $e->getRequest();
          $method   = $request->getMethod();
  
          // test if we matched an individual resource, and then test
          // if we allow the particular request method
          if ($matches->getParam('id', false)) {
              if (!in_array($method, $this->allowedResourceMethods)) {
                  $response->setStatusCode(405);
                  return $response;
              }
              return;
          }
  
          // We matched a collection; test if we allow the particular request 
          // method
          if (!in_array($method, $this->allowedCollectionMethods)) {
              $response->setStatusCode(405);
              return $response;
          }
      }
code_tokens: public function checkOptions ( MvcEvent $ e ) { $ matches = $ e -> getRouteMatch ( ) ; $ response = $ e -> getResponse ( ) ; $ request = $ e -> getRequest ( ) ; $ method = $ request -> getMethod ( ) ; // test if we matched an individual resource, and then test // if we allow the particular request method if ( $ matches -> getParam ( 'id' , false ) ) { if ( ! in_array ( $ method , $ this -> allowedResourceMethods ) ) { $ response -> setStatusCode ( 405 ) ; return $ response ; } return ; } // We matched a collection; test if we allow the particular request  // method if ( ! in_array ( $ method , $ this -> allowedCollectionMethods ) ) { $ response -> setStatusCode ( 405 ) ; return $ response ; } }
docstring: Checks that is an allowed method
  
  @param Zend\Mvc\MvcEvent $e
  @return void|Zend\Http\Response
docstring_tokens: Checks that is an allowed method