Skip to content

Commit c7965db

Browse files
authored
Cleanups and chores (#1947)
* Cleanups and chores * Fixed infection configuration
1 parent ee96580 commit c7965db

File tree

15 files changed

+85
-92
lines changed

15 files changed

+85
-92
lines changed

infection.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@
7474
},
7575
"bootstrap": "vendor/autoload.php",
7676
"phpUnit": {
77-
"customPath": "tools/phpunit/vendor/bin/phpunit"
77+
"customPath": "tools/phpunit/vendor/bin/phpunit",
78+
"configDir": "tools/infection"
7879
},
7980
"tmpDir": "var/infection/cache",
80-
"testFrameworkOptions": "--testsuite=infection",
8181
"minMsi": 30,
8282
"minCoveredMsi": 75
8383
}

phpunit.xml.dist

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,6 @@
168168
<testsuite name="adapter-xml-integration">
169169
<directory>src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Integration</directory>
170170
</testsuite>
171-
<testsuite name="infection">
172-
<directory>src/core/etl/tests/Flow/ETL/Tests/Unit</directory>
173-
<directory>src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit</directory>
174-
<directory>src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit</directory>
175-
<directory>src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit</directory>
176-
<directory>src/lib/parquet/tests/Flow/Parquet/Tests/Unit</directory>
177-
</testsuite>
178171
</testsuites>
179172
<source>
180173
<include>

shell.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
let
22
nixpkgs = fetchTarball {
3-
url = "https://github.com/NixOS/nixpkgs/archive/41239f03433fe534c51a1526bed9214ab2a3582f.tar.gz";
4-
3+
# Oct 31, 2025
4+
url = "https://github.com/NixOS/nixpkgs/archive/66a437ebcf6160152336e801a7ec289ba2aba3c5.tar.gz";
55
};
66

77
lockedPkgs = import nixpkgs {

src/core/etl/tests/Flow/ETL/Tests/Unit/NativePHPRandomValueGeneratorTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Flow\ETL\NativePHPRandomValueGenerator;
88
use Flow\ETL\Tests\FlowTestCase;
9+
use PHPUnit\Framework\Attributes\DataProvider;
910

1011
final class NativePHPRandomValueGeneratorTest extends FlowTestCase
1112
{
@@ -51,7 +52,7 @@ public function test_can_create_random_int_from_given_range() : void
5152
);
5253
}
5354

54-
/** @dataProvider integers_provider */
55+
#[DataProvider('integers_provider')]
5556
public function test_can_create_random_string_with_given_length(int $expectedLength) : void
5657
{
5758
self::assertSame($expectedLength, mb_strlen((new NativePHPRandomValueGenerator())->string($expectedLength)));
@@ -69,14 +70,14 @@ public function test_empty_string_on_length_below_1() : void
6970
);
7071
}
7172

72-
/** @dataProvider invalid_range_provider */
73+
#[DataProvider('invalid_range_provider')]
7374
public function test_fail_on_invalid_range(int $min, int $max) : void
7475
{
7576
self::expectException(\ValueError::class);
7677
(new NativePHPRandomValueGenerator())->int($min, $max);
7778
}
7879

79-
/** @dataProvider valid_range_provider */
80+
#[DataProvider('valid_range_provider')]
8081
public function test_return_random_int_on_valid_range(int $min, int $max) : void
8182
{
8283
self::assertThat(

src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Path/UnixPathTest.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Flow\Filesystem\Exception\InvalidArgumentException;
99
use Flow\Filesystem\Path\{Options, UnixPath};
1010
use Flow\Filesystem\Tests\Unit\PathTestCase;
11+
use PHPUnit\Framework\Attributes\DataProvider;
1112

1213
final class UnixPathTest extends PathTestCase
1314
{
@@ -221,9 +222,7 @@ public function test_options_handling() : void
221222
self::assertEquals(['key' => 'value'], $path->options()->toArray());
222223
}
223224

224-
/**
225-
* @dataProvider pathProvider
226-
*/
225+
#[DataProvider('pathProvider')]
227226
public function test_os_agnostic_logic(string $input, string $expectedPath, string $expectedScheme) : void
228227
{
229228
$path = new UnixPath($input);
@@ -311,9 +310,7 @@ public function test_path_method() : void
311310
self::assertEquals('/path/file.txt', $path->path());
312311
}
313312

314-
/**
315-
* @dataProvider patternProvider
316-
*/
313+
#[DataProvider('patternProvider')]
317314
public function test_pattern_logic(string $pattern, string $filename, bool $expected) : void
318315
{
319316
$patternPath = new UnixPath($pattern);
@@ -468,9 +465,7 @@ public function test_set_extension_without_existing_extension() : void
468465
self::assertEquals('/path/to/file.txt', $newPath->path());
469466
}
470467

471-
/**
472-
* @dataProvider partitionProvider
473-
*/
468+
#[DataProvider('partitionProvider')]
474469
public function test_shared_partition_logic(string $input, array $partitionData, string $expected) : void
475470
{
476471
$path = new UnixPath($input);

src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Path/WindowsPathTest.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Flow\Filesystem\Exception\InvalidArgumentException;
99
use Flow\Filesystem\Path\{Options, WindowsPath};
1010
use Flow\Filesystem\Tests\Unit\PathTestCase;
11+
use PHPUnit\Framework\Attributes\DataProvider;
1112

1213
final class WindowsPathTest extends PathTestCase
1314
{
@@ -253,9 +254,7 @@ public function test_options_handling() : void
253254
self::assertEquals(['key' => 'value'], $path->options()->toArray());
254255
}
255256

256-
/**
257-
* @dataProvider pathProvider
258-
*/
257+
#[DataProvider('pathProvider')]
259258
public function test_os_agnostic_logic(string $input, string $expectedPath, string $expectedScheme) : void
260259
{
261260
$path = new WindowsPath($input);
@@ -264,9 +263,7 @@ public function test_os_agnostic_logic(string $input, string $expectedPath, stri
264263
self::assertEquals($expectedScheme, $path->protocol()->name);
265264
}
266265

267-
/**
268-
* @dataProvider partitionProvider
269-
*/
266+
#[DataProvider('partitionProvider')]
270267
public function test_partition_logic(string $input, array $partitionData, string $expected) : void
271268
{
272269
$path = new WindowsPath($input);
@@ -364,9 +361,7 @@ public function test_pathinfo_backslash_edge_case() : void
364361
self::assertEquals('file://', $parent->uri());
365362
}
366363

367-
/**
368-
* @dataProvider patternProvider
369-
*/
364+
#[DataProvider('patternProvider')]
370365
public function test_pattern_logic(string $pattern, string $filename, bool $expected) : void
371366
{
372367
$patternPath = new WindowsPath($pattern);

src/lib/parquet/src/Flow/Parquet/Writer/PageBuilder/DictionaryBuilder/ScalarDictionaryBuilder.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,15 @@ public function build(WriteFlatColumnValues $data) : Dictionary
2121
continue;
2222
}
2323

24-
/** @phpstan-ignore-next-line */
25-
if (!isset($valueToIndex[$value])) {
24+
$key = \is_float($value) ? \serialize($value) : $value;
25+
26+
if (!isset($valueToIndex[$key])) {
2627
$dictionary[] = $value;
27-
/** @phpstan-ignore-next-line */
28-
$valueToIndex[$value] = $dictionarySize;
28+
$valueToIndex[$key] = $dictionarySize;
2929
$dictionarySize++;
3030
}
3131

32-
/** @phpstan-ignore-next-line */
33-
$indices[] = $valueToIndex[$value];
32+
$indices[] = $valueToIndex[$key];
3433
}
3534

3635
foreach ($dictionary as $index => $value) {

src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/WriteColumnDataTest.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Flow\Parquet\Exception\RuntimeException;
1010
use Flow\Parquet\ParquetFile\Schema;
1111
use Flow\Parquet\ParquetFile\Schema\{FlatColumn, ListElement, MapKey, MapValue, NestedColumn};
12+
use PHPUnit\Framework\Attributes\DataProvider;
1213
use PHPUnit\Framework\TestCase;
1314

1415
final class WriteColumnDataTest extends TestCase
@@ -102,9 +103,7 @@ public function test_add_value_multiple_values() : void
102103
);
103104
}
104105

105-
/**
106-
* @dataProvider valueTypesDataProvider
107-
*/
106+
#[DataProvider('valueTypesDataProvider')]
108107
public function test_add_value_with_different_value_types(int|float|string|bool|null $value, string $expectedType) : void
109108
{
110109
/** @var FlatColumn $column */
@@ -222,10 +221,9 @@ public function test_flat_values_returns_all_flat_values() : void
222221
}
223222

224223
/**
225-
* @dataProvider initializeDataProvider
226-
*
227224
* @param array<string> $expectedFlatPaths
228225
*/
226+
#[DataProvider('initializeDataProvider')]
229227
public function test_initialize_with_different_column_types(Schema $schema, string $columnPath, array $expectedFlatPaths) : void
230228
{
231229
$column = $schema->get($columnPath);
@@ -240,9 +238,7 @@ public function test_initialize_with_different_column_types(Schema $schema, stri
240238
}
241239
}
242240

243-
/**
244-
* @dataProvider isEmptyDataProvider
245-
*/
241+
#[DataProvider('isEmptyDataProvider')]
246242
public function test_is_empty(bool $isEmpty, \Closure $setupCallback) : void
247243
{
248244
/** @var FlatColumn $column */

src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Thrift/MemoryBufferTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Flow\Parquet\Tests\Unit\Thrift;
66

77
use Flow\Parquet\Thrift\MemoryBuffer;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89
use PHPUnit\Framework\TestCase;
910
use Thrift\Exception\TTransportException;
1011

@@ -258,9 +259,7 @@ public function test_read_sequential_operations() : void
258259
self::assertSame(0, $buffer->available());
259260
}
260261

261-
/**
262-
* @dataProvider read_length_provider
263-
*/
262+
#[DataProvider('read_length_provider')]
264263
public function test_read_various_lengths(int $dataLength, int $readLength, int $expectedReadLength) : void
265264
{
266265
$data = \str_repeat('A', $dataLength);
@@ -351,9 +350,7 @@ public function test_write_multiple_times() : void
351350
self::assertSame(11, $buffer->available());
352351
}
353352

354-
/**
355-
* @dataProvider write_data_provider
356-
*/
353+
#[DataProvider('write_data_provider')]
357354
public function test_write_various_data_types(string $data) : void
358355
{
359356
$buffer = new MemoryBuffer();

src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnChunkBuilder/NestedColumnChunkBuilderTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Flow\Parquet\ParquetFile\Schema\{FlatColumn, LogicalType, NestedColumn, PhysicalType};
1212
use Flow\Parquet\Writer\ColumnChunkBuilder\{NestedColumnChunkBuilder, PlainFlatColumnChunkBuilder};
1313
use Flow\Parquet\Writer\{ColumnChunkBuilder, ColumnChunkContainer};
14+
use PHPUnit\Framework\Attributes\DataProvider;
1415
use PHPUnit\Framework\TestCase;
1516

1617
final class NestedColumnChunkBuilderTest extends TestCase
@@ -286,10 +287,9 @@ public function test_constructor_initializes_correctly() : void
286287
}
287288

288289
/**
289-
* @dataProvider nested_column_structures_provider
290-
*
291290
* @param array<FlatColumn> $children
292291
*/
292+
#[DataProvider('nested_column_structures_provider')]
293293
public function test_constructor_with_different_nested_structures(array $children, string $description) : void
294294
{
295295
$nestedColumn = NestedColumn::create('nested', $children);
@@ -759,9 +759,7 @@ public function test_workflow_multiple_cycles() : void
759759
self::assertSame(3, $containers[0]->columnChunk->valuesCount());
760760
}
761761

762-
/**
763-
* @dataProvider compression_types_provider
764-
*/
762+
#[DataProvider('compression_types_provider')]
765763
public function test_workflow_with_different_compressions(Compressions $compression) : void
766764
{
767765
$childColumn = new FlatColumn('child', PhysicalType::INT32);

0 commit comments

Comments
 (0)