original_string: public function getExcelBook($file_format = self::FILE_FORMAT_XLSX, $locale = 'UTF-8')
      {
          //@codeCoverageIgnoreStart
          if (!extension_loaded('excel')) {
              throw new Exception\RuntimeException(__METHOD__ . ' LibXL requires excel extension (https://github.com/iliaal/php_excel) and http://libxl.com/.');
          }
          //@codeCoverageIgnoreEnd
          if (!$this->isSupportedFormat($file_format)) {
              throw new Exception\InvalidArgumentException(__METHOD__ . " Unsupported file format '$file_format'.");
          }
  
          $license = $this->getLicense();
          $license_name = $license['name'];
          $license_key = $license['key'];
          $excel2007 = true;
          switch ($file_format) {
              case self::FILE_FORMAT_XLS:
                  $excel2007 = false;
                  break;
          }
  
          $book = new ExcelBook($license_name, $license_key, $excel2007);
          if ($locale !== null) {
              $book->setLocale($locale);
          }
          return $book;
      }
code: public function getExcelBook($file_format = self::FILE_FORMAT_XLSX, $locale = 'UTF-8')
      {
          //@codeCoverageIgnoreStart
          if (!extension_loaded('excel')) {
              throw new Exception\RuntimeException(__METHOD__ . ' LibXL requires excel extension (https://github.com/iliaal/php_excel) and http://libxl.com/.');
          }
          //@codeCoverageIgnoreEnd
          if (!$this->isSupportedFormat($file_format)) {
              throw new Exception\InvalidArgumentException(__METHOD__ . " Unsupported file format '$file_format'.");
          }
  
          $license = $this->getLicense();
          $license_name = $license['name'];
          $license_key = $license['key'];
          $excel2007 = true;
          switch ($file_format) {
              case self::FILE_FORMAT_XLS:
                  $excel2007 = false;
                  break;
          }
  
          $book = new ExcelBook($license_name, $license_key, $excel2007);
          if ($locale !== null) {
              $book->setLocale($locale);
          }
          return $book;
      }
code_tokens: public function getExcelBook ( $ file_format = self :: FILE_FORMAT_XLSX , $ locale = 'UTF-8' ) { //@codeCoverageIgnoreStart if ( ! extension_loaded ( 'excel' ) ) { throw new Exception \ RuntimeException ( __METHOD__ . ' LibXL requires excel extension (https://github.com/iliaal/php_excel) and http://libxl.com/.' ) ; } //@codeCoverageIgnoreEnd if ( ! $ this -> isSupportedFormat ( $ file_format ) ) { throw new Exception \ InvalidArgumentException ( __METHOD__ . " Unsupported file format '$file_format'." ) ; } $ license = $ this -> getLicense ( ) ; $ license_name = $ license [ 'name' ] ; $ license_key = $ license [ 'key' ] ; $ excel2007 = true ; switch ( $ file_format ) { case self :: FILE_FORMAT_XLS : $ excel2007 = false ; break ; } $ book = new ExcelBook ( $ license_name , $ license_key , $ excel2007 ) ; if ( $ locale !== null ) { $ book -> setLocale ( $ locale ) ; } return $ book ; }
docstring: Return an empty ExcelBook instance
  
  @throws Exception\RuntimeException if no excel extension is found
  @throws Exception\InvalidArgumentException if unsupported format
  
  @param string $file_format by default xlsx, see constants FILE_FORMAT_*
  @param string $locale by default utf-8
  @return ExcelBook
docstring_tokens: Return an empty ExcelBook instance