Skip to content

Commit 958f9a3

Browse files
authored
Fixed PhpStan issues in box/spout bridge (#57)
* Fixed PhpStan issues * Add phpcs & phpstan to local test script
1 parent a8cf8a9 commit 958f9a3

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

scripts/tests

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/bin/bash
22

3+
led in -s php81 -- composer2 --no-interaction --quiet require --no-update symfony/console:6.0.*
4+
led in -s php81 -- composer2 --no-interaction --quiet require --no-update symfony/filesystem:6.0.* --dev
5+
led in -s php81 -- composer2 --no-interaction --quiet require --no-update symfony/framework-bundle:6.0.*
6+
led in -s php81 -- composer2 --no-interaction --quiet require --no-update symfony/messenger:6.0.*
7+
led in -s php81 -- composer2 --no-interaction --quiet require --no-update symfony/process:6.0.*
8+
led in -s php81 -- composer2 --no-interaction --quiet require --no-update symfony/serializer:6.0.*
9+
led in -s php81 -- composer2 --no-interaction --quiet require --no-update symfony/validator:6.0.*
10+
led in -s php81 -- composer2 --no-interaction update --no-progress --with-all-dependencies
11+
led in -s php81 -- vendor/bin/phpcs
12+
led in -s php81 -- vendor/bin/phpstan analyze
13+
314
matrix=(
415
"php80/5.4.*"
516
"php81/5.4.*"

src/batch-box-spout/src/Reader/FlatFileReader.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,11 @@ public function read(): iterable
8181
private function rows(ReaderInterface $reader): Generator
8282
{
8383
foreach ($this->options->getSheets($reader) as $sheet) {
84+
/** @var int $rowIndex */
85+
/** @var Row|array<string> $row */
8486
foreach ($sheet->getRowIterator() as $rowIndex => $row) {
8587
if ($row instanceof Row) {
88+
/** @var array<string> $row */
8689
$row = $row->toArray();
8790
}
8891

src/batch-box-spout/src/Reader/Options/SheetFilter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public static function nameIs(string $name, string ...$names): self
6161
*/
6262
public function getSheets(ReaderInterface $reader): Generator
6363
{
64+
/** @var SheetInterface $sheet */
6465
foreach ($reader->getSheetIterator() as $sheet) {
6566
if (($this->accept)($sheet)) {
6667
yield $sheet;

0 commit comments

Comments
 (0)