Skip to content

Commit

Permalink
infra: bump sigwin/infra (#179)
Browse files Browse the repository at this point in the history
* infra: bump sigwin/infra

* fix: bump Phpspreadsheet
  • Loading branch information
dkarlovi authored Sep 7, 2023
1 parent 82545ec commit 2065fe0
Show file tree
Hide file tree
Showing 27 changed files with 67 additions and 204 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"nyholm/nsa": "^1.1",
"nyholm/symfony-bundle-test": "dev-master",
"openspout/openspout": "^4.0",
"phpoffice/phpspreadsheet": "^1.18",
"phpoffice/phpspreadsheet": "^1.29",
"phpunit/phpunit": "^9.6",
"sigwin/infra": "~1.5.0",
"sigwin/infra": "~1.6.0",
"symfony/console": "^5.4 || ^6.0",
"symfony/framework-bundle": "^5.4 || ^6.0",
"symfony/phpunit-bridge": "^5.4 || ^6.0",
Expand Down
8 changes: 7 additions & 1 deletion infection.json.dist
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@
"@default": true,
"IdenticalEqual": false,
"NotIdenticalNotEqual": false,
"IfNegation": {
"ignore": [
"Xezilaires\\Bridge\\Symfony\\DependencyInjection\\XezilairesExtension::load::36",
"Xezilaires\\Bridge\\Symfony\\DependencyInjection\\XezilairesExtension::load::39"
]
},
"MethodCallRemoval": {
"ignore": [
"Xezilaires\\Bridge\\Symfony\\DependencyInjection\\XezilairesExtension::load::45"
"Xezilaires\\Bridge\\Symfony\\DependencyInjection\\XezilairesExtension::load::43"
]
}
}
Expand Down
21 changes: 0 additions & 21 deletions src/Bridge/PhpSpreadsheet/RowIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,49 +30,31 @@ public function __construct(PhpSpreadsheetRowIterator $iterator)
$this->iterator = $iterator;
}

/**
* {@inheritdoc}
*/
public function current(): object
{
return $this->iterator->current();
}

/**
* {@inheritdoc}
*/
public function next(): void
{
$this->iterator->next();
}

/**
* {@inheritdoc}
*/
public function key(): int
{
return $this->iterator->key();
}

/**
* {@inheritdoc}
*/
public function valid(): bool
{
return $this->iterator->valid();
}

/**
* {@inheritdoc}
*/
public function rewind(): void
{
$this->iterator->rewind();
}

/**
* {@inheritdoc}
*/
public function seek(int $rowIndex): void
{
try {
Expand All @@ -82,9 +64,6 @@ public function seek(int $rowIndex): void
}
}

/**
* {@inheritdoc}
*/
public function prev(): void
{
$this->iterator->prev();
Expand Down
15 changes: 0 additions & 15 deletions src/Bridge/PhpSpreadsheet/Spreadsheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ public static function fromFile(\SplFileObject $file): SpreadsheetInterface
return new self($file);
}

/**
* {@inheritdoc}
*/
public function createIterator(int $startRowIndex): void
{
/** @psalm-suppress RedundantPropertyInitializationCheck */
Expand All @@ -62,9 +59,6 @@ public function createIterator(int $startRowIndex): void
$this->iterator = new RowIterator($sheet->getRowIterator($startRowIndex));
}

/**
* {@inheritdoc}
*/
public function getIterator(): Iterator
{
/** @psalm-suppress RedundantPropertyInitializationCheck */
Expand All @@ -75,9 +69,6 @@ public function getIterator(): Iterator
return $this->iterator;
}

/**
* {@inheritdoc}
*/
public function getCurrentRow(): array
{
/** @var Row $row */
Expand All @@ -86,9 +77,6 @@ public function getCurrentRow(): array
return $this->getRow($row->getRowIndex());
}

/**
* {@inheritdoc}
*/
public function getRow(int $rowIndex): array
{
$data = [];
Expand All @@ -103,9 +91,6 @@ public function getRow(int $rowIndex): array
return $data;
}

/**
* {@inheritdoc}
*/
public function getHighestRow(): int
{
return $this->getActiveWorksheet()->getHighestRow();
Expand Down
2 changes: 1 addition & 1 deletion src/Bridge/PhpSpreadsheet/Test/RowIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private function mockIterator(?array $counts = null): PhpspreadsheetRowIterator
$count = $spec['count'];

$mocker = $iterator
->expects(static::exactly($count))
->expects(self::exactly($count))
->method($method)
->with(...(array) $spec['params'])
;
Expand Down
2 changes: 1 addition & 1 deletion src/Bridge/PhpSpreadsheet/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"require": {
"php": "^8.1",
"phpoffice/phpspreadsheet": "^1.18",
"phpoffice/phpspreadsheet": "^1.29",
"sigwin/xezilaires": "^0.6"
},
"require-dev": {
Expand Down
21 changes: 0 additions & 21 deletions src/Bridge/Spout/RowIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ public function __construct(RowIteratorInterface $iterator, int $firstRow)
$this->firstRow = $firstRow;
}

/**
* {@inheritdoc}
*/
public function current(): object
{
/**
Expand All @@ -57,17 +54,11 @@ public function current(): object
return new \ArrayObject($current);
}

/**
* {@inheritdoc}
*/
public function next(): void
{
$this->iterator->next();
}

/**
* {@inheritdoc}
*/
public function key(): int
{
/** @var int $key */
Expand All @@ -76,25 +67,16 @@ public function key(): int
return $key;
}

/**
* {@inheritdoc}
*/
public function valid(): bool
{
return $this->iterator->valid();
}

/**
* {@inheritdoc}
*/
public function rewind(): void
{
$this->seek($this->firstRow);
}

/**
* {@inheritdoc}
*/
public function seek(int $rowIndex): void
{
$currentIndex = $this->key();
Expand All @@ -111,9 +93,6 @@ public function seek(int $rowIndex): void
}
}

/**
* {@inheritdoc}
*/
public function prev(): void
{
$this->seek($this->key() - 1);
Expand Down
12 changes: 0 additions & 12 deletions src/Bridge/Spout/Spreadsheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ public static function fromFile(\SplFileObject $file): SpreadsheetInterface
return new self($file);
}

/**
* {@inheritdoc}
*/
public function createIterator(int $startRowIndex): void
{
/** @psalm-suppress RedundantPropertyInitializationCheck */
Expand All @@ -80,9 +77,6 @@ public function getIterator(): Iterator
return $this->iterator;
}

/**
* {@inheritdoc}
*/
public function getRow(int $rowIndex): array
{
$iterator = $this->getIterator();
Expand All @@ -94,9 +88,6 @@ public function getRow(int $rowIndex): array
return $row;
}

/**
* {@inheritdoc}
*/
public function getCurrentRow(): array
{
/** @var \ArrayObject $rowArrayObject */
Expand All @@ -117,9 +108,6 @@ public function getCurrentRow(): array
return $row;
}

/**
* {@inheritdoc}
*/
public function getHighestRow(): int
{
/** @psalm-suppress RedundantPropertyInitializationCheck */
Expand Down
14 changes: 7 additions & 7 deletions src/Bridge/Spout/Test/RowIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class RowIteratorTest extends TestCase
/**
* @return list<array{0: int, 1: int, 2: int, 3: array{rewind: int, next: int, valid: int}}>
*/
public function seekProvider(): array
public function provideCanSeekProperlyCases(): iterable
{
return [
[2, 2, 2, ['rewind' => 1, 'next' => 0, 'valid' => 0]],
Expand All @@ -41,15 +41,15 @@ public function seekProvider(): array
/**
* @return list<array{0: int, 1: int, 2: int, 3: array{rewind: int, next: int}, 4: array{valid: list<bool>}}>
*/
public function getHighestRowProvider(): array
public function provideCanDetermineHighestRowProperlyCases(): iterable
{
return [
[1, 1, 2, ['rewind' => 2, 'next' => 2], ['valid' => [true, true, false]]],
];
}

/**
* @dataProvider seekProvider
* @dataProvider provideCanSeekProperlyCases
*
* @param array<string, int> $counts
*/
Expand All @@ -60,7 +60,7 @@ public function testCanSeekProperly(int $startRow, int $currentRow, int $seekToR
}

/**
* @dataProvider getHighestRowProvider
* @dataProvider provideCanDetermineHighestRowProperlyCases
*
* @param array<string, int> $counts
* @param array<string, array> $calls
Expand All @@ -71,7 +71,7 @@ public function testCanDetermineHighestRowProperly(int $startRow, int $currentRo
++$counts['rewind'];

$iterator = new RowIterator($this->mockIterator($currentRow, $counts, $calls), $startRow);
static::assertSame($highestRow, $iterator->getHighestRow());
self::assertSame($highestRow, $iterator->getHighestRow());
}

/**
Expand All @@ -93,7 +93,7 @@ private function mockIterator(int $currentRow, ?array $counts = null, ?array $ca
if ($counts !== null) {
foreach ($counts as $method => $count) {
$iterator
->expects(static::exactly($count))
->expects(self::exactly($count))
->method($method)
;
}
Expand All @@ -102,7 +102,7 @@ private function mockIterator(int $currentRow, ?array $counts = null, ?array $ca
if ($calls !== null) {
foreach ($calls as $method => $return) {
$iterator
->expects(static::exactly(\count($return)))
->expects(self::exactly(\count($return)))
->method($method)
->willReturnOnConsecutiveCalls(...$return)
;
Expand Down
2 changes: 1 addition & 1 deletion src/Bridge/Spout/Test/SpreadsheetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ public function testCanCorrectlyCalculateColumns(): void
$object = new Spreadsheet($this->invalidFixture('products.xlsx'));
NSA::setProperty($object, 'iterator', new FakeIterator([(object) $row]));

static::assertSame(array_combine($values, $values), $object->getCurrentRow());
self::assertSame(array_combine($values, $values), $object->getCurrentRow());
}
}
3 changes: 0 additions & 3 deletions src/Bridge/Symfony/Command/SerializeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ public function __construct(IteratorFactory $iteratorFactory, Serializer $serial
$this->serializer = $serializer;
}

/**
* {@inheritdoc}
*/
protected function configure(): void
{
$this
Expand Down
3 changes: 0 additions & 3 deletions src/Bridge/Symfony/Command/ValidateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ public function __construct(IteratorFactory $iteratorFactory, Validator $validat
$this->validator = $validator;
}

/**
* {@inheritdoc}
*/
protected function configure(): void
{
$this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
*/
final class RegisterCommandsCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container): void
{
/** @var array<string, array<string, string>> $commands */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
final class XezilairesExtension extends Extension
{
/**
* {@inheritdoc}
*
* @throws \Exception
*/
public function load(array $configs, ContainerBuilder $container): void
Expand Down
Loading

0 comments on commit 2065fe0

Please sign in to comment.