/**
  * @param $index
  * @param array $properties
  */
 public function start($index, array $properties = null)
 {
     if ($index === null || !is_string($index)) {
         throw new \InvalidArgumentException();
     }
     if (!$this->documentWrapper->getObject()->sheetNameExists($index)) {
         $this->documentWrapper->getObject()->createSheet()->setTitle($index);
     }
     $this->object = $this->documentWrapper->getObject()->setActiveSheetIndexByName($index);
     $this->attributes['index'] = $index;
     $this->attributes['properties'] = $properties ?: [];
     if ($properties !== null) {
         $this->setProperties($properties, $this->mappings);
     }
 }
 /**
  * @throws \PHPExcel_Reader_Exception
  */
 public function endDocument()
 {
     $this->documentWrapper->end();
 }