Skip to content

Commit 915bb7e

Browse files
committed
Rector StrictArrayParamDimFetchRector
1 parent e221aa6 commit 915bb7e

File tree

14 files changed

+25
-30
lines changed

14 files changed

+25
-30
lines changed

src/PhpSpreadsheet/Calculation/Calculation.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3831,14 +3831,14 @@ public static function getMatrixDimensions(array &$matrix): array
38313831
/**
38323832
* Ensure that paired matrix operands are both matrices of the same size.
38333833
*
3834-
* @param mixed $matrix1 First matrix operand
3835-
* @param mixed $matrix2 Second matrix operand
3834+
* @param array $matrix1 First matrix operand
3835+
* @param array $matrix2 Second matrix operand
38363836
* @param int $matrix1Rows Row size of first matrix operand
38373837
* @param int $matrix1Columns Column size of first matrix operand
38383838
* @param int $matrix2Rows Row size of second matrix operand
38393839
* @param int $matrix2Columns Column size of second matrix operand
38403840
*/
3841-
private static function resizeMatricesShrink(&$matrix1, &$matrix2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns): void
3841+
private static function resizeMatricesShrink(array &$matrix1, array &$matrix2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns): void
38423842
{
38433843
if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) {
38443844
if ($matrix2Rows < $matrix1Rows) {
@@ -3874,14 +3874,14 @@ private static function resizeMatricesShrink(&$matrix1, &$matrix2, $matrix1Rows,
38743874
/**
38753875
* Ensure that paired matrix operands are both matrices of the same size.
38763876
*
3877-
* @param mixed $matrix1 First matrix operand
3878-
* @param mixed $matrix2 Second matrix operand
3877+
* @param array $matrix1 First matrix operand
3878+
* @param array $matrix2 Second matrix operand
38793879
* @param int $matrix1Rows Row size of first matrix operand
38803880
* @param int $matrix1Columns Column size of first matrix operand
38813881
* @param int $matrix2Rows Row size of second matrix operand
38823882
* @param int $matrix2Columns Column size of second matrix operand
38833883
*/
3884-
private static function resizeMatricesExtend(&$matrix1, &$matrix2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns): void
3884+
private static function resizeMatricesExtend(array &$matrix1, array &$matrix2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns): void
38853885
{
38863886
if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) {
38873887
if ($matrix2Columns < $matrix1Columns) {
@@ -4597,11 +4597,9 @@ private function internalParseFormula($formula, ?Cell $cell = null): bool|array
45974597
}
45984598

45994599
/**
4600-
* @param array $operandData
4601-
*
46024600
* @return mixed
46034601
*/
4604-
private static function dataTestReference(&$operandData)
4602+
private static function dataTestReference(array &$operandData)
46054603
{
46064604
$operand = $operandData['value'];
46074605
if (($operandData['reference'] === null) && (is_array($operand))) {

src/PhpSpreadsheet/Calculation/LookupRef/Sort.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ function ($value) {
219219
* @param array[] $sortIndex
220220
* @param int[] $sortOrder
221221
*/
222-
private static function processSortBy(array $sortArray, array $sortIndex, $sortOrder): array
222+
private static function processSortBy(array $sortArray, array $sortIndex, array $sortOrder): array
223223
{
224224
$sortArguments = [];
225225
$sortData = [];

src/PhpSpreadsheet/Chart/Properties.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -626,11 +626,9 @@ protected function setShadowPresetsProperties(int $presets)
626626
/**
627627
* Set Shadow Properties Values.
628628
*
629-
* @param mixed $reference
630-
*
631629
* @return $this
632630
*/
633-
protected function setShadowPropertiesMapValues(array $propertiesMap, &$reference = null)
631+
protected function setShadowPropertiesMapValues(array $propertiesMap, ?array &$reference = null)
634632
{
635633
$base_reference = $reference;
636634
foreach ($propertiesMap as $property_key => $property_val) {

src/PhpSpreadsheet/Chart/Renderer/JpGraphRendererBase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ private function formatPointMarker($seriesPlot, $markerID)
102102
return $seriesPlot;
103103
}
104104

105-
private function formatDataSetLabels(int $groupID, $datasetLabels, $rotation = '')
105+
private function formatDataSetLabels(int $groupID, array $datasetLabels, $rotation = '')
106106
{
107107
$datasetLabelFormatCode = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getFormatCode() ?? '';
108108
// Retrieve any label formatting code
@@ -151,7 +151,7 @@ private function percentageSumCalculation(int $groupID, $seriesCount)
151151
return $sumValues;
152152
}
153153

154-
private function percentageAdjustValues($dataValues, $sumValues)
154+
private function percentageAdjustValues(array $dataValues, array $sumValues)
155155
{
156156
foreach ($dataValues as $k => $dataValue) {
157157
$dataValues[$k] = $dataValue / $sumValues[$k] * 100;

src/PhpSpreadsheet/Reader/Xls/Color.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Color
1515
*
1616
* @return array RGB color value, example: ['rgb' => 'FF0000']
1717
*/
18-
public static function map($color, $palette, $version)
18+
public static function map($color, array $palette, $version)
1919
{
2020
if ($color <= 0x07 || $color >= 0x40) {
2121
// special built-in color

src/PhpSpreadsheet/Shared/OLE/PPS.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public function getPpsWk()
203203
*
204204
* @return int The index for this PPS
205205
*/
206-
public static function savePpsSetPnt(&$raList, $to_save, $depth = 0)
206+
public static function savePpsSetPnt(array &$raList, $to_save, $depth = 0)
207207
{
208208
if (!is_array($to_save) || (empty($to_save))) {
209209
return 0xFFFFFFFF;

src/PhpSpreadsheet/Shared/OLE/PPS/Root.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function save($fileHandle): bool
106106
*
107107
* @return float[] The array of numbers
108108
*/
109-
private function calcSize(&$raList): array
109+
private function calcSize(array &$raList): array
110110
{
111111
// Calculate Basic Setting
112112
[$iSBDcnt, $iBBcnt, $iPPScnt] = [0, 0, 0];
@@ -231,7 +231,7 @@ private function saveHeader(int $iSBDcnt, int $iBBcnt, int $iPPScnt): void
231231
*
232232
* @param array $raList Reference to array of PPS's
233233
*/
234-
private function saveBigData(int $iStBlk, &$raList): void
234+
private function saveBigData(int $iStBlk, array &$raList): void
235235
{
236236
$FILE = $this->fileHandle;
237237

@@ -261,7 +261,7 @@ private function saveBigData(int $iStBlk, &$raList): void
261261
*
262262
* @param array $raList Reference to array of PPS's
263263
*/
264-
private function makeSmallData(&$raList): string
264+
private function makeSmallData(array &$raList): string
265265
{
266266
$sRes = '';
267267
$FILE = $this->fileHandle;
@@ -311,7 +311,7 @@ private function makeSmallData(&$raList): string
311311
*
312312
* @param array $raList Reference to an array with all PPS's
313313
*/
314-
private function savePps(&$raList): void
314+
private function savePps(array &$raList): void
315315
{
316316
// Save each PPS WK
317317
$iC = count($raList);

src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function getCoefficients($dp = 0): array
135135
* @param float[] $yValues The set of Y-values for this regression
136136
* @param float[] $xValues The set of X-values for this regression
137137
*/
138-
private function polynomialRegression($order, $yValues, $xValues): void
138+
private function polynomialRegression($order, array $yValues, array $xValues): void
139139
{
140140
// calculate sums
141141
$x_sum = array_sum($xValues);

src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ private static function parseExtDataBarAttributesFromXml(
124124
}
125125
}
126126

127-
/** @param array|SimpleXMLElement $ns */
128-
private static function parseExtDataBarElementChildrenFromXml(ConditionalDataBarExtension $extDataBarObj, SimpleXMLElement $dataBarXml, $ns): void
127+
private static function parseExtDataBarElementChildrenFromXml(ConditionalDataBarExtension $extDataBarObj, SimpleXMLElement $dataBarXml, array $ns): void
129128
{
130129
if ($dataBarXml->borderColor) {
131130
$attributes = $dataBarXml->borderColor->attributes();

src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/CellValue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public static function fromConditional(Conditional $conditional, string $cellRan
165165
* @param string $methodName
166166
* @param mixed[] $arguments
167167
*/
168-
public function __call($methodName, $arguments): self
168+
public function __call($methodName, array $arguments): self
169169
{
170170
if (!isset(self::MAGIC_OPERATIONS[$methodName]) && $methodName !== 'and') {
171171
throw new Exception('Invalid Operator for Cell Value CF Rule Wizard');

0 commit comments

Comments
 (0)