diff --git a/Wrapper/XlsCellWrapper.php b/Wrapper/XlsCellWrapper.php index e928580..ea2df22 100644 --- a/Wrapper/XlsCellWrapper.php +++ b/Wrapper/XlsCellWrapper.php @@ -49,58 +49,56 @@ public function __construct(array $context, XlsSheetWrapper $sheetWrapper) protected function initializeMappings() { - $wrapper = $this; // PHP 5.3 fix - - $this->mappings['break'] = function ($value) use ($wrapper) { - $wrapper->sheetWrapper->getObject()->setBreak($wrapper->object->getCoordinate(), $value); + $this->mappings['break'] = function ($value) { + $this->sheetWrapper->getObject()->setBreak($this->object->getCoordinate(), $value); }; - $this->mappings['dataType'] = function ($value) use ($wrapper) { - $wrapper->object->setDataType($value); + $this->mappings['dataType'] = function ($value) { + $this->object->setDataType($value); }; - $this->mappings['dataValidation']['allowBlank'] = function ($value) use ($wrapper) { - $wrapper->object->getDataValidation()->setAllowBlank($value); + $this->mappings['dataValidation']['allowBlank'] = function ($value) { + $this->object->getDataValidation()->setAllowBlank($value); }; - $this->mappings['dataValidation']['error'] = function ($value) use ($wrapper) { - $wrapper->object->getDataValidation()->setError($value); + $this->mappings['dataValidation']['error'] = function ($value) { + $this->object->getDataValidation()->setError($value); }; - $this->mappings['dataValidation']['errorStyle'] = function ($value) use ($wrapper) { - $wrapper->object->getDataValidation()->setErrorStyle($value); + $this->mappings['dataValidation']['errorStyle'] = function ($value) { + $this->object->getDataValidation()->setErrorStyle($value); }; - $this->mappings['dataValidation']['errorTitle'] = function ($value) use ($wrapper) { - $wrapper->object->getDataValidation()->setErrorTitle($value); + $this->mappings['dataValidation']['errorTitle'] = function ($value) { + $this->object->getDataValidation()->setErrorTitle($value); }; - $this->mappings['dataValidation']['formula1'] = function ($value) use ($wrapper) { - $wrapper->object->getDataValidation()->setFormula1($value); + $this->mappings['dataValidation']['formula1'] = function ($value) { + $this->object->getDataValidation()->setFormula1($value); }; - $this->mappings['dataValidation']['formula2'] = function ($value) use ($wrapper) { - $wrapper->object->getDataValidation()->setFormula2($value); + $this->mappings['dataValidation']['formula2'] = function ($value) { + $this->object->getDataValidation()->setFormula2($value); }; - $this->mappings['dataValidation']['operator'] = function ($value) use ($wrapper) { - $wrapper->object->getDataValidation()->setOperator($value); + $this->mappings['dataValidation']['operator'] = function ($value) { + $this->object->getDataValidation()->setOperator($value); }; - $this->mappings['dataValidation']['prompt'] = function ($value) use ($wrapper) { - $wrapper->object->getDataValidation()->setPrompt($value); + $this->mappings['dataValidation']['prompt'] = function ($value) { + $this->object->getDataValidation()->setPrompt($value); }; - $this->mappings['dataValidation']['promptTitle'] = function ($value) use ($wrapper) { - $wrapper->object->getDataValidation()->setPromptTitle($value); + $this->mappings['dataValidation']['promptTitle'] = function ($value) { + $this->object->getDataValidation()->setPromptTitle($value); }; - $this->mappings['dataValidation']['showDropDown'] = function ($value) use ($wrapper) { - $wrapper->object->getDataValidation()->setShowDropDown($value); + $this->mappings['dataValidation']['showDropDown'] = function ($value) { + $this->object->getDataValidation()->setShowDropDown($value); }; - $this->mappings['dataValidation']['showErrorMessage'] = function ($value) use ($wrapper) { - $wrapper->object->getDataValidation()->setShowErrorMessage($value); + $this->mappings['dataValidation']['showErrorMessage'] = function ($value) { + $this->object->getDataValidation()->setShowErrorMessage($value); }; - $this->mappings['dataValidation']['showInputMessage'] = function ($value) use ($wrapper) { - $wrapper->object->getDataValidation()->setShowInputMessage($value); + $this->mappings['dataValidation']['showInputMessage'] = function ($value) { + $this->object->getDataValidation()->setShowInputMessage($value); }; - $this->mappings['dataValidation']['type'] = function ($value) use ($wrapper) { - $wrapper->object->getDataValidation()->setType($value); + $this->mappings['dataValidation']['type'] = function ($value) { + $this->object->getDataValidation()->setType($value); }; - $this->mappings['style'] = function ($value) use ($wrapper) { - $wrapper->sheetWrapper->getObject()->getStyle($wrapper->object->getCoordinate())->applyFromArray($value); + $this->mappings['style'] = function ($value) { + $this->sheetWrapper->getObject()->getStyle($this->object->getCoordinate())->applyFromArray($value); }; - $this->mappings['url'] = function ($value) use ($wrapper) { - $wrapper->object->getHyperlink()->setUrl($value); + $this->mappings['url'] = function ($value) { + $this->object->getHyperlink()->setUrl($value); }; } diff --git a/Wrapper/XlsDocumentWrapper.php b/Wrapper/XlsDocumentWrapper.php index 7790638..209a37b 100644 --- a/Wrapper/XlsDocumentWrapper.php +++ b/Wrapper/XlsDocumentWrapper.php @@ -48,61 +48,59 @@ public function __construct(array $context) protected function initializeMappings() { - $wrapper = $this; // PHP 5.3 fix - - $this->mappings['category'] = function ($value) use ($wrapper) { - $wrapper->object->getProperties()->setCategory($value); + $this->mappings['category'] = function ($value) { + $this->object->getProperties()->setCategory($value); }; - $this->mappings['company'] = function ($value) use ($wrapper) { - $wrapper->object->getProperties()->setCompany($value); + $this->mappings['company'] = function ($value) { + $this->object->getProperties()->setCompany($value); }; - $this->mappings['created'] = function ($value) use ($wrapper) { - $wrapper->object->getProperties()->setCreated($value); + $this->mappings['created'] = function ($value) { + $this->object->getProperties()->setCreated($value); }; - $this->mappings['creator'] = function ($value) use ($wrapper) { - $wrapper->object->getProperties()->setCreator($value); + $this->mappings['creator'] = function ($value) { + $this->object->getProperties()->setCreator($value); }; - $this->mappings['defaultStyle'] = function ($value) use ($wrapper) { - $wrapper->object->getDefaultStyle()->applyFromArray($value); + $this->mappings['defaultStyle'] = function ($value) { + $this->object->getDefaultStyle()->applyFromArray($value); }; - $this->mappings['description'] = function ($value) use ($wrapper) { - $wrapper->object->getProperties()->setDescription($value); + $this->mappings['description'] = function ($value) { + $this->object->getProperties()->setDescription($value); }; - $this->mappings['format'] = function ($value) use ($wrapper) { - $wrapper->attributes['format'] = $value; + $this->mappings['format'] = function ($value) { + $this->attributes['format'] = $value; }; - $this->mappings['keywords'] = function ($value) use ($wrapper) { - $wrapper->object->getProperties()->setKeywords($value); + $this->mappings['keywords'] = function ($value) { + $this->object->getProperties()->setKeywords($value); }; - $this->mappings['lastModifiedBy'] = function ($value) use ($wrapper) { - $wrapper->object->getProperties()->setLastModifiedBy($value); + $this->mappings['lastModifiedBy'] = function ($value) { + $this->object->getProperties()->setLastModifiedBy($value); }; - $this->mappings['manager'] = function ($value) use ($wrapper) { - $wrapper->object->getProperties()->setManager($value); + $this->mappings['manager'] = function ($value) { + $this->object->getProperties()->setManager($value); }; - $this->mappings['modified'] = function ($value) use ($wrapper) { - $wrapper->object->getProperties()->setModified($value); + $this->mappings['modified'] = function ($value) { + $this->object->getProperties()->setModified($value); }; - $this->mappings['security']['lockRevision'] = function ($value) use ($wrapper) { - $wrapper->object->getSecurity()->setLockRevision($value); + $this->mappings['security']['lockRevision'] = function ($value) { + $this->object->getSecurity()->setLockRevision($value); }; - $this->mappings['security']['lockStructure'] = function ($value) use ($wrapper) { - $wrapper->object->getSecurity()->setLockStructure($value); + $this->mappings['security']['lockStructure'] = function ($value) { + $this->object->getSecurity()->setLockStructure($value); }; - $this->mappings['security']['lockWindows'] = function ($value) use ($wrapper) { - $wrapper->object->getSecurity()->setLockWindows($value); + $this->mappings['security']['lockWindows'] = function ($value) { + $this->object->getSecurity()->setLockWindows($value); }; - $this->mappings['security']['revisionsPassword'] = function ($value) use ($wrapper) { - $wrapper->object->getSecurity()->setRevisionsPassword($value); + $this->mappings['security']['revisionsPassword'] = function ($value) { + $this->object->getSecurity()->setRevisionsPassword($value); }; - $this->mappings['security']['workbookPassword'] = function ($value) use ($wrapper) { - $wrapper->object->getSecurity()->setWorkbookPassword($value); + $this->mappings['security']['workbookPassword'] = function ($value) { + $this->object->getSecurity()->setWorkbookPassword($value); }; - $this->mappings['subject'] = function ($value) use ($wrapper) { - $wrapper->object->getProperties()->setSubject($value); + $this->mappings['subject'] = function ($value) { + $this->object->getProperties()->setSubject($value); }; - $this->mappings['title'] = function ($value) use ($wrapper) { - $wrapper->object->getProperties()->setTitle($value); + $this->mappings['title'] = function ($value) { + $this->object->getProperties()->setTitle($value); }; } diff --git a/Wrapper/XlsDrawingWrapper.php b/Wrapper/XlsDrawingWrapper.php index c728dd3..aba710b 100644 --- a/Wrapper/XlsDrawingWrapper.php +++ b/Wrapper/XlsDrawingWrapper.php @@ -55,62 +55,59 @@ public function __construct(array $context, XlsSheetWrapper $sheetWrapper, XlsHe protected function initializeMappings() { - $wrapper = $this; // PHP 5.3 fix - - $this->mappings['coordinates'] = function ($value) use ($wrapper) { - $wrapper->object->setCoordinates($value); + $this->mappings['coordinates'] = function ($value) { + $this->object->setCoordinates($value); }; - $this->mappings['description'] = function ($value) use ($wrapper) { - $wrapper->object->setDescription($value); + $this->mappings['description'] = function ($value) { + $this->object->setDescription($value); }; - $this->mappings['height'] = function ($value) use ($wrapper) { - $wrapper->object->setHeight($value); + $this->mappings['height'] = function ($value) { + $this->object->setHeight($value); }; - $this->mappings['name'] = function ($value) use ($wrapper) { - $wrapper->object->setName($value); + $this->mappings['name'] = function ($value) { + $this->object->setName($value); }; - $this->mappings['offsetX'] = function ($value) use ($wrapper) { - $wrapper->object->setOffsetX($value); + $this->mappings['offsetX'] = function ($value) { + $this->object->setOffsetX($value); }; - $this->mappings['offsetY'] = function ($value) use ($wrapper) { - $wrapper->object->setOffsetY($value); + $this->mappings['offsetY'] = function ($value) { + $this->object->setOffsetY($value); }; - $this->mappings['resizeProportional'] = function ($value) use ($wrapper) { - $wrapper->object->setResizeProportional($value); + $this->mappings['resizeProportional'] = function ($value) { + $this->object->setResizeProportional($value); }; - $this->mappings['rotation'] = function ($value) use ($wrapper) { - $wrapper->object->setRotation($value); + $this->mappings['rotation'] = function ($value) { + $this->object->setRotation($value); }; - $this->mappings['shadow']['alignment'] = function ($value) use ($wrapper) { - $wrapper->object->getShadow()->setAlignment($value); + $this->mappings['shadow']['alignment'] = function ($value) { + $this->object->getShadow()->setAlignment($value); }; - $this->mappings['shadow']['alpha'] = function ($value) use ($wrapper) { - $wrapper->object->getShadow()->setAlpha($value); + $this->mappings['shadow']['alpha'] = function ($value) { + $this->object->getShadow()->setAlpha($value); }; - $this->mappings['shadow']['blurRadius'] = function ($value) use ($wrapper) { - $wrapper->object->getShadow()->setBlurRadius($value); + $this->mappings['shadow']['blurRadius'] = function ($value) { + $this->object->getShadow()->setBlurRadius($value); }; - $this->mappings['shadow']['color'] = function ($value) use ($wrapper) { - $wrapper->object->getShadow()->getColor()->setRGB($value); + $this->mappings['shadow']['color'] = function ($value) { + $this->object->getShadow()->getColor()->setRGB($value); }; - $this->mappings['shadow']['direction'] = function ($value) use ($wrapper) { - $wrapper->object->getShadow()->setDirection($value); + $this->mappings['shadow']['direction'] = function ($value) { + $this->object->getShadow()->setDirection($value); }; - $this->mappings['shadow']['distance'] = function ($value) use ($wrapper) { - $wrapper->object->getShadow()->setDistance($value); + $this->mappings['shadow']['distance'] = function ($value) { + $this->object->getShadow()->setDistance($value); }; - $this->mappings['shadow']['visible'] = function ($value) use ($wrapper) { - $wrapper->object->getShadow()->setVisible($value); + $this->mappings['shadow']['visible'] = function ($value) { + $this->object->getShadow()->setVisible($value); }; - $this->mappings['width'] = function ($value) use ($wrapper) { - $wrapper->object->setWidth($value); + $this->mappings['width'] = function ($value) { + $this->object->setWidth($value); }; } /** - * @param string $path - * @param array $properties - * + * @param $path + * @param array|null $properties * @throws \PHPExcel_Exception */ public function start($path, array $properties = null) diff --git a/Wrapper/XlsHeaderFooterWrapper.php b/Wrapper/XlsHeaderFooterWrapper.php index 35642d9..75ce06c 100644 --- a/Wrapper/XlsHeaderFooterWrapper.php +++ b/Wrapper/XlsHeaderFooterWrapper.php @@ -56,13 +56,11 @@ public function __construct(array $context, XlsSheetWrapper $sheetWrapper) protected function initializeMappings() { - $wrapper = $this; // PHP 5.3 fix - - $this->mappings['scaleWithDocument'] = function ($value) use ($wrapper) { - $wrapper->object->setScaleWithDocument($value); + $this->mappings['scaleWithDocument'] = function ($value) { + $this->object->setScaleWithDocument($value); }; - $this->mappings['alignWithMargins'] = function ($value) use ($wrapper) { - $wrapper->object->setAlignWithMargins($value); + $this->mappings['alignWithMargins'] = function ($value) { + $this->object->setAlignWithMargins($value); }; } diff --git a/Wrapper/XlsSheetWrapper.php b/Wrapper/XlsSheetWrapper.php index d22defd..3e1797b 100644 --- a/Wrapper/XlsSheetWrapper.php +++ b/Wrapper/XlsSheetWrapper.php @@ -70,177 +70,176 @@ public function __construct(array $context, XlsDocumentWrapper $documentWrapper) protected function initializeMappings() { - $wrapper = $this; // PHP 5.3 fix - $this->mappings['columnDimension']['__multi'] = true; - $this->mappings['columnDimension']['__object'] = function ($key = 'default') use ($wrapper) { - return $key === 'default' ? $wrapper->object->getDefaultColumnDimension() : $wrapper->object->getColumnDimension($key); + $this->mappings['columnDimension']['__object'] = function ($key = 'default') { + return $key === 'default' ? $this->object->getDefaultColumnDimension() : $this->object->getColumnDimension($key); }; - $this->mappings['columnDimension']['autoSize'] = function ($key, $value) use ($wrapper) { - $wrapper->mappings['columnDimension']['__object']($key)->setAutoSize($value); + $this->mappings['columnDimension']['autoSize'] = function ($key, $value) { + $this->mappings['columnDimension']['__object']($key)->setAutoSize($value); }; - $this->mappings['columnDimension']['collapsed'] = function ($key, $value) use ($wrapper) { - $wrapper->mappings['columnDimension']['__object']($key)->setCollapsed($value); + $this->mappings['columnDimension']['collapsed'] = function ($key, $value) { + $this->mappings['columnDimension']['__object']($key)->setCollapsed($value); }; - $this->mappings['columnDimension']['columnIndex'] = function ($key, $value) use ($wrapper) { - $wrapper->mappings['columnDimension']['__object']($key)->setColumnIndex($value); + $this->mappings['columnDimension']['columnIndex'] = function ($key, $value) { + $this->mappings['columnDimension']['__object']($key)->setColumnIndex($value); }; - $this->mappings['columnDimension']['outlineLevel'] = function ($key, $value) use ($wrapper) { - $wrapper->mappings['columnDimension']['__object']($key)->setOutlineLevel($value); + $this->mappings['columnDimension']['outlineLevel'] = function ($key, $value) { + $this->mappings['columnDimension']['__object']($key)->setOutlineLevel($value); }; - $this->mappings['columnDimension']['visible'] = function ($key, $value) use ($wrapper) { - $wrapper->mappings['columnDimension']['__object']($key)->setVisible($value); + $this->mappings['columnDimension']['visible'] = function ($key, $value) { + $this->mappings['columnDimension']['__object']($key)->setVisible($value); }; - $this->mappings['columnDimension']['width'] = function ($key, $value) use ($wrapper) { - $wrapper->mappings['columnDimension']['__object']($key)->setWidth($value); + $this->mappings['columnDimension']['width'] = function ($key, $value) { + $this->mappings['columnDimension']['__object']($key)->setWidth($value); }; - $this->mappings['columnDimension']['xfIndex'] = function ($key, $value) use ($wrapper) { - $wrapper->mappings['columnDimension']['__object']($key)->setXfIndex($value); + $this->mappings['columnDimension']['xfIndex'] = function ($key, $value) { + $this->mappings['columnDimension']['__object']($key)->setXfIndex($value); }; - $this->mappings['pageMargins']['top'] = function ($value) use ($wrapper) { - $wrapper->object->getPageMargins()->setTop($value); + $this->mappings['pageMargins']['top'] = function ($value) { + $this->object->getPageMargins()->setTop($value); }; - $this->mappings['pageMargins']['bottom'] = function ($value) use ($wrapper) { - $wrapper->object->getPageMargins()->setBottom($value); + $this->mappings['pageMargins']['bottom'] = function ($value) { + $this->object->getPageMargins()->setBottom($value); }; - $this->mappings['pageMargins']['left'] = function ($value) use ($wrapper) { - $wrapper->object->getPageMargins()->setLeft($value); + $this->mappings['pageMargins']['left'] = function ($value) { + $this->object->getPageMargins()->setLeft($value); }; - $this->mappings['pageMargins']['right'] = function ($value) use ($wrapper) { - $wrapper->object->getPageMargins()->setRight($value); + $this->mappings['pageMargins']['right'] = function ($value) { + $this->object->getPageMargins()->setRight($value); }; - $this->mappings['pageMargins']['header'] = function ($value) use ($wrapper) { - $wrapper->object->getPageMargins()->setHeader($value); + $this->mappings['pageMargins']['header'] = function ($value) { + $this->object->getPageMargins()->setHeader($value); }; - $this->mappings['pageMargins']['footer'] = function ($value) use ($wrapper) { - $wrapper->object->getPageMargins()->setFooter($value); + $this->mappings['pageMargins']['footer'] = function ($value) { + $this->object->getPageMargins()->setFooter($value); }; - $this->mappings['pageSetup']['fitToHeight'] = function ($value) use ($wrapper) { - $wrapper->object->getPageSetup()->setFitToHeight($value); + $this->mappings['pageSetup']['fitToHeight'] = function ($value) { + $this->object->getPageSetup()->setFitToHeight($value); }; - $this->mappings['pageSetup']['fitToPage'] = function ($value) use ($wrapper) { - $wrapper->object->getPageSetup()->setFitToPage($value); + $this->mappings['pageSetup']['fitToPage'] = function ($value) { + $this->object->getPageSetup()->setFitToPage($value); }; - $this->mappings['pageSetup']['fitToWidth'] = function ($value) use ($wrapper) { - $wrapper->object->getPageSetup()->setFitToWidth($value); + $this->mappings['pageSetup']['fitToWidth'] = function ($value) { + $this->object->getPageSetup()->setFitToWidth($value); }; - $this->mappings['pageSetup']['horizontalCentered'] = function ($value) use ($wrapper) { - $wrapper->object->getPageSetup()->setHorizontalCentered($value); + $this->mappings['pageSetup']['horizontalCentered'] = function ($value) { + $this->object->getPageSetup()->setHorizontalCentered($value); }; - $this->mappings['pageSetup']['orientation'] = function ($value) use ($wrapper) { - $wrapper->object->getPageSetup()->setOrientation($value); + $this->mappings['pageSetup']['orientation'] = function ($value) { + $this->object->getPageSetup()->setOrientation($value); }; - $this->mappings['pageSetup']['paperSize'] = function ($value) use ($wrapper) { - $wrapper->object->getPageSetup()->setPaperSize($value); + $this->mappings['pageSetup']['paperSize'] = function ($value) { + $this->object->getPageSetup()->setPaperSize($value); }; - $this->mappings['pageSetup']['printArea'] = function ($value) use ($wrapper) { - $wrapper->object->getPageSetup()->setPrintArea($value); + $this->mappings['pageSetup']['printArea'] = function ($value) { + $this->object->getPageSetup()->setPrintArea($value); }; - $this->mappings['pageSetup']['scale'] = function ($value) use ($wrapper) { - $wrapper->object->getPageSetup()->setScale($value); + $this->mappings['pageSetup']['scale'] = function ($value) { + $this->object->getPageSetup()->setScale($value); }; - $this->mappings['pageSetup']['verticalCentered'] = function ($value) use ($wrapper) { - $wrapper->object->getPageSetup()->setVerticalCentered($value); + $this->mappings['pageSetup']['verticalCentered'] = function ($value) { + $this->object->getPageSetup()->setVerticalCentered($value); }; - $this->mappings['printGridlines'] = function ($value) use ($wrapper) { - $wrapper->object->setPrintGridlines($value); + $this->mappings['printGridlines'] = function ($value) { + $this->object->setPrintGridlines($value); }; - $this->mappings['protection']['autoFilter'] = function ($value) use ($wrapper) { - $wrapper->object->getProtection()->setAutoFilter($value); + $this->mappings['protection']['autoFilter'] = function ($value) { + $this->object->getProtection()->setAutoFilter($value); }; - $this->mappings['protection']['deleteColumns'] = function ($value) use ($wrapper) { - $wrapper->object->getProtection()->setDeleteColumns($value); + $this->mappings['protection']['deleteColumns'] = function ($value) { + $this->object->getProtection()->setDeleteColumns($value); }; - $this->mappings['protection']['deleteRows'] = function ($value) use ($wrapper) { - $wrapper->object->getProtection()->setDeleteRows($value); + $this->mappings['protection']['deleteRows'] = function ($value) { + $this->object->getProtection()->setDeleteRows($value); }; - $this->mappings['protection']['formatCells'] = function ($value) use ($wrapper) { - $wrapper->object->getProtection()->setFormatCells($value); + $this->mappings['protection']['formatCells'] = function ($value) { + $this->object->getProtection()->setFormatCells($value); }; - $this->mappings['protection']['formatColumns'] = function ($value) use ($wrapper) { - $wrapper->object->getProtection()->setFormatColumns($value); + $this->mappings['protection']['formatColumns'] = function ($value) { + $this->object->getProtection()->setFormatColumns($value); }; - $this->mappings['protection']['formatRows'] = function ($value) use ($wrapper) { - $wrapper->object->getProtection()->setFormatRows($value); + $this->mappings['protection']['formatRows'] = function ($value) { + $this->object->getProtection()->setFormatRows($value); }; - $this->mappings['protection']['insertColumns'] = function ($value) use ($wrapper) { - $wrapper->object->getProtection()->setInsertColumns($value); + $this->mappings['protection']['insertColumns'] = function ($value) { + $this->object->getProtection()->setInsertColumns($value); }; - $this->mappings['protection']['insertHyperlinks'] = function ($value) use ($wrapper) { - $wrapper->object->getProtection()->setInsertHyperlinks($value); + $this->mappings['protection']['insertHyperlinks'] = function ($value) { + $this->object->getProtection()->setInsertHyperlinks($value); }; - $this->mappings['protection']['insertRows'] = function ($value) use ($wrapper) { - $wrapper->object->getProtection()->setInsertRows($value); + $this->mappings['protection']['insertRows'] = function ($value) { + $this->object->getProtection()->setInsertRows($value); }; - $this->mappings['protection']['objects'] = function ($value) use ($wrapper) { - $wrapper->object->getProtection()->setObjects($value); + $this->mappings['protection']['objects'] = function ($value) { + $this->object->getProtection()->setObjects($value); }; - $this->mappings['protection']['password'] = function ($value) use ($wrapper) { - $wrapper->object->getProtection()->setPassword($value); + $this->mappings['protection']['password'] = function ($value) { + $this->object->getProtection()->setPassword($value); }; - $this->mappings['protection']['pivotTables'] = function ($value) use ($wrapper) { - $wrapper->object->getProtection()->setPivotTables($value); + $this->mappings['protection']['pivotTables'] = function ($value) { + $this->object->getProtection()->setPivotTables($value); }; - $this->mappings['protection']['scenarios'] = function ($value) use ($wrapper) { - $wrapper->object->getProtection()->setScenarios($value); + $this->mappings['protection']['scenarios'] = function ($value) { + $this->object->getProtection()->setScenarios($value); }; - $this->mappings['protection']['selectLockedCells'] = function ($value) use ($wrapper) { - $wrapper->object->getProtection()->setSelectLockedCells($value); + $this->mappings['protection']['selectLockedCells'] = function ($value) { + $this->object->getProtection()->setSelectLockedCells($value); }; - $this->mappings['protection']['selectUnlockedCells'] = function ($value) use ($wrapper) { - $wrapper->object->getProtection()->setSelectUnlockedCells($value); + $this->mappings['protection']['selectUnlockedCells'] = function ($value) { + $this->object->getProtection()->setSelectUnlockedCells($value); }; - $this->mappings['protection']['sheet'] = function ($value) use ($wrapper) { - $wrapper->object->getProtection()->setSheet($value); + $this->mappings['protection']['sheet'] = function ($value) { + $this->object->getProtection()->setSheet($value); }; - $this->mappings['protection']['sort'] = function ($value) use ($wrapper) { - $wrapper->object->getProtection()->setSort($value); + $this->mappings['protection']['sort'] = function ($value) { + $this->object->getProtection()->setSort($value); }; - $this->mappings['rightToLeft'] = function ($value) use ($wrapper) { - $wrapper->object->setRightToLeft($value); + $this->mappings['rightToLeft'] = function ($value) { + $this->object->setRightToLeft($value); }; $this->mappings['rowDimension']['__multi'] = true; - $this->mappings['rowDimension']['__object'] = function ($key) use ($wrapper) { - return $key === 'default' ? $wrapper->object->getDefaultRowDimension() : $wrapper->object->getRowDimension($key); + $this->mappings['rowDimension']['__object'] = function ($key) { + return $key === 'default' ? $this->object->getDefaultRowDimension() : $this->object->getRowDimension($key); }; - $this->mappings['rowDimension']['collapsed'] = function ($key, $value) use ($wrapper) { - $wrapper->mappings['rowDimension']['__object']($key)->setCollapsed($value); + $this->mappings['rowDimension']['collapsed'] = function ($key, $value) { + $this->mappings['rowDimension']['__object']($key)->setCollapsed($value); }; - $this->mappings['rowDimension']['outlineLevel'] = function ($key, $value) use ($wrapper) { - $wrapper->mappings['rowDimension']['__object']($key)->setOutlineLevel($value); + $this->mappings['rowDimension']['outlineLevel'] = function ($key, $value) { + $this->mappings['rowDimension']['__object']($key)->setOutlineLevel($value); }; - $this->mappings['rowDimension']['rowHeight'] = function ($key, $value) use ($wrapper) { - $wrapper->mappings['rowDimension']['__object']($key)->setRowHeight($value); + $this->mappings['rowDimension']['rowHeight'] = function ($key, $value) { + $this->mappings['rowDimension']['__object']($key)->setRowHeight($value); }; - $this->mappings['rowDimension']['rowIndex'] = function ($key, $value) use ($wrapper) { - $wrapper->mappings['rowDimension']['__object']($key)->setRowIndex($value); + $this->mappings['rowDimension']['rowIndex'] = function ($key, $value) { + $this->mappings['rowDimension']['__object']($key)->setRowIndex($value); }; - $this->mappings['rowDimension']['visible'] = function ($key, $value) use ($wrapper) { - $wrapper->mappings['rowDimension']['__object']($key)->setVisible($value); + $this->mappings['rowDimension']['visible'] = function ($key, $value) { + $this->mappings['rowDimension']['__object']($key)->setVisible($value); }; - $this->mappings['rowDimension']['xfIndex'] = function ($key, $value) use ($wrapper) { - $wrapper->mappings['rowDimension']['__object']($key)->setXfIndex($value); + $this->mappings['rowDimension']['xfIndex'] = function ($key, $value) { + $this->mappings['rowDimension']['__object']($key)->setXfIndex($value); }; - $this->mappings['rowDimension']['zeroHeight'] = function ($key, $value) use ($wrapper) { - $wrapper->mappings['rowDimension']['__object']($key)->setZeroHeight($value); + $this->mappings['rowDimension']['zeroHeight'] = function ($key, $value) { + $this->mappings['rowDimension']['__object']($key)->setZeroHeight($value); }; - $this->mappings['sheetState'] = function ($value) use ($wrapper) { - $wrapper->object->setSheetState($value); + $this->mappings['sheetState'] = function ($value) { + $this->object->setSheetState($value); }; - $this->mappings['showGridlines'] = function ($value) use ($wrapper) { - $wrapper->object->setShowGridlines($value); + $this->mappings['showGridlines'] = function ($value) { + $this->object->setShowGridlines($value); }; - $this->mappings['tabColor'] = function ($value) use ($wrapper) { - $wrapper->object->getTabColor()->setRGB($value); + $this->mappings['tabColor'] = function ($value) { + $this->object->getTabColor()->setRGB($value); }; - $this->mappings['zoomScale'] = function ($value) use ($wrapper) { - $wrapper->object->getSheetView()->setZoomScale($value); + $this->mappings['zoomScale'] = function ($value) { + $this->object->getSheetView()->setZoomScale($value); }; } /** * @param $index - * @param array $properties + * @param array|null $properties + * @throws \PHPExcel_Exception */ public function start($index, array $properties = null) {