original_string: public function getOptionParser()
      {
          list($root, $name) = explode(' ', $this->name, 2);
          $parser = new ConsoleOptionParser($name);
          $parser->setRootName($root);
  
          $parser = $this->buildOptionParser($parser);
          if (!($parser instanceof ConsoleOptionParser)) {
              throw new RuntimeException(sprintf(
                  "Invalid option parser returned from buildOptionParser(). Expected %s, got %s",
                  ConsoleOptionParser::class,
                  getTypeName($parser)
              ));
          }
  
          return $parser;
      }
code: public function getOptionParser()
      {
          list($root, $name) = explode(' ', $this->name, 2);
          $parser = new ConsoleOptionParser($name);
          $parser->setRootName($root);
  
          $parser = $this->buildOptionParser($parser);
          if (!($parser instanceof ConsoleOptionParser)) {
              throw new RuntimeException(sprintf(
                  "Invalid option parser returned from buildOptionParser(). Expected %s, got %s",
                  ConsoleOptionParser::class,
                  getTypeName($parser)
              ));
          }
  
          return $parser;
      }
code_tokens: public function getOptionParser ( ) { list ( $ root , $ name ) = explode ( ' ' , $ this -> name , 2 ) ; $ parser = new ConsoleOptionParser ( $ name ) ; $ parser -> setRootName ( $ root ) ; $ parser = $ this -> buildOptionParser ( $ parser ) ; if ( ! ( $ parser instanceof ConsoleOptionParser ) ) { throw new RuntimeException ( sprintf ( "Invalid option parser returned from buildOptionParser(). Expected %s, got %s" , ConsoleOptionParser :: class , getTypeName ( $ parser ) ) ) ; } return $ parser ; }
docstring: Get the option parser.
  
  You can override buildOptionParser() to define your options & arguments.
  
  @return \Cake\Console\ConsoleOptionParser
  @throws \RuntimeException When the parser is invalid
docstring_tokens: Get the option parser .