@@ -20,7 +20,8 @@ |
||
20 | 20 | */ |
21 | 21 | protected function parseBody() |
22 | 22 | { |
23 | - $body = $this->parser->subparse(function (Twig_Token $token) { |
|
23 | + $body = $this->parser->subparse(function (Twig_Token $token) |
|
24 | + { |
|
24 | 25 | return $token->test('end' . $this->getTag()); |
25 | 26 | }, |
26 | 27 | true); |
@@ -55,52 +55,68 @@ |
||
55 | 55 | |
56 | 56 | protected function initializeMappings() |
57 | 57 | { |
58 | - $this->mappings['coordinates'] = function ($value) { |
|
58 | + $this->mappings['coordinates'] = function ($value) |
|
59 | + { |
|
59 | 60 | $this->object->setCoordinates($value); |
60 | 61 | }; |
61 | - $this->mappings['description'] = function ($value) { |
|
62 | + $this->mappings['description'] = function ($value) |
|
63 | + { |
|
62 | 64 | $this->object->setDescription($value); |
63 | 65 | }; |
64 | - $this->mappings['height'] = function ($value) { |
|
66 | + $this->mappings['height'] = function ($value) |
|
67 | + { |
|
65 | 68 | $this->object->setHeight($value); |
66 | 69 | }; |
67 | - $this->mappings['name'] = function ($value) { |
|
70 | + $this->mappings['name'] = function ($value) |
|
71 | + { |
|
68 | 72 | $this->object->setName($value); |
69 | 73 | }; |
70 | - $this->mappings['offsetX'] = function ($value) { |
|
74 | + $this->mappings['offsetX'] = function ($value) |
|
75 | + { |
|
71 | 76 | $this->object->setOffsetX($value); |
72 | 77 | }; |
73 | - $this->mappings['offsetY'] = function ($value) { |
|
78 | + $this->mappings['offsetY'] = function ($value) |
|
79 | + { |
|
74 | 80 | $this->object->setOffsetY($value); |
75 | 81 | }; |
76 | - $this->mappings['resizeProportional'] = function ($value) { |
|
82 | + $this->mappings['resizeProportional'] = function ($value) |
|
83 | + { |
|
77 | 84 | $this->object->setResizeProportional($value); |
78 | 85 | }; |
79 | - $this->mappings['rotation'] = function ($value) { |
|
86 | + $this->mappings['rotation'] = function ($value) |
|
87 | + { |
|
80 | 88 | $this->object->setRotation($value); |
81 | 89 | }; |
82 | - $this->mappings['shadow']['alignment'] = function ($value) { |
|
90 | + $this->mappings['shadow']['alignment'] = function ($value) |
|
91 | + { |
|
83 | 92 | $this->object->getShadow()->setAlignment($value); |
84 | 93 | }; |
85 | - $this->mappings['shadow']['alpha'] = function ($value) { |
|
94 | + $this->mappings['shadow']['alpha'] = function ($value) |
|
95 | + { |
|
86 | 96 | $this->object->getShadow()->setAlpha($value); |
87 | 97 | }; |
88 | - $this->mappings['shadow']['blurRadius'] = function ($value) { |
|
98 | + $this->mappings['shadow']['blurRadius'] = function ($value) |
|
99 | + { |
|
89 | 100 | $this->object->getShadow()->setBlurRadius($value); |
90 | 101 | }; |
91 | - $this->mappings['shadow']['color'] = function ($value) { |
|
102 | + $this->mappings['shadow']['color'] = function ($value) |
|
103 | + { |
|
92 | 104 | $this->object->getShadow()->getColor()->setRGB($value); |
93 | 105 | }; |
94 | - $this->mappings['shadow']['direction'] = function ($value) { |
|
106 | + $this->mappings['shadow']['direction'] = function ($value) |
|
107 | + { |
|
95 | 108 | $this->object->getShadow()->setDirection($value); |
96 | 109 | }; |
97 | - $this->mappings['shadow']['distance'] = function ($value) { |
|
110 | + $this->mappings['shadow']['distance'] = function ($value) |
|
111 | + { |
|
98 | 112 | $this->object->getShadow()->setDistance($value); |
99 | 113 | }; |
100 | - $this->mappings['shadow']['visible'] = function ($value) { |
|
114 | + $this->mappings['shadow']['visible'] = function ($value) |
|
115 | + { |
|
101 | 116 | $this->object->getShadow()->setVisible($value); |
102 | 117 | }; |
103 | - $this->mappings['width'] = function ($value) { |
|
118 | + $this->mappings['width'] = function ($value) |
|
119 | + { |
|
104 | 120 | $this->object->setWidth($value); |
105 | 121 | }; |
106 | 122 | } |
@@ -56,10 +56,12 @@ |
||
56 | 56 | |
57 | 57 | protected function initializeMappings() |
58 | 58 | { |
59 | - $this->mappings['scaleWithDocument'] = function ($value) { |
|
59 | + $this->mappings['scaleWithDocument'] = function ($value) |
|
60 | + { |
|
60 | 61 | $this->object->setScaleWithDocument($value); |
61 | 62 | }; |
62 | - $this->mappings['alignWithMargins'] = function ($value) { |
|
63 | + $this->mappings['alignWithMargins'] = function ($value) |
|
64 | + { |
|
63 | 65 | $this->object->setAlignWithMargins($value); |
64 | 66 | }; |
65 | 67 | } |
@@ -58,61 +58,80 @@ |
||
58 | 58 | |
59 | 59 | protected function initializeMappings() |
60 | 60 | { |
61 | - $this->mappings['category'] = function ($value) { |
|
61 | + $this->mappings['category'] = function ($value) |
|
62 | + { |
|
62 | 63 | $this->object->getProperties()->setCategory($value); |
63 | 64 | }; |
64 | - $this->mappings['company'] = function ($value) { |
|
65 | + $this->mappings['company'] = function ($value) |
|
66 | + { |
|
65 | 67 | $this->object->getProperties()->setCompany($value); |
66 | 68 | }; |
67 | - $this->mappings['created'] = function ($value) { |
|
69 | + $this->mappings['created'] = function ($value) |
|
70 | + { |
|
68 | 71 | $this->object->getProperties()->setCreated($value); |
69 | 72 | }; |
70 | - $this->mappings['creator'] = function ($value) { |
|
73 | + $this->mappings['creator'] = function ($value) |
|
74 | + { |
|
71 | 75 | $this->object->getProperties()->setCreator($value); |
72 | 76 | }; |
73 | - $this->mappings['defaultStyle'] = function ($value) { |
|
77 | + $this->mappings['defaultStyle'] = function ($value) |
|
78 | + { |
|
74 | 79 | $this->object->getDefaultStyle()->applyFromArray($value); |
75 | 80 | }; |
76 | - $this->mappings['description'] = function ($value) { |
|
81 | + $this->mappings['description'] = function ($value) |
|
82 | + { |
|
77 | 83 | $this->object->getProperties()->setDescription($value); |
78 | 84 | }; |
79 | - $this->mappings['format'] = function ($value) { |
|
85 | + $this->mappings['format'] = function ($value) |
|
86 | + { |
|
80 | 87 | $this->attributes['format'] = $value; |
81 | 88 | }; |
82 | - $this->mappings['keywords'] = function ($value) { |
|
89 | + $this->mappings['keywords'] = function ($value) |
|
90 | + { |
|
83 | 91 | $this->object->getProperties()->setKeywords($value); |
84 | 92 | }; |
85 | - $this->mappings['lastModifiedBy'] = function ($value) { |
|
93 | + $this->mappings['lastModifiedBy'] = function ($value) |
|
94 | + { |
|
86 | 95 | $this->object->getProperties()->setLastModifiedBy($value); |
87 | 96 | }; |
88 | - $this->mappings['manager'] = function ($value) { |
|
97 | + $this->mappings['manager'] = function ($value) |
|
98 | + { |
|
89 | 99 | $this->object->getProperties()->setManager($value); |
90 | 100 | }; |
91 | - $this->mappings['modified'] = function ($value) { |
|
101 | + $this->mappings['modified'] = function ($value) |
|
102 | + { |
|
92 | 103 | $this->object->getProperties()->setModified($value); |
93 | 104 | }; |
94 | - $this->mappings['security']['lockRevision'] = function ($value) { |
|
105 | + $this->mappings['security']['lockRevision'] = function ($value) |
|
106 | + { |
|
95 | 107 | $this->object->getSecurity()->setLockRevision($value); |
96 | 108 | }; |
97 | - $this->mappings['security']['lockStructure'] = function ($value) { |
|
109 | + $this->mappings['security']['lockStructure'] = function ($value) |
|
110 | + { |
|
98 | 111 | $this->object->getSecurity()->setLockStructure($value); |
99 | 112 | }; |
100 | - $this->mappings['security']['lockWindows'] = function ($value) { |
|
113 | + $this->mappings['security']['lockWindows'] = function ($value) |
|
114 | + { |
|
101 | 115 | $this->object->getSecurity()->setLockWindows($value); |
102 | 116 | }; |
103 | - $this->mappings['security']['revisionsPassword'] = function ($value) { |
|
117 | + $this->mappings['security']['revisionsPassword'] = function ($value) |
|
118 | + { |
|
104 | 119 | $this->object->getSecurity()->setRevisionsPassword($value); |
105 | 120 | }; |
106 | - $this->mappings['security']['workbookPassword'] = function ($value) { |
|
121 | + $this->mappings['security']['workbookPassword'] = function ($value) |
|
122 | + { |
|
107 | 123 | $this->object->getSecurity()->setWorkbookPassword($value); |
108 | 124 | }; |
109 | - $this->mappings['subject'] = function ($value) { |
|
125 | + $this->mappings['subject'] = function ($value) |
|
126 | + { |
|
110 | 127 | $this->object->getProperties()->setSubject($value); |
111 | 128 | }; |
112 | - $this->mappings['template'] = function ($value) { |
|
129 | + $this->mappings['template'] = function ($value) |
|
130 | + { |
|
113 | 131 | $this->attributes['template'] = $value; |
114 | 132 | }; |
115 | - $this->mappings['title'] = function ($value) { |
|
133 | + $this->mappings['title'] = function ($value) |
|
134 | + { |
|
116 | 135 | $this->object->getProperties()->setTitle($value); |
117 | 136 | }; |
118 | 137 | } |
@@ -60,61 +60,79 @@ |
||
60 | 60 | |
61 | 61 | protected function initializeMappings() |
62 | 62 | { |
63 | - $this->mappings['break'] = function ($value) { |
|
63 | + $this->mappings['break'] = function ($value) |
|
64 | + { |
|
64 | 65 | $this->sheetWrapper->getObject()->setBreak($this->object->getCoordinate(), $value); |
65 | 66 | }; |
66 | - $this->mappings['dataType'] = function ($value) { |
|
67 | + $this->mappings['dataType'] = function ($value) |
|
68 | + { |
|
67 | 69 | $this->object->setDataType($value); |
68 | 70 | }; |
69 | - $this->mappings['dataValidation']['allowBlank'] = function ($value) { |
|
71 | + $this->mappings['dataValidation']['allowBlank'] = function ($value) |
|
72 | + { |
|
70 | 73 | $this->object->getDataValidation()->setAllowBlank($value); |
71 | 74 | }; |
72 | - $this->mappings['dataValidation']['error'] = function ($value) { |
|
75 | + $this->mappings['dataValidation']['error'] = function ($value) |
|
76 | + { |
|
73 | 77 | $this->object->getDataValidation()->setError($value); |
74 | 78 | }; |
75 | - $this->mappings['dataValidation']['errorStyle'] = function ($value) { |
|
79 | + $this->mappings['dataValidation']['errorStyle'] = function ($value) |
|
80 | + { |
|
76 | 81 | $this->object->getDataValidation()->setErrorStyle($value); |
77 | 82 | }; |
78 | - $this->mappings['dataValidation']['errorTitle'] = function ($value) { |
|
83 | + $this->mappings['dataValidation']['errorTitle'] = function ($value) |
|
84 | + { |
|
79 | 85 | $this->object->getDataValidation()->setErrorTitle($value); |
80 | 86 | }; |
81 | - $this->mappings['dataValidation']['formula1'] = function ($value) { |
|
87 | + $this->mappings['dataValidation']['formula1'] = function ($value) |
|
88 | + { |
|
82 | 89 | $this->object->getDataValidation()->setFormula1($value); |
83 | 90 | }; |
84 | - $this->mappings['dataValidation']['formula2'] = function ($value) { |
|
91 | + $this->mappings['dataValidation']['formula2'] = function ($value) |
|
92 | + { |
|
85 | 93 | $this->object->getDataValidation()->setFormula2($value); |
86 | 94 | }; |
87 | - $this->mappings['dataValidation']['operator'] = function ($value) { |
|
95 | + $this->mappings['dataValidation']['operator'] = function ($value) |
|
96 | + { |
|
88 | 97 | $this->object->getDataValidation()->setOperator($value); |
89 | 98 | }; |
90 | - $this->mappings['dataValidation']['prompt'] = function ($value) { |
|
99 | + $this->mappings['dataValidation']['prompt'] = function ($value) |
|
100 | + { |
|
91 | 101 | $this->object->getDataValidation()->setPrompt($value); |
92 | 102 | }; |
93 | - $this->mappings['dataValidation']['promptTitle'] = function ($value) { |
|
103 | + $this->mappings['dataValidation']['promptTitle'] = function ($value) |
|
104 | + { |
|
94 | 105 | $this->object->getDataValidation()->setPromptTitle($value); |
95 | 106 | }; |
96 | - $this->mappings['dataValidation']['showDropDown'] = function ($value) { |
|
107 | + $this->mappings['dataValidation']['showDropDown'] = function ($value) |
|
108 | + { |
|
97 | 109 | $this->object->getDataValidation()->setShowDropDown($value); |
98 | 110 | }; |
99 | - $this->mappings['dataValidation']['showErrorMessage'] = function ($value) { |
|
111 | + $this->mappings['dataValidation']['showErrorMessage'] = function ($value) |
|
112 | + { |
|
100 | 113 | $this->object->getDataValidation()->setShowErrorMessage($value); |
101 | 114 | }; |
102 | - $this->mappings['dataValidation']['showInputMessage'] = function ($value) { |
|
115 | + $this->mappings['dataValidation']['showInputMessage'] = function ($value) |
|
116 | + { |
|
103 | 117 | $this->object->getDataValidation()->setShowInputMessage($value); |
104 | 118 | }; |
105 | - $this->mappings['dataValidation']['type'] = function ($value) { |
|
119 | + $this->mappings['dataValidation']['type'] = function ($value) |
|
120 | + { |
|
106 | 121 | $this->object->getDataValidation()->setType($value); |
107 | 122 | }; |
108 | - $this->mappings['merge'] = function ($value) { |
|
123 | + $this->mappings['merge'] = function ($value) |
|
124 | + { |
|
109 | 125 | if (is_int($value)) { |
110 | 126 | $value = PHPExcel_Cell::stringFromColumnIndex($value) . $this->sheetWrapper->getRow(); |
111 | 127 | } |
112 | 128 | $this->sheetWrapper->getObject()->mergeCells(sprintf('%s:%s', $this->object->getCoordinate(), $value)); |
113 | 129 | }; |
114 | - $this->mappings['style'] = function ($value) { |
|
130 | + $this->mappings['style'] = function ($value) |
|
131 | + { |
|
115 | 132 | $this->sheetWrapper->getObject()->getStyle($this->object->getCoordinate())->applyFromArray($value); |
116 | 133 | }; |
117 | - $this->mappings['url'] = function ($value) { |
|
134 | + $this->mappings['url'] = function ($value) |
|
135 | + { |
|
118 | 136 | $this->object->getHyperlink()->setUrl($value); |
119 | 137 | }; |
120 | 138 | } |
@@ -77,171 +77,226 @@ discard block |
||
77 | 77 | |
78 | 78 | protected function initializeMappings() |
79 | 79 | { |
80 | - $this->mappings['autoFilter'] = function ($value) { |
|
80 | + $this->mappings['autoFilter'] = function ($value) |
|
81 | + { |
|
81 | 82 | $this->object->setAutoFilter($value); |
82 | 83 | }; |
83 | 84 | $this->mappings['columnDimension']['__multi'] = true; |
84 | - $this->mappings['columnDimension']['__object'] = function ($key = 'default') { |
|
85 | + $this->mappings['columnDimension']['__object'] = function ($key = 'default') |
|
86 | + { |
|
85 | 87 | return $key === 'default' ? $this->object->getDefaultColumnDimension() : $this->object->getColumnDimension($key); |
86 | 88 | }; |
87 | - $this->mappings['columnDimension']['autoSize'] = function ($key, $value) { |
|
89 | + $this->mappings['columnDimension']['autoSize'] = function ($key, $value) |
|
90 | + { |
|
88 | 91 | $this->mappings['columnDimension']['__object']($key)->setAutoSize($value); |
89 | 92 | }; |
90 | - $this->mappings['columnDimension']['collapsed'] = function ($key, $value) { |
|
93 | + $this->mappings['columnDimension']['collapsed'] = function ($key, $value) |
|
94 | + { |
|
91 | 95 | $this->mappings['columnDimension']['__object']($key)->setCollapsed($value); |
92 | 96 | }; |
93 | - $this->mappings['columnDimension']['columnIndex'] = function ($key, $value) { |
|
97 | + $this->mappings['columnDimension']['columnIndex'] = function ($key, $value) |
|
98 | + { |
|
94 | 99 | $this->mappings['columnDimension']['__object']($key)->setColumnIndex($value); |
95 | 100 | }; |
96 | - $this->mappings['columnDimension']['outlineLevel'] = function ($key, $value) { |
|
101 | + $this->mappings['columnDimension']['outlineLevel'] = function ($key, $value) |
|
102 | + { |
|
97 | 103 | $this->mappings['columnDimension']['__object']($key)->setOutlineLevel($value); |
98 | 104 | }; |
99 | - $this->mappings['columnDimension']['visible'] = function ($key, $value) { |
|
105 | + $this->mappings['columnDimension']['visible'] = function ($key, $value) |
|
106 | + { |
|
100 | 107 | $this->mappings['columnDimension']['__object']($key)->setVisible($value); |
101 | 108 | }; |
102 | - $this->mappings['columnDimension']['width'] = function ($key, $value) { |
|
109 | + $this->mappings['columnDimension']['width'] = function ($key, $value) |
|
110 | + { |
|
103 | 111 | $this->mappings['columnDimension']['__object']($key)->setWidth($value); |
104 | 112 | }; |
105 | - $this->mappings['columnDimension']['xfIndex'] = function ($key, $value) { |
|
113 | + $this->mappings['columnDimension']['xfIndex'] = function ($key, $value) |
|
114 | + { |
|
106 | 115 | $this->mappings['columnDimension']['__object']($key)->setXfIndex($value); |
107 | 116 | }; |
108 | - $this->mappings['pageMargins']['top'] = function ($value) { |
|
117 | + $this->mappings['pageMargins']['top'] = function ($value) |
|
118 | + { |
|
109 | 119 | $this->object->getPageMargins()->setTop($value); |
110 | 120 | }; |
111 | - $this->mappings['pageMargins']['bottom'] = function ($value) { |
|
121 | + $this->mappings['pageMargins']['bottom'] = function ($value) |
|
122 | + { |
|
112 | 123 | $this->object->getPageMargins()->setBottom($value); |
113 | 124 | }; |
114 | - $this->mappings['pageMargins']['left'] = function ($value) { |
|
125 | + $this->mappings['pageMargins']['left'] = function ($value) |
|
126 | + { |
|
115 | 127 | $this->object->getPageMargins()->setLeft($value); |
116 | 128 | }; |
117 | - $this->mappings['pageMargins']['right'] = function ($value) { |
|
129 | + $this->mappings['pageMargins']['right'] = function ($value) |
|
130 | + { |
|
118 | 131 | $this->object->getPageMargins()->setRight($value); |
119 | 132 | }; |
120 | - $this->mappings['pageMargins']['header'] = function ($value) { |
|
133 | + $this->mappings['pageMargins']['header'] = function ($value) |
|
134 | + { |
|
121 | 135 | $this->object->getPageMargins()->setHeader($value); |
122 | 136 | }; |
123 | - $this->mappings['pageMargins']['footer'] = function ($value) { |
|
137 | + $this->mappings['pageMargins']['footer'] = function ($value) |
|
138 | + { |
|
124 | 139 | $this->object->getPageMargins()->setFooter($value); |
125 | 140 | }; |
126 | - $this->mappings['pageSetup']['fitToHeight'] = function ($value) { |
|
141 | + $this->mappings['pageSetup']['fitToHeight'] = function ($value) |
|
142 | + { |
|
127 | 143 | $this->object->getPageSetup()->setFitToHeight($value); |
128 | 144 | }; |
129 | - $this->mappings['pageSetup']['fitToPage'] = function ($value) { |
|
145 | + $this->mappings['pageSetup']['fitToPage'] = function ($value) |
|
146 | + { |
|
130 | 147 | $this->object->getPageSetup()->setFitToPage($value); |
131 | 148 | }; |
132 | - $this->mappings['pageSetup']['fitToWidth'] = function ($value) { |
|
149 | + $this->mappings['pageSetup']['fitToWidth'] = function ($value) |
|
150 | + { |
|
133 | 151 | $this->object->getPageSetup()->setFitToWidth($value); |
134 | 152 | }; |
135 | - $this->mappings['pageSetup']['horizontalCentered'] = function ($value) { |
|
153 | + $this->mappings['pageSetup']['horizontalCentered'] = function ($value) |
|
154 | + { |
|
136 | 155 | $this->object->getPageSetup()->setHorizontalCentered($value); |
137 | 156 | }; |
138 | - $this->mappings['pageSetup']['orientation'] = function ($value) { |
|
157 | + $this->mappings['pageSetup']['orientation'] = function ($value) |
|
158 | + { |
|
139 | 159 | $this->object->getPageSetup()->setOrientation($value); |
140 | 160 | }; |
141 | - $this->mappings['pageSetup']['paperSize'] = function ($value) { |
|
161 | + $this->mappings['pageSetup']['paperSize'] = function ($value) |
|
162 | + { |
|
142 | 163 | $this->object->getPageSetup()->setPaperSize($value); |
143 | 164 | }; |
144 | - $this->mappings['pageSetup']['printArea'] = function ($value) { |
|
165 | + $this->mappings['pageSetup']['printArea'] = function ($value) |
|
166 | + { |
|
145 | 167 | $this->object->getPageSetup()->setPrintArea($value); |
146 | 168 | }; |
147 | - $this->mappings['pageSetup']['scale'] = function ($value) { |
|
169 | + $this->mappings['pageSetup']['scale'] = function ($value) |
|
170 | + { |
|
148 | 171 | $this->object->getPageSetup()->setScale($value); |
149 | 172 | }; |
150 | - $this->mappings['pageSetup']['verticalCentered'] = function ($value) { |
|
173 | + $this->mappings['pageSetup']['verticalCentered'] = function ($value) |
|
174 | + { |
|
151 | 175 | $this->object->getPageSetup()->setVerticalCentered($value); |
152 | 176 | }; |
153 | - $this->mappings['printGridlines'] = function ($value) { |
|
177 | + $this->mappings['printGridlines'] = function ($value) |
|
178 | + { |
|
154 | 179 | $this->object->setPrintGridlines($value); |
155 | 180 | }; |
156 | - $this->mappings['protection']['autoFilter'] = function ($value) { |
|
181 | + $this->mappings['protection']['autoFilter'] = function ($value) |
|
182 | + { |
|
157 | 183 | $this->object->getProtection()->setAutoFilter($value); |
158 | 184 | }; |
159 | - $this->mappings['protection']['deleteColumns'] = function ($value) { |
|
185 | + $this->mappings['protection']['deleteColumns'] = function ($value) |
|
186 | + { |
|
160 | 187 | $this->object->getProtection()->setDeleteColumns($value); |
161 | 188 | }; |
162 | - $this->mappings['protection']['deleteRows'] = function ($value) { |
|
189 | + $this->mappings['protection']['deleteRows'] = function ($value) |
|
190 | + { |
|
163 | 191 | $this->object->getProtection()->setDeleteRows($value); |
164 | 192 | }; |
165 | - $this->mappings['protection']['formatCells'] = function ($value) { |
|
193 | + $this->mappings['protection']['formatCells'] = function ($value) |
|
194 | + { |
|
166 | 195 | $this->object->getProtection()->setFormatCells($value); |
167 | 196 | }; |
168 | - $this->mappings['protection']['formatColumns'] = function ($value) { |
|
197 | + $this->mappings['protection']['formatColumns'] = function ($value) |
|
198 | + { |
|
169 | 199 | $this->object->getProtection()->setFormatColumns($value); |
170 | 200 | }; |
171 | - $this->mappings['protection']['formatRows'] = function ($value) { |
|
201 | + $this->mappings['protection']['formatRows'] = function ($value) |
|
202 | + { |
|
172 | 203 | $this->object->getProtection()->setFormatRows($value); |
173 | 204 | }; |
174 | - $this->mappings['protection']['insertColumns'] = function ($value) { |
|
205 | + $this->mappings['protection']['insertColumns'] = function ($value) |
|
206 | + { |
|
175 | 207 | $this->object->getProtection()->setInsertColumns($value); |
176 | 208 | }; |
177 | - $this->mappings['protection']['insertHyperlinks'] = function ($value) { |
|
209 | + $this->mappings['protection']['insertHyperlinks'] = function ($value) |
|
210 | + { |
|
178 | 211 | $this->object->getProtection()->setInsertHyperlinks($value); |
179 | 212 | }; |
180 | - $this->mappings['protection']['insertRows'] = function ($value) { |
|
213 | + $this->mappings['protection']['insertRows'] = function ($value) |
|
214 | + { |
|
181 | 215 | $this->object->getProtection()->setInsertRows($value); |
182 | 216 | }; |
183 | - $this->mappings['protection']['objects'] = function ($value) { |
|
217 | + $this->mappings['protection']['objects'] = function ($value) |
|
218 | + { |
|
184 | 219 | $this->object->getProtection()->setObjects($value); |
185 | 220 | }; |
186 | - $this->mappings['protection']['password'] = function ($value) { |
|
221 | + $this->mappings['protection']['password'] = function ($value) |
|
222 | + { |
|
187 | 223 | $this->object->getProtection()->setPassword($value); |
188 | 224 | }; |
189 | - $this->mappings['protection']['pivotTables'] = function ($value) { |
|
225 | + $this->mappings['protection']['pivotTables'] = function ($value) |
|
226 | + { |
|
190 | 227 | $this->object->getProtection()->setPivotTables($value); |
191 | 228 | }; |
192 | - $this->mappings['protection']['scenarios'] = function ($value) { |
|
229 | + $this->mappings['protection']['scenarios'] = function ($value) |
|
230 | + { |
|
193 | 231 | $this->object->getProtection()->setScenarios($value); |
194 | 232 | }; |
195 | - $this->mappings['protection']['selectLockedCells'] = function ($value) { |
|
233 | + $this->mappings['protection']['selectLockedCells'] = function ($value) |
|
234 | + { |
|
196 | 235 | $this->object->getProtection()->setSelectLockedCells($value); |
197 | 236 | }; |
198 | - $this->mappings['protection']['selectUnlockedCells'] = function ($value) { |
|
237 | + $this->mappings['protection']['selectUnlockedCells'] = function ($value) |
|
238 | + { |
|
199 | 239 | $this->object->getProtection()->setSelectUnlockedCells($value); |
200 | 240 | }; |
201 | - $this->mappings['protection']['sheet'] = function ($value) { |
|
241 | + $this->mappings['protection']['sheet'] = function ($value) |
|
242 | + { |
|
202 | 243 | $this->object->getProtection()->setSheet($value); |
203 | 244 | }; |
204 | - $this->mappings['protection']['sort'] = function ($value) { |
|
245 | + $this->mappings['protection']['sort'] = function ($value) |
|
246 | + { |
|
205 | 247 | $this->object->getProtection()->setSort($value); |
206 | 248 | }; |
207 | - $this->mappings['rightToLeft'] = function ($value) { |
|
249 | + $this->mappings['rightToLeft'] = function ($value) |
|
250 | + { |
|
208 | 251 | $this->object->setRightToLeft($value); |
209 | 252 | }; |
210 | 253 | $this->mappings['rowDimension']['__multi'] = true; |
211 | - $this->mappings['rowDimension']['__object'] = function ($key) { |
|
254 | + $this->mappings['rowDimension']['__object'] = function ($key) |
|
255 | + { |
|
212 | 256 | return $key === 'default' ? $this->object->getDefaultRowDimension() : $this->object->getRowDimension($key); |
213 | 257 | }; |
214 | - $this->mappings['rowDimension']['collapsed'] = function ($key, $value) { |
|
258 | + $this->mappings['rowDimension']['collapsed'] = function ($key, $value) |
|
259 | + { |
|
215 | 260 | $this->mappings['rowDimension']['__object']($key)->setCollapsed($value); |
216 | 261 | }; |
217 | - $this->mappings['rowDimension']['outlineLevel'] = function ($key, $value) { |
|
262 | + $this->mappings['rowDimension']['outlineLevel'] = function ($key, $value) |
|
263 | + { |
|
218 | 264 | $this->mappings['rowDimension']['__object']($key)->setOutlineLevel($value); |
219 | 265 | }; |
220 | - $this->mappings['rowDimension']['rowHeight'] = function ($key, $value) { |
|
266 | + $this->mappings['rowDimension']['rowHeight'] = function ($key, $value) |
|
267 | + { |
|
221 | 268 | $this->mappings['rowDimension']['__object']($key)->setRowHeight($value); |
222 | 269 | }; |
223 | - $this->mappings['rowDimension']['rowIndex'] = function ($key, $value) { |
|
270 | + $this->mappings['rowDimension']['rowIndex'] = function ($key, $value) |
|
271 | + { |
|
224 | 272 | $this->mappings['rowDimension']['__object']($key)->setRowIndex($value); |
225 | 273 | }; |
226 | - $this->mappings['rowDimension']['visible'] = function ($key, $value) { |
|
274 | + $this->mappings['rowDimension']['visible'] = function ($key, $value) |
|
275 | + { |
|
227 | 276 | $this->mappings['rowDimension']['__object']($key)->setVisible($value); |
228 | 277 | }; |
229 | - $this->mappings['rowDimension']['xfIndex'] = function ($key, $value) { |
|
278 | + $this->mappings['rowDimension']['xfIndex'] = function ($key, $value) |
|
279 | + { |
|
230 | 280 | $this->mappings['rowDimension']['__object']($key)->setXfIndex($value); |
231 | 281 | }; |
232 | - $this->mappings['rowDimension']['zeroHeight'] = function ($key, $value) { |
|
282 | + $this->mappings['rowDimension']['zeroHeight'] = function ($key, $value) |
|
283 | + { |
|
233 | 284 | $this->mappings['rowDimension']['__object']($key)->setZeroHeight($value); |
234 | 285 | }; |
235 | - $this->mappings['sheetState'] = function ($value) { |
|
286 | + $this->mappings['sheetState'] = function ($value) |
|
287 | + { |
|
236 | 288 | $this->object->setSheetState($value); |
237 | 289 | }; |
238 | - $this->mappings['showGridlines'] = function ($value) { |
|
290 | + $this->mappings['showGridlines'] = function ($value) |
|
291 | + { |
|
239 | 292 | $this->object->setShowGridlines($value); |
240 | 293 | }; |
241 | - $this->mappings['tabColor'] = function ($value) { |
|
294 | + $this->mappings['tabColor'] = function ($value) |
|
295 | + { |
|
242 | 296 | $this->object->getTabColor()->setRGB($value); |
243 | 297 | }; |
244 | - $this->mappings['zoomScale'] = function ($value) { |
|
298 | + $this->mappings['zoomScale'] = function ($value) |
|
299 | + { |
|
245 | 300 | $this->object->getSheetView()->setZoomScale($value); |
246 | 301 | }; |
247 | 302 | } |
@@ -261,7 +316,7 @@ discard block |
||
261 | 316 | $this->documentWrapper->getObject()->createSheet()->setTitle($index); |
262 | 317 | } |
263 | 318 | $this->object = $this->documentWrapper->getObject()->setActiveSheetIndexByName($index); |
264 | - } else { |
|
319 | + } else { |
|
265 | 320 | // create new sheet without a name |
266 | 321 | $this->documentWrapper->getObject()->createSheet(); |
267 | 322 | $this->object = $this->documentWrapper->getObject()->setActiveSheetIndex(0); |
@@ -33,12 +33,10 @@ |
||
33 | 33 | if (($node instanceof Twig_Node_Block || $node instanceof Twig_Node_Macro) && !$node->hasAttribute('twigExcelBundle') && NodeHelper::checkContainsXlsNode($node)) { |
34 | 34 | if ($node instanceof Twig_Node_Block) { |
35 | 35 | throw new Twig_Error_Syntax('Block tags do not work together with Twig tags provided by TwigExcelBundle. Please use \'xlsblock\' instead.'); |
36 | - } |
|
37 | - elseif ($node instanceof Twig_Node_Macro) { |
|
36 | + } elseif ($node instanceof Twig_Node_Macro) { |
|
38 | 37 | throw new Twig_Error_Syntax('Macro tags do not work together with Twig tags provided by TwigExcelBundle. Please use \'xlsmacro\' instead.'); |
39 | 38 | } |
40 | - } |
|
41 | - elseif ($node instanceof SyntaxAwareNodeInterface) { |
|
39 | + } elseif ($node instanceof SyntaxAwareNodeInterface) { |
|
42 | 40 | /** |
43 | 41 | * @var SyntaxAwareNodeInterface $node |
44 | 42 | */ |