Skip to content

Commit 53e0828

Browse files
authored
Sync composer.lock (#3075)
When I cloned this morning, composer gave me a message that the lock file was not up to date with the latest changes in composer.json. I do not understand why, but it suggested to run `composer update`, which I did. This led to a handful of problems with php-cs-fixer, all fixed with changes to doc-blocks, and phpstan (only Writer/Xls/Worksheet required a change to code). We would presumably have had these problems at the start of next month when dependabot did its thing, so fix them now.
1 parent a2b2984 commit 53e0828

File tree

11 files changed

+87
-92
lines changed

11 files changed

+87
-92
lines changed

composer.lock

Lines changed: 73 additions & 73 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan-baseline.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2912,7 +2912,7 @@ parameters:
29122912

29132913
-
29142914
message: "#^Cannot access offset 1 on array\\|false\\.$#"
2915-
count: 2
2915+
count: 1
29162916
path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php
29172917

29182918
-

src/PhpSpreadsheet/Calculation/Information/Value.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ public static function isFormula($cellReference = '', ?Cell $cell = null)
240240
*
241241
* @param null|mixed $value The value you want converted
242242
*
243-
* @return number N converts values listed in the following table
243+
* @return number|string N converts values listed in the following table
244244
* If value is or refers to N returns
245245
* A number That number value
246246
* A date The Excel serialized number of that date

src/PhpSpreadsheet/Cell/Cell.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,6 @@ public function getCalculatedValue(bool $resetLog = true)
313313
* Set old calculated value (cached).
314314
*
315315
* @param mixed $originalValue Value
316-
*
317-
* @return Cell
318316
*/
319317
public function setCalculatedValue($originalValue): self
320318
{
@@ -352,8 +350,6 @@ public function getDataType(): string
352350
* Set cell data type.
353351
*
354352
* @param string $dataType see DataType::TYPE_*
355-
*
356-
* @return Cell
357353
*/
358354
public function setDataType($dataType): self
359355
{
@@ -447,8 +443,6 @@ public function getHyperlink(): Hyperlink
447443

448444
/**
449445
* Set Hyperlink.
450-
*
451-
* @return Cell
452446
*/
453447
public function setHyperlink(?Hyperlink $hyperlink = null): self
454448
{
@@ -556,8 +550,6 @@ public function getAppliedStyle(): Style
556550

557551
/**
558552
* Re-bind parent.
559-
*
560-
* @return Cell
561553
*/
562554
public function rebindParent(Worksheet $parent): self
563555
{
@@ -650,8 +642,6 @@ public function getXfIndex(): int
650642

651643
/**
652644
* Set index to cellXf.
653-
*
654-
* @return Cell
655645
*/
656646
public function setXfIndex(int $indexValue): self
657647
{

src/PhpSpreadsheet/Style/Color.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,6 @@ public static function changeBrightness($hexColourValue, $adjustPercentage)
387387
* @param int $colorIndex Index entry point into the colour array
388388
* @param bool $background Flag to indicate whether default background or foreground colour
389389
* should be returned if the indexed colour doesn't exist
390-
*
391-
* @return Color
392390
*/
393391
public static function indexedColor($colorIndex, $background = false, ?array $palette = null): self
394392
{

src/PhpSpreadsheet/Worksheet/CellIterator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
/**
1010
* @template TKey
11+
*
1112
* @implements Iterator<TKey, Cell>
1213
*/
1314
abstract class CellIterator implements Iterator

src/PhpSpreadsheet/Writer/Xls.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,6 @@ private function writeDocumentSummaryInformation()
732732
} elseif ($dataProp['type']['data'] == 0x1E) { // null-terminated string prepended by dword string length
733733
// Null-terminated string
734734
$dataProp['data']['data'] .= chr(0);
735-
// @phpstan-ignore-next-line
736735
++$dataProp['data']['length'];
737736
// Complete the string with null string for being a %4
738737
$dataProp['data']['length'] = $dataProp['data']['length'] + ((4 - $dataProp['data']['length'] % 4) == 4 ? 0 : (4 - $dataProp['data']['length'] % 4));
@@ -750,7 +749,6 @@ private function writeDocumentSummaryInformation()
750749
} else {
751750
$dataSection_Content .= $dataProp['data']['data'];
752751

753-
// @phpstan-ignore-next-line
754752
$dataSection_Content_Offset += 4 + $dataProp['data']['length'];
755753
}
756754
}

src/PhpSpreadsheet/Writer/Xls/Worksheet.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2405,10 +2405,12 @@ public function processBitmapGd($image)
24052405
for ($i = 0; $i < $width; ++$i) {
24062406
/** @phpstan-ignore-next-line */
24072407
$color = imagecolorsforindex($image, imagecolorat($image, $i, $j));
2408-
foreach (['red', 'green', 'blue'] as $key) {
2409-
$color[$key] = $color[$key] + (int) round((255 - $color[$key]) * $color['alpha'] / 127);
2408+
if ($color !== false) {
2409+
foreach (['red', 'green', 'blue'] as $key) {
2410+
$color[$key] = $color[$key] + (int) round((255 - $color[$key]) * $color['alpha'] / 127);
2411+
}
2412+
$data .= chr($color['blue']) . chr($color['green']) . chr($color['red']);
24102413
}
2411-
$data .= chr($color['blue']) . chr($color['green']) . chr($color['red']);
24122414
}
24132415
if (3 * $width % 4) {
24142416
$data .= str_repeat("\x00", 4 - 3 * $width % 4);

tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/FormulaTextTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class FormulaTextTest extends AllSetupTeardown
1111
{
1212
/**
1313
* @param mixed $value
14+
*
1415
* @dataProvider providerFormulaText
1516
*/
1617
public function testFormulaText(string $expectedResult, $value): void

tests/PhpSpreadsheetTests/Helper/SampleTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ class SampleTest extends TestCase
99
{
1010
/**
1111
* @runInSeparateProcess
12+
*
1213
* @preserveGlobalState disabled
14+
*
1315
* @dataProvider providerSample
1416
*/
1517
public function testSample(string $sample): void

0 commit comments

Comments
 (0)