Skip to content

Commit e884271

Browse files
author
Mark Baker
authored
Scrutinizer resolutions (#1032)
* list($ac, $ar) = sscanf($a, '%[A-Z]%d'); to appease scrutinizer, which complains about ($a, '%[A-Z]%d') * Fix a docblock error * More scrutinizer happiness
1 parent 591f1e0 commit e884271

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

src/PhpSpreadsheet/Calculation/Calculation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class Calculation
117117
/**
118118
* An array of the nested cell references accessed by the calculation engine, used for the debug log.
119119
*
120-
* @var array of string
120+
* @var CyclicReferenceStack
121121
*/
122122
private $cyclicReferenceStack;
123123

src/PhpSpreadsheet/Chart/Axis.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,10 @@ private function setShadowPresetsProperties($shadow_presets)
365365
}
366366

367367
/**
368-
* Set Shadow Properties from Maped Values.
368+
* Set Shadow Properties from Mapped Values.
369369
*
370370
* @param array $properties_map
371-
* @param * $reference
371+
* @param mixed &$reference
372372
*
373373
* @return Axis
374374
*/

src/PhpSpreadsheet/Chart/GridLines.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ private function setShadowPresetsProperties($shadow_presets)
319319
* Set Shadow Properties Values.
320320
*
321321
* @param array $properties_map
322-
* @param * $reference
322+
* @param mixed &$reference
323323
*
324324
* @return GridLines
325325
*/
@@ -439,7 +439,7 @@ public function setSoftEdgesSize($size)
439439
{
440440
if ($size !== null) {
441441
$this->activateObject();
442-
$softEdges['size'] = (string) $this->getExcelPointsWidth($size);
442+
$this->softEdges['size'] = (string) $this->getExcelPointsWidth($size);
443443
}
444444
}
445445

src/PhpSpreadsheet/Chart/Layout.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,13 @@ public function getXMode()
175175
/**
176176
* Set X-Mode.
177177
*
178-
* @param X-Mode $value
178+
* @param string $value
179179
*
180180
* @return Layout
181181
*/
182182
public function setXMode($value)
183183
{
184-
$this->xMode = $value;
184+
$this->xMode = (string) $value;
185185

186186
return $this;
187187
}
@@ -199,13 +199,13 @@ public function getYMode()
199199
/**
200200
* Set Y-Mode.
201201
*
202-
* @param Y-Mode $value
202+
* @param string $value
203203
*
204204
* @return Layout
205205
*/
206206
public function setYMode($value)
207207
{
208-
$this->yMode = $value;
208+
$this->yMode = (string) $value;
209209

210210
return $this;
211211
}
@@ -223,13 +223,13 @@ public function getXPosition()
223223
/**
224224
* Set X-Position.
225225
*
226-
* @param X-Position $value
226+
* @param float $value
227227
*
228228
* @return Layout
229229
*/
230230
public function setXPosition($value)
231231
{
232-
$this->xPos = $value;
232+
$this->xPos = (float) $value;
233233

234234
return $this;
235235
}
@@ -247,13 +247,13 @@ public function getYPosition()
247247
/**
248248
* Set Y-Position.
249249
*
250-
* @param Y-Position $value
250+
* @param float $value
251251
*
252252
* @return Layout
253253
*/
254254
public function setYPosition($value)
255255
{
256-
$this->yPos = $value;
256+
$this->yPos = (float) $value;
257257

258258
return $this;
259259
}

src/PhpSpreadsheet/Worksheet/Dimension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function getVisible()
6464
*/
6565
public function setVisible($pValue)
6666
{
67-
$this->visible = $pValue;
67+
$this->visible = (bool) $pValue;
6868

6969
return $this;
7070
}
@@ -119,7 +119,7 @@ public function getCollapsed()
119119
*/
120120
public function setCollapsed($pValue)
121121
{
122-
$this->collapsed = $pValue;
122+
$this->collapsed = (bool) $pValue;
123123

124124
return $this;
125125
}

src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ private function writeCols(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet
383383
}
384384

385385
// Column visibility
386-
if ($colDimension->getVisible() == false) {
386+
if ($colDimension->getVisible() === false) {
387387
$objWriter->writeAttribute('hidden', 'true');
388388
}
389389

@@ -398,7 +398,7 @@ private function writeCols(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet
398398
}
399399

400400
// Collapsed
401-
if ($colDimension->getCollapsed() == true) {
401+
if ($colDimension->getCollapsed() === true) {
402402
$objWriter->writeAttribute('collapsed', 'true');
403403
}
404404

@@ -995,12 +995,12 @@ private function writeSheetData(XMLWriter $objWriter, PhpspreadsheetWorksheet $p
995995
}
996996

997997
// Row visibility
998-
if (!$rowDimension->getVisible()) {
998+
if (!$rowDimension->getVisible() === true) {
999999
$objWriter->writeAttribute('hidden', 'true');
10001000
}
10011001

10021002
// Collapsed
1003-
if ($rowDimension->getCollapsed()) {
1003+
if ($rowDimension->getCollapsed() === true) {
10041004
$objWriter->writeAttribute('collapsed', 'true');
10051005
}
10061006

0 commit comments

Comments
 (0)