Skip to content

Commit 8d23bda

Browse files
committed
Fix Scrutinizer issues
1 parent 557e80d commit 8d23bda

File tree

11 files changed

+95
-102
lines changed

11 files changed

+95
-102
lines changed

src/PhpSpreadsheet/Cell/Cell.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
use PhpOffice\PhpSpreadsheet\Collection\Cells;
77
use PhpOffice\PhpSpreadsheet\Exception;
88
use PhpOffice\PhpSpreadsheet\RichText\RichText;
9-
use PhpOffice\PhpSpreadsheet\Style;
9+
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
10+
use PhpOffice\PhpSpreadsheet\Style\Style;
1011
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
1112

1213
class Cell
@@ -167,7 +168,7 @@ public function getValue()
167168
*/
168169
public function getFormattedValue()
169170
{
170-
return (string) Style\NumberFormat::toFormattedString(
171+
return (string) NumberFormat::toFormattedString(
171172
$this->getCalculatedValue(),
172173
$this->getStyle()
173174
->getNumberFormat()->getFormatCode()

src/PhpSpreadsheet/Worksheet/Worksheet.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,7 +1343,7 @@ public function cellExistsByColumnAndRow($pColumn, $pRow)
13431343
* Get row dimension at a specific row.
13441344
*
13451345
* @param int $pRow Numeric index of the row
1346-
* @param mixed $create
1346+
* @param bool $create
13471347
*
13481348
* @return RowDimension
13491349
*/
@@ -1369,7 +1369,7 @@ public function getRowDimension($pRow, $create = true)
13691369
* Get column dimension at a specific column.
13701370
*
13711371
* @param string $pColumn String index of the column eg: 'A'
1372-
* @param mixed $create
1372+
* @param bool $create
13731373
*
13741374
* @return ColumnDimension
13751375
*/
@@ -1910,7 +1910,7 @@ public function getAutoFilter()
19101910
/**
19111911
* Set AutoFilter.
19121912
*
1913-
* @param string|Worksheet\AutoFilter $pValue
1913+
* @param AutoFilter|string $pValue
19141914
* A simple string containing a Cell range like 'A1:E10' is permitted for backward compatibility
19151915
*
19161916
* @throws Exception
@@ -1919,7 +1919,6 @@ public function getAutoFilter()
19191919
*/
19201920
public function setAutoFilter($pValue)
19211921
{
1922-
$pValue = strtoupper($pValue);
19231922
if (is_string($pValue)) {
19241923
$this->autoFilter->setRange($pValue);
19251924
} elseif (is_object($pValue) && ($pValue instanceof AutoFilter)) {

src/PhpSpreadsheet/Writer/Html.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ private function generateTableFooter()
11641164
* @param Worksheet $pSheet \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet
11651165
* @param array $pValues Array containing cells in a row
11661166
* @param int $pRow Row number (0-based)
1167-
* @param mixed $cellType eg: 'td'
1167+
* @param string $cellType eg: 'td'
11681168
*
11691169
* @throws WriterException
11701170
*

src/PhpSpreadsheet/Writer/Ods/MetaInf.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace PhpOffice\PhpSpreadsheet\Writer\Ods;
44

55
use PhpOffice\PhpSpreadsheet\Shared\XMLWriter;
6-
use PhpOffice\PhpSpreadsheet\Spreadsheet;
76

87
class MetaInf extends WriterPart
98
{

src/PhpSpreadsheet/Writer/Xls/Workbook.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ public function __construct(Spreadsheet $spreadsheet, &$str_total, &$str_unique,
224224
*
225225
* @param Style
226226
* @param bool Is it a style XF?
227-
* @param mixed $style
228-
* @param mixed $isStyleXf
227+
* @param Style $style
228+
* @param bool $isStyleXf
229229
*
230230
* @return int Index to XF record
231231
*/
@@ -683,7 +683,7 @@ private function writeAllDefinedNamesBiff8()
683683
*
684684
* @param string $name The name in UTF-8
685685
* @param string $formulaData The binary formula data
686-
* @param string $sheetIndex 1-based sheet index the defined name applies to. 0 = global
686+
* @param int $sheetIndex 1-based sheet index the defined name applies to. 0 = global
687687
* @param bool $isBuiltIn Built-in name?
688688
*
689689
* @return string Complete binary record data

src/PhpSpreadsheet/Writer/Xls/Worksheet.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class Worksheet extends BIFFwriter
176176
/**
177177
* Sheet object.
178178
*
179-
* @var Worksheet
179+
* @var \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet
180180
*/
181181
public $phpSheet;
182182

@@ -214,16 +214,15 @@ class Worksheet extends BIFFwriter
214214
/**
215215
* Constructor.
216216
*
217-
* @param int &$str_total Total number of strings
218-
* @param int &$str_unique Total number of unique strings
217+
* @param int $str_total Total number of strings
218+
* @param int $str_unique Total number of unique strings
219219
* @param array &$str_table String Table
220220
* @param array &$colors Colour Table
221-
* @param mixed $parser The formula parser created for the Workbook
221+
* @param Parser $parser The formula parser created for the Workbook
222222
* @param bool $preCalculateFormulas Flag indicating whether formulas should be calculated or just written
223-
* @param string $phpSheet The worksheet to write
224-
* @param Worksheet $phpSheet
223+
* @param \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $phpSheet The worksheet to write
225224
*/
226-
public function __construct(&$str_total, &$str_unique, &$str_table, &$colors, $parser, $preCalculateFormulas, $phpSheet)
225+
public function __construct(&$str_total, &$str_unique, &$str_table, &$colors, Parser $parser, $preCalculateFormulas, \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $phpSheet)
227226
{
228227
// It needs to call its parent's constructor explicitly
229228
parent::__construct();

src/PhpSpreadsheet/Writer/Xlsx/Chart.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ private function writeLegend(XMLWriter $objWriter, Legend $legend = null)
204204
* Write Chart Plot Area.
205205
*
206206
* @param XMLWriter $objWriter XML Writer
207-
* @param Worksheet $pSheet
207+
* @param \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pSheet
208208
* @param PlotArea $plotArea
209209
* @param Title $xAxisLabel
210210
* @param Title $yAxisLabel
@@ -394,11 +394,11 @@ private function writeDataLabels(XMLWriter $objWriter, Layout $chartLayout = nul
394394
* @param string $id1
395395
* @param string $id2
396396
* @param bool $isMultiLevelSeries
397-
* @param mixed $yAxis
397+
* @param Axis $yAxis
398398
*
399399
* @throws WriterException
400400
*/
401-
private function writeCategoryAxis($objWriter, $xAxisLabel, $id1, $id2, $isMultiLevelSeries, $yAxis)
401+
private function writeCategoryAxis($objWriter, $xAxisLabel, $id1, $id2, $isMultiLevelSeries, Axis $yAxis)
402402
{
403403
$objWriter->startElement('c:catAx');
404404

@@ -515,13 +515,13 @@ private function writeCategoryAxis($objWriter, $xAxisLabel, $id1, $id2, $isMulti
515515
* @param string $id1
516516
* @param string $id2
517517
* @param bool $isMultiLevelSeries
518-
* @param mixed $xAxis
519-
* @param mixed $majorGridlines
520-
* @param mixed $minorGridlines
518+
* @param Axis $xAxis
519+
* @param GridLines $majorGridlines
520+
* @param GridLines $minorGridlines
521521
*
522522
* @throws WriterException
523523
*/
524-
private function writeValueAxis($objWriter, $yAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, $xAxis, $majorGridlines, $minorGridlines)
524+
private function writeValueAxis($objWriter, $yAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, Axis $xAxis, GridLines $majorGridlines, GridLines $minorGridlines)
525525
{
526526
$objWriter->startElement('c:valAx');
527527

src/PhpSpreadsheet/Writer/Xlsx/Comments.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Comments extends WriterPart
1111
/**
1212
* Write comments to XML format.
1313
*
14-
* @param Worksheet $pWorksheet
14+
* @param \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pWorksheet
1515
*
1616
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
1717
*
@@ -94,7 +94,7 @@ private function writeComment(XMLWriter $objWriter, $pCellReference, Comment $pC
9494
/**
9595
* Write VML comments to XML format.
9696
*
97-
* @param Worksheet $pWorksheet
97+
* @param \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pWorksheet
9898
*
9999
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
100100
*

src/PhpSpreadsheet/Writer/Xlsx/Drawing.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Drawing extends WriterPart
1414
/**
1515
* Write drawings to XML format.
1616
*
17-
* @param Worksheet $pWorksheet
17+
* @param \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pWorksheet
1818
* @param bool $includeCharts Flag indicating if we should include drawing details for charts
1919
*
2020
* @throws WriterException
@@ -271,7 +271,7 @@ public function writeDrawing(XMLWriter $objWriter, BaseDrawing $pDrawing, $pRela
271271
/**
272272
* Write VML header/footer images to XML format.
273273
*
274-
* @param Worksheet $pWorksheet
274+
* @param \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pWorksheet
275275
*
276276
* @throws WriterException
277277
*

src/PhpSpreadsheet/Writer/Xlsx/Rels.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public function writeWorkbookRelationships(Spreadsheet $spreadsheet)
168168
* rId1 - Drawings
169169
* rId_hyperlink_x - Hyperlinks
170170
*
171-
* @param Worksheet $pWorksheet
171+
* @param \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pWorksheet
172172
* @param int $pWorksheetId
173173
* @param bool $includeCharts Flag indicating if we should write charts
174174
*
@@ -263,7 +263,7 @@ public function writeWorksheetRelationships(\PhpOffice\PhpSpreadsheet\Worksheet\
263263
/**
264264
* Write drawing relationships to XML format.
265265
*
266-
* @param Worksheet $pWorksheet
266+
* @param \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pWorksheet
267267
* @param int &$chartRef Chart ID
268268
* @param bool $includeCharts Flag indicating if we should write charts
269269
*
@@ -330,7 +330,7 @@ public function writeDrawingRelationships(\PhpOffice\PhpSpreadsheet\Worksheet\Wo
330330
/**
331331
* Write header/footer drawing relationships to XML format.
332332
*
333-
* @param Worksheet $pWorksheet
333+
* @param \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pWorksheet
334334
*
335335
* @throws WriterException
336336
*

0 commit comments

Comments
 (0)