; rel="prev"',
@@ -27,7 +27,7 @@ public function test_next_request_follows_link_header(): void
{
static::assertSame(
'https://api.example.com/items?page=2',
- (new LinkHeader())
+ new LinkHeader()
->nextRequest(
PaginationMother::request('GET', 'https://api.example.com/items'),
PaginationMother::decoded(['data' => [1]], [
@@ -42,7 +42,7 @@ public function test_next_request_follows_link_header(): void
public function test_next_request_removes_custom_sensitive_headers_on_cross_host(): void
{
- $result = (new LinkHeader('next', [...SensitiveHeaders::toArray(), 'X-Tenant-Secret']))->nextRequest(
+ $result = new LinkHeader('next', [...SensitiveHeaders::toArray(), 'X-Tenant-Secret'])->nextRequest(
PaginationMother::request('GET', 'https://api.example.com/items')
->withHeader('Authorization', 'Bearer secret')
->withHeader('X-Tenant-Secret', 'key'),
diff --git a/src/adapter/etl-adapter-http/tests/Flow/ETL/Adapter/Http/Tests/Unit/IO/Extractor/Pagination/Strategy/NextUrlFromBodyTest.php b/src/adapter/etl-adapter-http/tests/Flow/ETL/Adapter/Http/Tests/Unit/IO/Extractor/Pagination/Strategy/NextUrlFromBodyTest.php
index 8ec163f420..8c76c5bc03 100644
--- a/src/adapter/etl-adapter-http/tests/Flow/ETL/Adapter/Http/Tests/Unit/IO/Extractor/Pagination/Strategy/NextUrlFromBodyTest.php
+++ b/src/adapter/etl-adapter-http/tests/Flow/ETL/Adapter/Http/Tests/Unit/IO/Extractor/Pagination/Strategy/NextUrlFromBodyTest.php
@@ -14,7 +14,7 @@ final class NextUrlFromBodyTest extends FlowTestCase
{
public function test_missing_url_stops(): void
{
- static::assertNull((new NextUrlFromBody('@odata\.nextLink'))->nextRequest(
+ static::assertNull(new NextUrlFromBody('@odata\.nextLink')->nextRequest(
PaginationMother::request(),
PaginationMother::decoded(['value' => [1]]),
new PageState(pagesFetched: 1),
@@ -25,7 +25,7 @@ public function test_next_request_replaces_uri_with_body_url(): void
{
static::assertSame(
'https://api.example.com/items?page=2',
- (new NextUrlFromBody('@odata\.nextLink'))
+ new NextUrlFromBody('@odata\.nextLink')
->nextRequest(
PaginationMother::request('GET', 'https://api.example.com/items?page=1'),
PaginationMother::decoded(['@odata.nextLink' => 'https://api.example.com/items?page=2']),
@@ -38,10 +38,10 @@ public function test_next_request_replaces_uri_with_body_url(): void
public function test_next_request_removes_custom_sensitive_headers_on_cross_host(): void
{
- $result = (new NextUrlFromBody('@odata\\.nextLink', [
+ $result = new NextUrlFromBody('@odata\\.nextLink', [
...SensitiveHeaders::toArray(),
'X-Tenant-Secret',
- ]))->nextRequest(
+ ])->nextRequest(
PaginationMother::request('GET', 'https://api.example.com/items?page=1')
->withHeader('Authorization', 'Bearer secret')
->withHeader('X-Tenant-Secret', 'key'),
diff --git a/src/adapter/etl-adapter-http/tests/Flow/ETL/Adapter/Http/Tests/Unit/IO/Extractor/Pagination/Strategy/OffsetLimitTest.php b/src/adapter/etl-adapter-http/tests/Flow/ETL/Adapter/Http/Tests/Unit/IO/Extractor/Pagination/Strategy/OffsetLimitTest.php
index 00ac909ae9..cf81ee30e9 100644
--- a/src/adapter/etl-adapter-http/tests/Flow/ETL/Adapter/Http/Tests/Unit/IO/Extractor/Pagination/Strategy/OffsetLimitTest.php
+++ b/src/adapter/etl-adapter-http/tests/Flow/ETL/Adapter/Http/Tests/Unit/IO/Extractor/Pagination/Strategy/OffsetLimitTest.php
@@ -16,11 +16,11 @@ public function test_counts_limit_per_page(): void
{
static::assertSame(
25,
- (new OffsetLimit(
+ new OffsetLimit(
RequestOption::queryParam('offset'),
RequestOption::queryParam('limit'),
25,
- ))->countResults(PaginationMother::decoded(['data' => [1]])),
+ )->countResults(PaginationMother::decoded(['data' => [1]])),
);
}
diff --git a/src/adapter/etl-adapter-json/composer.json b/src/adapter/etl-adapter-json/composer.json
index 8d768ba467..8e0023d205 100644
--- a/src/adapter/etl-adapter-json/composer.json
+++ b/src/adapter/etl-adapter-json/composer.json
@@ -11,7 +11,7 @@
"adapter"
],
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"ext-json": "*",
"flow-php/etl": "self.version",
"flow-php/filesystem": "self.version",
diff --git a/src/adapter/etl-adapter-json/src/Flow/ETL/Adapter/JSON/IO/Extractor/JsonExtractor.php b/src/adapter/etl-adapter-json/src/Flow/ETL/Adapter/JSON/IO/Extractor/JsonExtractor.php
index fdf75d8874..9ed804c8c0 100644
--- a/src/adapter/etl-adapter-json/src/Flow/ETL/Adapter/JSON/IO/Extractor/JsonExtractor.php
+++ b/src/adapter/etl-adapter-json/src/Flow/ETL/Adapter/JSON/IO/Extractor/JsonExtractor.php
@@ -192,7 +192,7 @@ private function describe(): Schema
$derived = $this->derived->schema();
if ($derived === null) {
- $inferred = (new SchemaInferrer($this->inference))->infer(
+ $inferred = new SchemaInferrer($this->inference)->infer(
new JsonSniffer(
new JsonFileReader($this->filesystem, $this->format, $this->pointer, $this->pointerToColumnName),
$this->files->of(new Criteria()),
diff --git a/src/adapter/etl-adapter-json/src/Flow/ETL/Adapter/JSON/IO/Extractor/JsonFileReader.php b/src/adapter/etl-adapter-json/src/Flow/ETL/Adapter/JSON/IO/Extractor/JsonFileReader.php
index 178b2fc1ed..a795dae2ef 100644
--- a/src/adapter/etl-adapter-json/src/Flow/ETL/Adapter/JSON/IO/Extractor/JsonFileReader.php
+++ b/src/adapter/etl-adapter-json/src/Flow/ETL/Adapter/JSON/IO/Extractor/JsonFileReader.php
@@ -134,16 +134,16 @@ public function documentItems(SourceStream $stream): Generator
}
if ($this->pointer !== null) {
- yield from (new Items($this->chunks($stream, $first), $this->options))->getIterator();
+ yield from new Items($this->chunks($stream, $first), $this->options)->getIterator();
return;
}
- yield from (new JsonArrayElements())->of(
+ yield from new JsonArrayElements()->of(
$stream,
$first,
fn(int $skip): LimitIterator => new LimitIterator(
- (new Items($this->chunks($stream, $first), $this->options))->getIterator(),
+ new Items($this->chunks($stream, $first), $this->options)->getIterator(),
$skip,
),
);
diff --git a/src/adapter/etl-adapter-json/src/Flow/ETL/Adapter/JSON/IO/Loader/JsonLoader.php b/src/adapter/etl-adapter-json/src/Flow/ETL/Adapter/JSON/IO/Loader/JsonLoader.php
index a40c70e28b..d3f6b33cee 100644
--- a/src/adapter/etl-adapter-json/src/Flow/ETL/Adapter/JSON/IO/Loader/JsonLoader.php
+++ b/src/adapter/etl-adapter-json/src/Flow/ETL/Adapter/JSON/IO/Loader/JsonLoader.php
@@ -80,13 +80,13 @@ public function __construct(
public static function fromDescription(#[SensitiveParameter] array $data, Rebuild $rebuild): static
{
- $loader = (new self(
+ $loader = new self(
Path::fromArray(type_array()->assert($data['path'] ?? null)),
$rebuild->of($data['filesystem'] ?? null, ConfiguredFilesystem::class)->filesystem(),
type_enum(JsonFraming::class)->assert(constant(
JsonFraming::class . '::' . type_string()->assert($data['framing'] ?? null),
)),
- ))
+ )
->saveMode(type_enum(SaveMode::class)->assert(constant(
SaveMode::class . '::' . type_string()->assert($data['save_mode'] ?? null),
)))
@@ -167,7 +167,7 @@ public function partitioning(): Partitioning
public function inTask(Part $task): static
{
- $loader = (new self($this->path, $this->filesystem, $this->framing, $this->extension))
+ $loader = new self($this->path, $this->filesystem, $this->framing, $this->extension)
->saveMode($this->saveMode)
->withFlags($this->flags)
->withDateFormat($this->dateFormat)
diff --git a/src/adapter/etl-adapter-json/src/Flow/ETL/Adapter/JSON/functions.php b/src/adapter/etl-adapter-json/src/Flow/ETL/Adapter/JSON/functions.php
index 45878176eb..8e6d571671 100644
--- a/src/adapter/etl-adapter-json/src/Flow/ETL/Adapter/JSON/functions.php
+++ b/src/adapter/etl-adapter-json/src/Flow/ETL/Adapter/JSON/functions.php
@@ -78,7 +78,7 @@ function to_json(
bool $put_rows_in_new_lines = false,
Filesystem $filesystem = new NativeLocalFilesystem(),
): JsonLoader {
- return (new JsonLoader(is_string($path) ? path_real($path) : $path, $filesystem))
+ return new JsonLoader(is_string($path) ? path_real($path) : $path, $filesystem)
->withFlags($flags)
->withDateTimeFormat($date_time_format)
->withRowsInNewLines($put_rows_in_new_lines);
@@ -112,7 +112,7 @@ function schema_from_json_schema(
?RequestFactoryInterface $request_factory = null,
Filesystem $filesystem = new NativeLocalFilesystem(),
): Schema {
- return (new SchemaConverter(new ReferenceResolver($client, $request_factory, $filesystem)))->toFlowSchema(
+ return new SchemaConverter(new ReferenceResolver($client, $request_factory, $filesystem))->toFlowSchema(
$json_schema,
);
}
@@ -125,5 +125,5 @@ function schema_from_json_schema(
#[DocumentationDSL(module: Module::JSON, type: Type::HELPER)]
function schema_to_json_schema(Schema $schema): array
{
- return (new SchemaConverter())->toJsonSchema($schema);
+ return new SchemaConverter()->toJsonSchema($schema);
}
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Context/DescribableFixtures.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Context/DescribableFixtures.php
index d37c523bc3..c801f02ef6 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Context/DescribableFixtures.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Context/DescribableFixtures.php
@@ -34,7 +34,7 @@ public static function all(): array
JsonFileBatches::class => static fn(): Describable => new JsonFileBatches(
ETLDescribableFixtures::mountedFilesystem(),
self::jsonReader(),
- inference: (new SchemaInference(500, unionByName: true))->everySource(),
+ inference: new SchemaInference(500, unionByName: true)->everySource(),
),
JsonFileReader::class => self::jsonReader(...),
JsonLoader::class => static fn(): Describable => new JsonLoader(
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Context/JsonFixtureContext.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Context/JsonFixtureContext.php
index ca5f145f8b..c3d0e0de57 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Context/JsonFixtureContext.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Context/JsonFixtureContext.php
@@ -56,7 +56,7 @@ public static function globSources(string $glob, Filesystem $filesystem = new Na
{
$sources = [];
- foreach ((new FileListing($filesystem))->list(path(self::path($glob)), new OnlyFiles()) as $status) {
+ foreach (new FileListing($filesystem)->list(path(self::path($glob)), new OnlyFiles()) as $status) {
$sources[] = new SourceFile($status->path, $status->size);
}
@@ -97,7 +97,7 @@ public static function format(string $fixture): JsonFraming
*/
public static function infer(string $fixture, SchemaInference $inference = new SchemaInference()): Schema
{
- return (new SchemaInferrer($inference))->infer(self::sniffer(self::format($fixture), [self::source(
+ return new SchemaInferrer($inference)->infer(self::sniffer(self::format($fixture), [self::source(
$fixture,
)]), new VoidProgress())->schema;
}
@@ -128,7 +128,7 @@ public static function open(
Filesystem $filesystem = new NativeLocalFilesystem(),
?string $pointer = null,
): JsonOpenSource {
- return (new JsonFileBatches($filesystem, self::reader($format, $filesystem, pointer: $pointer)))->open($source);
+ return new JsonFileBatches($filesystem, self::reader($format, $filesystem, pointer: $pointer))->open($source);
}
/**
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonExtractorTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonExtractorTest.php
index 0d35613cb3..98c14eacfa 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonExtractorTest.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonExtractorTest.php
@@ -96,11 +96,11 @@ public function test_an_empty_array_lines_document_reads_no_rows(): void
[],
iterator_to_array(
FlowTestCase::extracted(
- (new JsonExtractor(
+ new JsonExtractor(
path('memory://framing/empty.json'),
MemoryFiles::with(['memory://framing/empty.json' => "[\n\n]"]),
JsonFraming::ArrayLines,
- ))->withSchema(schema(int_schema('id'))),
+ )->withSchema(schema(int_schema('id'))),
flow_context(config())->backend(),
new Criteria(),
),
@@ -932,7 +932,7 @@ public function test_extract_split_stops_on_the_stop_signal(): void
$generator = FlowTestCase::extracted(
$extractor,
flow_context()->backend(),
- (new Criteria())->withSplit($extractor->splits(new Criteria(), 1)[0]),
+ new Criteria()->withSplit($extractor->splits(new Criteria(), 1)[0]),
);
$totalRows = 0;
@@ -974,7 +974,7 @@ public function test_a_pushed_path_filter_prunes_the_files_splits_are_cut_from()
static::assertEquals(
[new FileSplit($extractor->source(), 0, null)],
- $extractor->splits((new Criteria())->withPathFilter(new RejectingFilter()), 1),
+ $extractor->splits(new Criteria()->withPathFilter(new RejectingFilter()), 1),
);
}
}
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonFileBatchesTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonFileBatchesTest.php
index 244f0331c8..df9ecdeb4f 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonFileBatchesTest.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonFileBatchesTest.php
@@ -143,11 +143,11 @@ public function test_a_flow_php_of_another_abi_is_refused_before_the_file_is_ope
$filesystem = new CountingFilesystem(new NativeLocalFilesystem());
try {
- (new JsonFileBatches(
+ new JsonFileBatches(
$filesystem,
JsonFixtureContext::reader(JsonFraming::Lines, $filesystem),
extension: new FlowPhpExtension(true, FlowPhpExtension::ABI + 1, '0.46.0'),
- ))->open(JsonFixtureContext::source('five_rows.jsonl'));
+ )->open(JsonFixtureContext::source('five_rows.jsonl'));
static::fail('a skewed flow_php must be refused');
} catch (RuntimeException $e) {
static::assertStringContainsString('does not match flow-php/etl', $e->getMessage());
@@ -158,11 +158,11 @@ public function test_a_flow_php_of_another_abi_is_refused_before_the_file_is_ope
public function test_without_flow_php_a_file_is_read_by_the_php_lane_whatever_is_loaded(): void
{
- $open = (new JsonFileBatches(
+ $open = new JsonFileBatches(
new NativeLocalFilesystem(),
JsonFixtureContext::reader(JsonFraming::Lines, new NativeLocalFilesystem()),
extension: new FlowPhpExtension(false, null),
- ))->open(JsonFixtureContext::source('five_rows.jsonl'));
+ )->open(JsonFixtureContext::source('five_rows.jsonl'));
static::assertInstanceOf(Generator::class, $open->batches(schema(int_schema('id')), 2, new PhpBackend()));
$open->close();
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonFileReaderTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonFileReaderTest.php
index 0f152f75bf..d7b31ff34c 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonFileReaderTest.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonFileReaderTest.php
@@ -271,7 +271,7 @@ public function test_a_reader_over_the_local_filesystem_describes_and_rebuilds_e
['format' => 'Lines', 'pointer' => '/items', 'pointer_to_column_name' => true],
array_slice($description->data, 1),
);
- static::assertEquals($reader, (new Rebuild())->object(
+ static::assertEquals($reader, new Rebuild()->object(
Description::fromArray($description->normalize()),
JsonFileReader::class,
));
@@ -279,26 +279,24 @@ public function test_a_reader_over_the_local_filesystem_describes_and_rebuilds_e
public function test_a_reader_over_a_memory_filesystem_does_not_describe(): void
{
- static::assertNull((new JsonFileReader(memory_filesystem(), JsonFraming::Array, null, false))->describe());
+ static::assertNull(new JsonFileReader(memory_filesystem(), JsonFraming::Array, null, false)->describe());
}
public function test_the_reader_declares_json(): void
{
static::assertSame(
['json'],
- (new JsonFileReader(new NativeLocalFilesystem(), JsonFraming::Array, null, false))
- ->describe()
- ?->extensions(),
+ new JsonFileReader(new NativeLocalFilesystem(), JsonFraming::Array, null, false)->describe()?->extensions(),
);
}
public function test_points_into_when_a_pointer_is_set(): void
{
static::assertTrue(
- (new JsonFileReader(new NativeLocalFilesystem(), JsonFraming::Array, '/items', false))->pointsInto(),
+ new JsonFileReader(new NativeLocalFilesystem(), JsonFraming::Array, '/items', false)->pointsInto(),
);
static::assertFalse(
- (new JsonFileReader(new NativeLocalFilesystem(), JsonFraming::Array, null, false))->pointsInto(),
+ new JsonFileReader(new NativeLocalFilesystem(), JsonFraming::Array, null, false)->pointsInto(),
);
}
@@ -310,7 +308,7 @@ public function test_a_window_narrows_only_lines_and_never_the_split_of_a_whole_
static::assertSame($split, $lines->window($split));
static::assertNull($lines->window(null));
static::assertNull($lines->window(new FileSplit(path('file:///a.jsonl'), 0, null)));
- static::assertNull((new JsonFileReader(new NativeLocalFilesystem(), JsonFraming::Array, null, false))->window(
+ static::assertNull(new JsonFileReader(new NativeLocalFilesystem(), JsonFraming::Array, null, false)->window(
$split,
));
}
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonLinesExtractorTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonLinesExtractorTest.php
index dc68db30b3..1c0bfd5eb5 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonLinesExtractorTest.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonLinesExtractorTest.php
@@ -850,7 +850,7 @@ public function test_extract_split_stops_on_the_stop_signal(): void
$generator = FlowTestCase::extracted(
$extractor,
flow_context()->backend(),
- (new Criteria())->withSplit($extractor->splits(new Criteria(), 1)[0]),
+ new Criteria()->withSplit($extractor->splits(new Criteria(), 1)[0]),
);
$totalRows = 0;
@@ -905,7 +905,7 @@ public function test_a_pushed_path_filter_prunes_the_files_splits_are_cut_from()
static::assertEquals(
[new FileSplit($extractor->source(), 0, null)],
- $extractor->splits((new Criteria())->withPathFilter(new RejectingFilter()), 1),
+ $extractor->splits(new Criteria()->withPathFilter(new RejectingFilter()), 1),
);
}
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonSplitReadTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonSplitReadTest.php
index 81803e436c..bcfb7590c6 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonSplitReadTest.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonSplitReadTest.php
@@ -76,7 +76,7 @@ public function test_the_lines_reader_reads_a_file_by_windows_as_it_reads_it_who
foreach (FlowTestCase::extracted(
DescribeRoundTrip::rebuilt($extractor->reader()),
flow_context()->backend(),
- (new Criteria())->withSplit(type_instance_of(FileSplit::class)->assert($split)),
+ new Criteria()->withSplit(type_instance_of(FileSplit::class)->assert($split)),
) as $batch) {
$rows = [...$rows, ...$batch->toArray()];
}
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/PhpJsonOpenSourceTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/PhpJsonOpenSourceTest.php
index 7829473fa5..fdb08811f7 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/PhpJsonOpenSourceTest.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/PhpJsonOpenSourceTest.php
@@ -25,10 +25,11 @@ final class PhpJsonOpenSourceTest extends FlowTestCase
public function test_batches_are_sized_and_the_tail_is_shorter(): void
{
$batches = iterator_to_array(
- (new PhpJsonOpenSource(
- JsonFixtureContext::reader(),
- JsonFixtureContext::source('five_rows.json'),
- ))->batches(schema(int_schema('id')), 2, new PhpBackend()),
+ new PhpJsonOpenSource(JsonFixtureContext::reader(), JsonFixtureContext::source('five_rows.json'))->batches(
+ schema(int_schema('id')),
+ 2,
+ new PhpBackend(),
+ ),
false,
);
@@ -43,10 +44,10 @@ public function test_batches_are_sized_and_the_tail_is_shorter(): void
public function test_under_a_declared_schema_a_refused_element_is_a_corrupted_record_numbered_in_the_document(): void
{
- $batches = (new PhpJsonOpenSource(
+ $batches = new PhpJsonOpenSource(
JsonFixtureContext::reader(JsonFraming::Array),
JsonFixtureContext::source('misfit.json'),
- ))->batches(schema(int_schema('id')), 2, new PhpBackend());
+ )->batches(schema(int_schema('id')), 2, new PhpBackend());
$rows = $batches->current();
@@ -65,10 +66,10 @@ public function test_under_a_declared_schema_a_refused_element_is_a_corrupted_re
public function test_batches_close_the_stream_when_abandoned(JsonFraming $format, string $fixture): void
{
$counting = new CountingFilesystem(new NativeLocalFilesystem());
- $batches = (new PhpJsonOpenSource(
+ $batches = new PhpJsonOpenSource(
JsonFixtureContext::reader($format, $counting),
JsonFixtureContext::source($fixture),
- ))->batches(schema(int_schema('id')), 2, new PhpBackend());
+ )->batches(schema(int_schema('id')), 2, new PhpBackend());
$rows = $batches->current();
@@ -92,10 +93,10 @@ public function test_batches_never_yield_an_empty_batch(JsonFraming $format, str
static::assertSame(
[],
iterator_to_array(
- (new PhpJsonOpenSource(
+ new PhpJsonOpenSource(
JsonFixtureContext::reader($format, $counting),
JsonFixtureContext::source($fixture),
- ))->batches(schema(int_schema('id')), 2, new PhpBackend()),
+ )->batches(schema(int_schema('id')), 2, new PhpBackend()),
false,
),
);
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/RustJsonOpenSourceTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/RustJsonOpenSourceTest.php
index b23f6fd648..f4358cbe65 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/RustJsonOpenSourceTest.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/RustJsonOpenSourceTest.php
@@ -157,7 +157,7 @@ public function test_a_window_past_the_first_byte_names_a_refused_line_by_offset
$reader = JsonFixtureContext::reader(JsonFraming::Lines, $filesystem);
$native = JsonFixtureContext::outcome(
- (new JsonFileBatches($filesystem, $reader))->open($source, $split),
+ new JsonFileBatches($filesystem, $reader)->open($source, $split),
schema(int_schema('id')),
2,
);
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/FileFormatContractTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/FileFormatContractTest.php
index 8f9e888b2c..6e7daba505 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/FileFormatContractTest.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/FileFormatContractTest.php
@@ -36,109 +36,109 @@ public static function formats(): Generator
#[DataProvider('formats')]
public function test_overwrite_replaces_what_the_destination_held(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->overwriteReplacesWhatTheDestinationHeld($format);
+ new FileFormatContract($this->cacheDir)->overwriteReplacesWhatTheDestinationHeld($format);
}
#[DataProvider('formats')]
public function test_append_keeps_what_the_destination_held(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->appendKeepsWhatTheDestinationHeld($format);
+ new FileFormatContract($this->cacheDir)->appendKeepsWhatTheDestinationHeld($format);
}
#[DataProvider('formats')]
public function test_ignore_leaves_an_existing_destination_untouched(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->ignoreLeavesAnExistingDestinationUntouched($format);
+ new FileFormatContract($this->cacheDir)->ignoreLeavesAnExistingDestinationUntouched($format);
}
#[DataProvider('formats')]
public function test_exception_if_exists_refuses_an_existing_destination(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->exceptionIfExistsRefusesAnExistingDestination($format);
+ new FileFormatContract($this->cacheDir)->exceptionIfExistsRefusesAnExistingDestination($format);
}
#[DataProvider('formats')]
public function test_a_batch_of_zero_rows_creates_no_file(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aBatchOfZeroRowsCreatesNoFile($format);
+ new FileFormatContract($this->cacheDir)->aBatchOfZeroRowsCreatesNoFile($format);
}
#[DataProvider('formats')]
public function test_a_write_that_ends_reports_its_file_operations(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aWriteThatEndsReportsItsFileOperations($format);
+ new FileFormatContract($this->cacheDir)->aWriteThatEndsReportsItsFileOperations($format);
}
#[DataProvider('formats')]
public function test_a_partitioned_write_reads_back_every_partition(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aPartitionedWriteReadsBackEveryPartition($format);
+ new FileFormatContract($this->cacheDir)->aPartitionedWriteReadsBackEveryPartition($format);
}
#[DataProvider('formats')]
public function test_a_loader_in_a_task_survives_describe(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aLoaderInATaskSurvivesDescribe($format);
+ new FileFormatContract($this->cacheDir)->aLoaderInATaskSurvivesDescribe($format);
}
#[DataProvider('formats')]
public function test_an_extractor_reader_survives_describe(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->anExtractorReaderSurvivesDescribe($format);
+ new FileFormatContract($this->cacheDir)->anExtractorReaderSurvivesDescribe($format);
}
#[DataProvider('formats')]
public function test_the_splits_read_every_row_once(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->theSplitsReadEveryRowOnce($format);
+ new FileFormatContract($this->cacheDir)->theSplitsReadEveryRowOnce($format);
}
#[DataProvider('formats')]
public function test_metadata_columns_name_the_source_file(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->metadataColumnsNameTheSourceFile($format);
+ new FileFormatContract($this->cacheDir)->metadataColumnsNameTheSourceFile($format);
}
#[DataProvider('formats')]
public function test_the_batch_size_bounds_every_batch(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->theBatchSizeBoundsEveryBatch($format);
+ new FileFormatContract($this->cacheDir)->theBatchSizeBoundsEveryBatch($format);
}
#[DataProvider('formats')]
public function test_refresh_lists_the_files_written_after_a_read(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->refreshListsTheFilesWrittenAfterARead($format);
+ new FileFormatContract($this->cacheDir)->refreshListsTheFilesWrittenAfterARead($format);
}
#[DataProvider('formats')]
public function test_a_failed_run_leaves_no_file_at_the_destination(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aFailedRunLeavesNoFileAtTheDestination($format);
+ new FileFormatContract($this->cacheDir)->aFailedRunLeavesNoFileAtTheDestination($format);
}
#[DataProvider('formats')]
public function test_an_extractor_rejects_a_path_its_filesystem_does_not_serve(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->anExtractorRejectsAPathItsFilesystemDoesNotServe($format);
+ new FileFormatContract($this->cacheDir)->anExtractorRejectsAPathItsFilesystemDoesNotServe($format);
}
#[DataProvider('formats')]
public function test_a_loader_rejects_a_path_its_filesystem_does_not_serve(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aLoaderRejectsAPathItsFilesystemDoesNotServe($format);
+ new FileFormatContract($this->cacheDir)->aLoaderRejectsAPathItsFilesystemDoesNotServe($format);
}
#[DataProvider('formats')]
public function test_reads_back_through_the_same_filesystem_instance(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->readsBackThroughTheSameFilesystemInstance($format);
+ new FileFormatContract($this->cacheDir)->readsBackThroughTheSameFilesystemInstance($format);
}
#[DataProvider('formats')]
public function test_a_pushed_filter_returns_what_the_filter_node_returns(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aPushedFilterReturnsWhatTheFilterNodeReturns(
+ new FileFormatContract($this->cacheDir)->aPushedFilterReturnsWhatTheFilterNodeReturns(
$format,
ref('id')->notEquals(lit('b')),
);
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Inference/JsonSnifferTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Inference/JsonSnifferTest.php
index feaec80cac..a0525af5f4 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Inference/JsonSnifferTest.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Inference/JsonSnifferTest.php
@@ -201,10 +201,10 @@ public function test_unbounded_inference_is_independent_of_execution_order(
JsonFraming $format,
array $fixtures,
): void {
- $inference = (new SchemaInference(unionByName: true))->everyRow()->everySource();
+ $inference = new SchemaInference(unionByName: true)->everyRow()->everySource();
static::assertEquals(
- (new SchemaInferrer($inference))->infer(
+ new SchemaInferrer($inference)->infer(
JsonFixtureContext::sniffer($format, JsonFixtureContext::sources(...$fixtures)),
new VoidProgress(),
)->schema,
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/DescribableRoundTripTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/DescribableRoundTripTest.php
index d19716616b..3deecaec08 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/DescribableRoundTripTest.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/DescribableRoundTripTest.php
@@ -6,7 +6,6 @@
use Flow\ETL\Adapter\JSON\Tests\Context\DescribableFixtures;
use Flow\ETL\Foundation\Describe\Describable;
-use Flow\ETL\Foundation\Exception\RequiredPHPVersionException;
use Flow\ETL\Foundation\Exception\RuntimeException;
use Flow\ETL\Tests\Context\DescribeRoundTrip;
use Flow\ETL\Tests\Context\ExtractorClasses;
@@ -58,11 +57,7 @@ public function test_a_rebuilt_describable_equals_the_described_one(string $clas
$this->expectException(RuntimeException::class);
}
- try {
- $describable = DescribableFixtures::all()[$class]();
- } catch (RequiredPHPVersionException $e) {
- static::markTestSkipped($e->getMessage());
- }
+ $describable = DescribableFixtures::all()[$class]();
if (in_array($class, DescribableFixtures::undescribable(), true)) {
static::assertNull($describable->describe());
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Extractor/JsonArrayElementsTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Extractor/JsonArrayElementsTest.php
index 0ffc8f1cfd..e39993b407 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Extractor/JsonArrayElementsTest.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Extractor/JsonArrayElementsTest.php
@@ -74,7 +74,7 @@ public function test_yields_or_refuses_exactly_what_json_machine_does(string $do
};
try {
- $actual = iterator_to_array((new JsonArrayElements(4))->of($stream, $stream->read(5, 0), $fallback));
+ $actual = iterator_to_array(new JsonArrayElements(4)->of($stream, $stream->read(5, 0), $fallback));
} catch (Throwable $exception) {
$actual = $exception::class;
}
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Extractor/JsonFileBatchesTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Extractor/JsonFileBatchesTest.php
index 075d020c0a..f448f0c466 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Extractor/JsonFileBatchesTest.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Extractor/JsonFileBatchesTest.php
@@ -30,10 +30,10 @@ final class JsonFileBatchesTest extends FlowTestCase
public function test_a_document_yields_its_rows_consumes_no_offset_and_closes_its_stream(): void
{
$filesystem = new CountingFilesystem(MemoryFiles::with(['memory://a.json' => '[{"id":1},{"id":2},{"id":3}]']));
- $file = (new JsonFileBatches(
+ $file = new JsonFileBatches(
$filesystem,
new JsonFileReader($filesystem, JsonFraming::Array, null, false),
- ))->batches(
+ )->batches(
FileReadMother::of(schema(int_schema('id')), null, 2),
new Criteria(),
new SourceFile(path('memory://a.json')),
@@ -65,10 +65,10 @@ public function test_lines_yield_one_row_per_line(): void
$rows instanceof Rows ? $rows->toArray() : [$rows->getMessage()]
),
iterator_to_array(
- (new JsonFileBatches(
+ new JsonFileBatches(
$filesystem,
new JsonFileReader($filesystem, JsonFraming::Lines, null, false),
- ))->batches(
+ )->batches(
FileReadMother::of(schema(int_schema('id')), null, 10),
new Criteria(),
new SourceFile(path('memory://a.jsonl')),
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Extractor/JsonLineResyncTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Extractor/JsonLineResyncTest.php
index 7b8d3d54e6..d90f57c38f 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Extractor/JsonLineResyncTest.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Extractor/JsonLineResyncTest.php
@@ -37,7 +37,7 @@ public static function stream(string $content): SourceStream
#[TestWith([17, null])]
public function test_after_is_the_first_line_start_at_or_after_the_offset(int $from, ?int $expected): void
{
- static::assertSame($expected, (new JsonLineResync())->after(
+ static::assertSame($expected, new JsonLineResync()->after(
self::stream("{\"a\":1}\n{\"b\":2}\n{\"c\"}"),
$from,
));
@@ -45,12 +45,12 @@ public function test_after_is_the_first_line_start_at_or_after_the_offset(int $f
public function test_an_empty_stream_has_no_line_start(): void
{
- static::assertNull((new JsonLineResync())->after(self::stream(''), 0));
+ static::assertNull(new JsonLineResync()->after(self::stream(''), 0));
}
public function test_crlf_lines_resync_after_the_newline(): void
{
- static::assertSame(9, (new JsonLineResync())->after(self::stream("{\"a\":1}\r\n{\"b\":2}\r\n"), 3));
+ static::assertSame(9, new JsonLineResync()->after(self::stream("{\"a\":1}\r\n{\"b\":2}\r\n"), 3));
}
public function test_neighbouring_windows_cut_at_after_share_every_boundary_and_cover_the_file(): void
@@ -61,7 +61,7 @@ public function test_neighbouring_windows_cut_at_after_share_every_boundary_and_
$read = '';
foreach ([[0, 5], [5, 5], [10, 5], [15, 5], [20, 5], [25, 5], [30, 5], [35, null]] as [$start, $length]) {
- $read .= (new FileSplit(path('memory://lines.jsonl'), $start, $length))
+ $read .= new FileSplit(path('memory://lines.jsonl'), $start, $length)
->window(
$stream,
$resync->after($stream, $start),
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Extractor/JsonReadProgressTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Extractor/JsonReadProgressTest.php
index c65e1f7298..7781a088ba 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Extractor/JsonReadProgressTest.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Extractor/JsonReadProgressTest.php
@@ -11,7 +11,7 @@ final class JsonReadProgressTest extends FlowTestCase
{
public function test_it_starts_at_zero(): void
{
- static::assertSame(0, (new JsonReadProgress())->total());
+ static::assertSame(0, new JsonReadProgress()->total());
}
public function test_it_sums_what_was_added(): void
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Extractor/MetadataColumnsExtractorTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Extractor/MetadataColumnsExtractorTest.php
index b4c86bb291..e2797c0b56 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Extractor/MetadataColumnsExtractorTest.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Extractor/MetadataColumnsExtractorTest.php
@@ -31,7 +31,7 @@ public static function extractors(): Generator
#[DataProvider('extractors')]
public function test_an_extractor_carries_the_metadata_setter_only_when_it_declares_metadata(string $class): void
{
- if ((new ReflectionClass($class))->implementsInterface(MetadataColumnsExtractor::class)) {
+ if (new ReflectionClass($class)->implementsInterface(MetadataColumnsExtractor::class)) {
MetadataColumnsContract::declares($class);
return;
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/JsonFileWriterTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/JsonFileWriterTest.php
index ef043c4637..0383931df0 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/JsonFileWriterTest.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/JsonFileWriterTest.php
@@ -41,7 +41,7 @@ public function test_close_without_a_write_appends_nothing(JsonFraming $framing)
{
$stream = new StringDestinationStream(path('memory://out.json'));
- (new JsonFileWriter($stream, JsonEncoderMother::php(), $framing))->close();
+ new JsonFileWriter($stream, JsonEncoderMother::php(), $framing)->close();
static::assertSame('', $stream->content());
}
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/JsonLoaderTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/JsonLoaderTest.php
index af681f8ea5..ab4d6f80d8 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/JsonLoaderTest.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/JsonLoaderTest.php
@@ -55,7 +55,7 @@ final class JsonLoaderTest extends FlowTestCase
public function test_setting_content_type_on_path(): void
{
static::assertEquals(
- (new JsonLoader(path(__DIR__ . '/file.json')))
+ new JsonLoader(path(__DIR__ . '/file.json'))
->destination()
->getOption(Option::CONTENT_TYPE),
ContentType::JSON,
@@ -308,7 +308,7 @@ public function test_a_writer_writes_with_the_options_of_the_loader(): void
{
$stream = new StringDestinationStream(path('memory://out.json'));
$schema = schema(datetime_schema('at'), date_schema('on'));
- $writer = (new JsonLoader(path('memory://out.json'), memory_filesystem()))
+ $writer = new JsonLoader(path('memory://out.json'), memory_filesystem())
->withFlags(JSON_THROW_ON_ERROR | JSON_UNESCAPED_SLASHES)
->withDateTimeFormat('d/m/Y H:i')
->withDateFormat('Y/m/d')
@@ -326,7 +326,7 @@ public function test_a_writer_writes_with_the_options_of_the_loader(): void
public function test_a_flag_the_native_writer_does_not_render_is_written_through_php(): void
{
$stream = new StringDestinationStream(path('memory://out.json'));
- $writer = (new JsonLoader(path('memory://out.json'), memory_filesystem(), JsonFraming::Lines))
+ $writer = new JsonLoader(path('memory://out.json'), memory_filesystem(), JsonFraming::Lines)
->withFlags(JSON_THROW_ON_ERROR | JSON_HEX_TAG)
->writer($stream, schema(str_schema('tag')), new PhpBackend());
@@ -341,12 +341,12 @@ public function test_a_flow_php_of_another_abi_is_refused(): void
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('does not match flow-php/etl');
- (new JsonLoader(
+ new JsonLoader(
path('memory://out.json'),
memory_filesystem(),
JsonFraming::Array,
new FlowPhpExtension(true, FlowPhpExtension::ABI + 1, '0.46.0'),
- ))->writer(new StringDestinationStream(path('memory://out.json')), schema(int_schema('id')), new PhpBackend());
+ )->writer(new StringDestinationStream(path('memory://out.json')), schema(int_schema('id')), new PhpBackend());
}
public function test_in_task_keeps_the_lane_override(): void
@@ -354,12 +354,12 @@ public function test_in_task_keeps_the_lane_override(): void
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('does not match flow-php/etl');
- (new JsonLoader(
+ new JsonLoader(
path('memory://out.json'),
memory_filesystem(),
JsonFraming::Array,
new FlowPhpExtension(true, FlowPhpExtension::ABI + 1, '0.46.0'),
- ))
+ )
->inTask(new Part(0, 1, '1a2b3c4d5e6f7a8b', false))
->writer(
new StringDestinationStream(path('memory://other.json')),
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/PhpJsonEncoderTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/PhpJsonEncoderTest.php
index acc4449f2a..fd8fa17415 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/PhpJsonEncoderTest.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/PhpJsonEncoderTest.php
@@ -16,7 +16,6 @@
use Flow\Types\Value\Uuid;
use Generator;
use PHPUnit\Framework\Attributes\DataProvider;
-use PHPUnit\Framework\Attributes\RequiresPhp;
use PHPUnit\Framework\Attributes\TestWith;
use function array_map;
@@ -196,16 +195,15 @@ public function test_encode_renders_a_column_by_its_type(
array $values,
string $expected,
): void {
- static::assertSame($expected, (new PhpJsonEncoder())->encode(
+ static::assertSame($expected, new PhpJsonEncoder()->encode(
array_to_rows(array_map(static fn(mixed $value): array => ['a' => $value], $values), schema($definition)),
'|',
));
}
- #[RequiresPhp('>= 8.4.0')]
public function test_encode_renders_html_as_its_markup(): void
{
- static::assertSame('{"doc":"<\/head>a<\/p><\/body><\/html>","el":"
a<\/p>"}', (new PhpJsonEncoder())->encode(
+ static::assertSame('{"doc":"
<\/head>a<\/p><\/body><\/html>","el":"
a<\/p>"}', new PhpJsonEncoder()->encode(
array_to_rows(
[['doc' => '
a
', 'el' => 'a
']],
schema(html_schema('doc'), html_element_schema('el')),
@@ -218,7 +216,7 @@ public function test_encode_writes_one_object_per_row_in_schema_order(): void
{
static::assertSame('{"id":1,"name":"Alice","active":true,"score":9.5,"missing":null}'
. "\n"
- . '{"id":2,"name":"Bob","active":false,"score":1,"missing":"x"}', (new PhpJsonEncoder())->encode(
+ . '{"id":2,"name":"Bob","active":false,"score":1,"missing":"x"}', new PhpJsonEncoder()->encode(
array_to_rows(
[
['name' => 'Alice', 'id' => 1, 'active' => true, 'score' => 9.5, 'missing' => null],
@@ -238,7 +236,7 @@ public function test_encode_writes_one_object_per_row_in_schema_order(): void
public function test_a_row_of_columns_named_0_and_1_is_an_object(): void
{
- static::assertSame('{"0":"a","1":"b"}', (new PhpJsonEncoder())->encode(
+ static::assertSame('{"0":"a","1":"b"}', new PhpJsonEncoder()->encode(
array_to_rows([['0' => 'a', '1' => 'b']], schema(str_schema('0'), str_schema('1'))),
',',
));
@@ -246,7 +244,7 @@ public function test_a_row_of_columns_named_0_and_1_is_an_object(): void
public function test_encode_of_an_empty_batch_is_empty(): void
{
- static::assertSame('', (new PhpJsonEncoder())->encode(array_to_rows([], schema(int_schema('a'))), ','));
+ static::assertSame('', new PhpJsonEncoder()->encode(array_to_rows([], schema(int_schema('a'))), ','));
}
#[TestWith([JSON_THROW_ON_ERROR, '{"a":"a\/\u017c","f":1}'])]
@@ -256,7 +254,7 @@ public function test_encode_of_an_empty_batch_is_empty(): void
#[TestWith([JSON_PRETTY_PRINT, "{\n \"a\": \"a\\/\\u017c\",\n \"f\": 1\n}"])]
public function test_encode_applies_the_flags(int $flags, string $expected): void
{
- static::assertSame($expected, (new PhpJsonEncoder($flags))->encode(
+ static::assertSame($expected, new PhpJsonEncoder($flags)->encode(
array_to_rows([['a' => 'a/ż', 'f' => 1.0]], schema(str_schema('a'), float_schema('f'))),
',',
));
@@ -264,11 +262,11 @@ public function test_encode_applies_the_flags(int $flags, string $expected): voi
public function test_encode_uses_the_configured_formats_at_every_depth(): void
{
- static::assertSame('{"at":"01\/10\/2023 12:02","on":"2023\/10\/01","l":["01\/10\/2023 12:02"]}', (new PhpJsonEncoder(
+ static::assertSame('{"at":"01\/10\/2023 12:02","on":"2023\/10\/01","l":["01\/10\/2023 12:02"]}', new PhpJsonEncoder(
JSON_THROW_ON_ERROR,
'd/m/Y H:i',
'Y/m/d',
- ))->encode(
+ )->encode(
array_to_rows(
[[
'at' => new DateTimeImmutable('2023-10-01 12:02:01 UTC'),
@@ -308,7 +306,7 @@ public function test_a_not_finite_float_is_refused(int $flags): void
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('Failed to encode JSON: Inf and NaN cannot be JSON encoded');
- (new PhpJsonEncoder($flags))->encode(array_to_rows([['f' => NAN]], schema(float_schema('f'))), ',');
+ new PhpJsonEncoder($flags)->encode(array_to_rows([['f' => NAN]], schema(float_schema('f'))), ',');
}
public function test_malformed_utf8_is_refused(): void
@@ -318,7 +316,7 @@ public function test_malformed_utf8_is_refused(): void
'Failed to encode JSON: Malformed UTF-8 characters, possibly incorrectly encoded',
);
- (new PhpJsonEncoder())->encode(array_to_rows([['s' => "\xff"]], schema(str_schema('s'))), ',');
+ new PhpJsonEncoder()->encode(array_to_rows([['s' => "\xff"]], schema(str_schema('s'))), ',');
}
public function test_fragments_are_the_json_text_of_every_cell(): void
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Schema/JsonSchema/ReferenceResolverTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Schema/JsonSchema/ReferenceResolverTest.php
index cd5386a648..202da4b295 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Schema/JsonSchema/ReferenceResolverTest.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Schema/JsonSchema/ReferenceResolverTest.php
@@ -21,7 +21,7 @@ final class ReferenceResolverTest extends FlowTestCase
{
public function test_load_from_path(): void
{
- $loaded = (new ReferenceResolver())->load(path(__DIR__ . '/../../../../Fixtures/json-schema/address.json'));
+ $loaded = new ReferenceResolver()->load(path(__DIR__ . '/../../../../Fixtures/json-schema/address.json'));
static::assertSame('object', $loaded->schema['type']);
static::assertSame($loaded->schema, $loaded->document);
@@ -42,7 +42,7 @@ public function test_load_honors_document_id_as_base_uri(): void
),
);
- $loaded = (new ReferenceResolver($client, new Psr17Factory()))->load('https://cdn.example.com/root.json');
+ $loaded = new ReferenceResolver($client, new Psr17Factory())->load('https://cdn.example.com/root.json');
static::assertSame('https://example.com/schemas/root.json', $loaded->baseUri);
}
@@ -52,12 +52,12 @@ public function test_resolve_anchor_reference_is_not_supported(): void
$this->expectException(UnsupportedKeywordException::class);
$this->expectExceptionMessage('JSON Schema keyword "$anchor"');
- (new ReferenceResolver())->resolve('#address', '', ['$defs' => []]);
+ new ReferenceResolver()->resolve('#address', '', ['$defs' => []]);
}
public function test_resolve_deep_pointer_with_escaped_segments(): void
{
- $resolved = (new ReferenceResolver())->resolve('#/$defs/paths/~1users~1id/schema', '', [
+ $resolved = new ReferenceResolver()->resolve('#/$defs/paths/~1users~1id/schema', '', [
'$defs' => ['paths' => ['/users/id' => ['schema' => ['type' => 'string']]]],
]);
@@ -92,7 +92,7 @@ public function test_resolve_internal_pointer_via_defs(): void
{
$document = ['$defs' => ['money' => ['type' => 'object']]];
- $resolved = (new ReferenceResolver())->resolve('#/$defs/money', 'file://schemas/root.json', $document);
+ $resolved = new ReferenceResolver()->resolve('#/$defs/money', 'file://schemas/root.json', $document);
static::assertSame(['type' => 'object'], $resolved->schema);
static::assertSame($document, $resolved->document);
@@ -102,7 +102,7 @@ public function test_resolve_internal_pointer_via_defs(): void
public function test_resolve_internal_pointer_via_legacy_definitions(): void
{
- $resolved = (new ReferenceResolver())->resolve('#/definitions/status', '', [
+ $resolved = new ReferenceResolver()->resolve('#/definitions/status', '', [
'definitions' => ['status' => ['type' => 'string']],
]);
@@ -114,7 +114,7 @@ public function test_resolve_pointer_to_missing_segment_throws_exception(): void
$this->expectException(UnresolvableReferenceException::class);
$this->expectExceptionMessage('pointer segment "missing" does not exist');
- (new ReferenceResolver())->resolve('#/$defs/missing', '', ['$defs' => []]);
+ new ReferenceResolver()->resolve('#/$defs/missing', '', ['$defs' => []]);
}
public function test_resolve_pointer_to_scalar_throws_exception(): void
@@ -122,7 +122,7 @@ public function test_resolve_pointer_to_scalar_throws_exception(): void
$this->expectException(UnresolvableReferenceException::class);
$this->expectExceptionMessage('reference target is not a schema object');
- (new ReferenceResolver())->resolve('#/$defs/name', '', ['$defs' => ['name' => 'scalar']]);
+ new ReferenceResolver()->resolve('#/$defs/name', '', ['$defs' => ['name' => 'scalar']]);
}
public function test_resolve_relative_file_reference(): void
@@ -164,7 +164,7 @@ public function test_resolve_relative_reference_without_base_uri_throws_exceptio
$this->expectException(UnresolvableReferenceException::class);
$this->expectExceptionMessage('relative reference cannot be resolved without a base URI');
- (new ReferenceResolver())->resolve('address.json#/properties/street', '', []);
+ new ReferenceResolver()->resolve('address.json#/properties/street', '', []);
}
public function test_resolve_remote_reference(): void
@@ -180,7 +180,7 @@ public function test_resolve_remote_reference(): void
),
);
- $resolved = (new ReferenceResolver($client, new Psr17Factory()))->resolve(
+ $resolved = new ReferenceResolver($client, new Psr17Factory())->resolve(
'https://example.com/common.json#/$defs/status',
'',
[],
@@ -204,7 +204,7 @@ public function test_resolve_remote_reference_relative_to_remote_base_uri(): voi
),
);
- $resolved = (new ReferenceResolver($client, new Psr17Factory()))->resolve(
+ $resolved = new ReferenceResolver($client, new Psr17Factory())->resolve(
'common.json#/$defs/status',
'https://example.com/schemas/root.json',
[],
@@ -222,7 +222,7 @@ public function test_resolve_remote_reference_returning_invalid_json_throws_exce
$this->expectException(UnresolvableReferenceException::class);
$this->expectExceptionMessage('is not a valid JSON object');
- (new ReferenceResolver($client, new Psr17Factory()))->resolve(
+ new ReferenceResolver($client, new Psr17Factory())->resolve(
'https://example.com/common.json#/$defs/status',
'',
[],
@@ -237,7 +237,7 @@ public function test_resolve_remote_reference_returning_non_200_status_throws_ex
$this->expectException(UnresolvableReferenceException::class);
$this->expectExceptionMessage('returned status code 404');
- (new ReferenceResolver($client, new Psr17Factory()))->resolve(
+ new ReferenceResolver($client, new Psr17Factory())->resolve(
'https://example.com/common.json#/$defs/status',
'',
[],
@@ -251,7 +251,7 @@ public function test_resolve_remote_reference_without_client_throws_exception():
'resolving remote references requires a PSR-18 http client and a PSR-17 request factory',
);
- (new ReferenceResolver())->resolve('https://example.com/common.json#/$defs/status', '', []);
+ new ReferenceResolver()->resolve('https://example.com/common.json#/$defs/status', '', []);
}
public function test_resolve_whole_document_reference_without_pointer(): void
@@ -259,7 +259,7 @@ public function test_resolve_whole_document_reference_without_pointer(): void
$client = new Client();
$client->addResponse(new Response(200, [], (string) json_encode(['type' => 'object'])));
- $resolved = (new ReferenceResolver($client, new Psr17Factory()))->resolve(
+ $resolved = new ReferenceResolver($client, new Psr17Factory())->resolve(
'https://example.com/common.json',
'',
[],
diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Schema/SchemaConverterTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Schema/SchemaConverterTest.php
index 1c233f6542..ff3fc8476e 100644
--- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Schema/SchemaConverterTest.php
+++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Schema/SchemaConverterTest.php
@@ -53,7 +53,7 @@ public function test_to_flow_all_of_merges_object_schemas(): void
{
static::assertEquals(
schema(structure_schema('profile', type_structure(['name' => type_string(), 'age' => type_integer()]))),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['profile'],
'properties' => [
@@ -81,7 +81,7 @@ public function test_to_flow_all_of_with_conflicting_types_throws_exception(): v
$this->expectException(UnsupportedKeywordException::class);
$this->expectExceptionMessage('JSON Schema keyword "allOf" at path "value"');
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'properties' => [
'value' => ['allOf' => [['type' => 'string'], ['type' => 'integer']]],
@@ -93,7 +93,7 @@ public function test_to_flow_any_of_with_heterogeneous_members_is_refused(): voi
{
$this->expectException(UnsupportedUnionTypeException::class);
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['value'],
'properties' => [
@@ -106,7 +106,7 @@ public function test_to_flow_any_of_with_null_member_becomes_nullable(): void
{
static::assertEquals(
schema(str_schema('value', true)),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['value'],
'properties' => [
@@ -120,7 +120,7 @@ public function test_to_flow_any_of_with_only_null_members_becomes_null_definiti
{
static::assertEquals(
schema(null_schema('value')),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'properties' => [
'value' => ['anyOf' => [['type' => 'null']]],
@@ -133,7 +133,7 @@ public function test_to_flow_array_without_items_becomes_json(): void
{
static::assertEquals(
schema(json_schema('values')),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['values'],
'properties' => [
@@ -147,7 +147,7 @@ public function test_to_flow_basic_types(): void
{
static::assertEquals(
schema(int_schema('id'), str_schema('name'), float_schema('price'), bool_schema('active')),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['id', 'name', 'price', 'active'],
'properties' => [
@@ -165,7 +165,7 @@ public function test_to_flow_circular_reference_throws_exception(): void
$this->expectException(CircularReferenceException::class);
$this->expectExceptionMessage('Circular reference detected: "#/$defs/node"');
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'properties' => [
'node' => ['$ref' => '#/$defs/node'],
@@ -183,7 +183,7 @@ public function test_to_flow_const_becomes_scalar_with_enum_metadata(): void
{
static::assertEquals(
schema(str_schema('status', metadata: Metadata::with(JsonSchemaMetadata::ENUM->value, ['fixed']))),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['status'],
'properties' => [
@@ -198,7 +198,7 @@ public function test_to_flow_boolean_false_property_schema_throws_exception(): v
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('JSON Schema "false" at path "nothing" rejects all values');
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'properties' => [
'nothing' => false,
@@ -210,7 +210,7 @@ public function test_to_flow_boolean_true_property_schema_becomes_json_with_any_
{
static::assertEquals(
schema(json_schema('anything', true, Metadata::with(JsonSchemaMetadata::ANY->value, true))),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'properties' => [
'anything' => true,
@@ -226,7 +226,7 @@ public function test_to_flow_boolean_true_property_schema_inside_nested_structur
'name' => type_string(),
'payload' => type_json(),
]))),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['profile'],
'properties' => [
@@ -247,7 +247,7 @@ public function test_to_flow_empty_property_schema_becomes_json_with_any_marker(
{
static::assertEquals(
schema(json_schema('anything', true, Metadata::with(JsonSchemaMetadata::ANY->value, true))),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'properties' => [
'anything' => [],
@@ -260,7 +260,7 @@ public function test_to_flow_enum_with_heterogeneous_values_is_refused(): void
{
$this->expectException(UnsupportedUnionTypeException::class);
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['value'],
'properties' => [
@@ -273,7 +273,7 @@ public function test_to_flow_enum_with_homogeneous_values_becomes_scalar(): void
{
static::assertEquals(
schema(str_schema('status', metadata: Metadata::with(JsonSchemaMetadata::ENUM->value, ['on', 'off']))),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['status'],
'properties' => [
@@ -288,7 +288,7 @@ public function test_to_flow_enum_with_non_scalar_values_throws_exception(): voi
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('JSON Schema "enum" at path "value" must contain only scalar or null values');
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'properties' => [
'value' => ['enum' => [['nested' => 'array']]],
@@ -300,7 +300,7 @@ public function test_to_flow_enum_with_null_value_becomes_nullable(): void
{
static::assertEquals(
schema(str_schema('status', true, Metadata::with(JsonSchemaMetadata::ENUM->value, ['on', 'off']))),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['status'],
'properties' => [
@@ -314,7 +314,7 @@ public function test_to_flow_free_form_object_becomes_json(): void
{
static::assertEquals(
schema(json_schema('attributes')),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['attributes'],
'properties' => [
@@ -331,7 +331,7 @@ public function test_to_flow_internal_reference_via_defs(): void
'amount' => type_float(),
'currency' => structure_element('currency', type_string(), optional: true),
]))),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['money'],
'properties' => [
@@ -355,7 +355,7 @@ public function test_to_flow_internal_reference_via_legacy_definitions(): void
{
static::assertEquals(
schema(str_schema('status')),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['status'],
'properties' => [
@@ -373,7 +373,7 @@ public function test_to_flow_invalid_json_string_throws_exception(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('JSON Schema document is not valid JSON');
- (new SchemaConverter())->toFlowSchema('{invalid');
+ new SchemaConverter()->toFlowSchema('{invalid');
}
public function test_to_flow_nested_structures_lists_and_maps(): void
@@ -387,7 +387,7 @@ public function test_to_flow_nested_structures_lists_and_maps(): void
'quantity' => structure_element('quantity', type_integer(), optional: true),
])),
)),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['orders'],
'properties' => [
@@ -413,7 +413,7 @@ public function test_to_flow_nested_union_inside_structure_is_refused(): void
$this->expectException(UnsupportedUnionTypeException::class);
$this->expectExceptionMessage('Column "config" cannot hold elements of type "integer|string"');
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['config'],
'properties' => [
@@ -433,7 +433,7 @@ public function test_to_flow_items_any_of_is_refused(): void
$this->expectException(UnsupportedUnionTypeException::class);
$this->expectExceptionMessage('Column "tags" cannot hold elements of type "integer|string"');
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['tags'],
'properties' => [
@@ -446,7 +446,7 @@ public function test_to_flow_items_nullable_type_is_an_optional_element(): void
{
static::assertSame(
'list',
- (new SchemaConverter())
+ new SchemaConverter()
->toFlowSchema([
'type' => 'object',
'required' => ['tags'],
@@ -467,7 +467,7 @@ public function test_to_flow_object_and_array_type_union_becomes_json(): void
{
static::assertEquals(
schema(json_schema('document')),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['document'],
'properties' => [
@@ -484,7 +484,7 @@ public function test_to_flow_prefix_items_becomes_json_with_metadata(): void
['type' => 'string'],
['type' => 'integer'],
]))),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['pair'],
'properties' => [
@@ -496,7 +496,7 @@ public function test_to_flow_prefix_items_becomes_json_with_metadata(): void
public function test_to_flow_property_annotations_are_stored_in_metadata(): void
{
- $flowSchema = (new SchemaConverter())->toFlowSchema([
+ $flowSchema = new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['name'],
'properties' => [
@@ -546,7 +546,7 @@ public function test_to_flow_path_document_with_cross_file_references(): void
true,
),
),
- (new SchemaConverter())->toFlowSchema(path(__DIR__ . '/../../../Fixtures/json-schema/person.json')),
+ new SchemaConverter()->toFlowSchema(path(__DIR__ . '/../../../Fixtures/json-schema/person.json')),
);
}
@@ -554,7 +554,7 @@ public function test_to_flow_property_not_in_required_becomes_nullable(): void
{
static::assertEquals(
schema(int_schema('id'), str_schema('note', true)),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['id'],
'properties' => [
@@ -569,7 +569,7 @@ public function test_to_flow_raw_json_string_document(): void
{
static::assertEquals(
schema(int_schema('id')),
- (new SchemaConverter())->toFlowSchema(
+ new SchemaConverter()->toFlowSchema(
'{"type":"object","required":["id"],"properties":{"id":{"type":"integer"}}}',
),
);
@@ -580,7 +580,7 @@ public function test_to_flow_remote_reference_without_client_throws_exception():
$this->expectException(UnresolvableReferenceException::class);
$this->expectExceptionMessage('resolving remote references requires a PSR-18 http client');
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'properties' => [
'remote' => ['$ref' => 'https://example.com/schema.json#/$defs/x'],
@@ -593,7 +593,7 @@ public function test_to_flow_root_without_object_type_throws_exception(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('JSON Schema root must have type "object"');
- (new SchemaConverter())->toFlowSchema(['type' => 'array', 'items' => ['type' => 'string']]);
+ new SchemaConverter()->toFlowSchema(['type' => 'array', 'items' => ['type' => 'string']]);
}
public function test_to_flow_root_without_properties_throws_exception(): void
@@ -601,7 +601,7 @@ public function test_to_flow_root_without_properties_throws_exception(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('JSON Schema root must have "properties"');
- (new SchemaConverter())->toFlowSchema(['type' => 'object']);
+ new SchemaConverter()->toFlowSchema(['type' => 'object']);
}
public function test_to_flow_string_formats(): void
@@ -614,7 +614,7 @@ public function test_to_flow_string_formats(): void
uuid_schema('uuid'),
str_schema('email', metadata: Metadata::with(JsonSchemaMetadata::FORMAT->value, 'email')),
),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['created_date', 'created_at', 'created_time', 'uuid', 'email'],
'properties' => [
@@ -632,7 +632,7 @@ public function test_to_flow_type_list_with_null_becomes_nullable(): void
{
static::assertEquals(
schema(float_schema('score', true)),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['score'],
'properties' => [
@@ -646,7 +646,7 @@ public function test_to_flow_type_list_with_null_and_multiple_types_is_refused()
{
$this->expectException(UnsupportedUnionTypeException::class);
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['value'],
'properties' => [
@@ -659,7 +659,7 @@ public function test_to_flow_type_null_becomes_null_definition(): void
{
static::assertEquals(
schema(null_schema('nothing')),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'properties' => [
'nothing' => ['type' => 'null'],
@@ -673,7 +673,7 @@ public function test_to_flow_unknown_type_throws_exception(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Unsupported JSON Schema type "money" at path "value"');
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'properties' => [
'value' => ['type' => 'money'],
@@ -699,7 +699,7 @@ public function test_to_flow_unsupported_keywords_throw_exception(string $keywor
$this->expectException(UnsupportedKeywordException::class);
$this->expectExceptionMessage(sprintf('JSON Schema keyword "%s" at path "value"', $keyword));
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'properties' => [
'value' => ['type' => 'string', $keyword => []],
@@ -748,7 +748,7 @@ public function test_to_json_schema_interleaved_structure_lists_required_fields_
],
'required' => ['s'],
],
- (new SchemaConverter())->toJsonSchema(schema(structure_schema('s', type_structure([
+ new SchemaConverter()->toJsonSchema(schema(structure_schema('s', type_structure([
'z' => type_integer(),
'a' => structure_element('a', type_string(), optional: true),
'b' => type_string(),
@@ -790,7 +790,7 @@ public function test_to_json_schema_any_marked_definition_becomes_boolean_true_s
'type' => 'object',
'properties' => ['anything' => true],
],
- (new SchemaConverter())->toJsonSchema(schema(json_schema(
+ new SchemaConverter()->toJsonSchema(schema(json_schema(
'anything',
true,
Metadata::with(JsonSchemaMetadata::ANY->value, true),
@@ -806,7 +806,7 @@ public function test_to_json_schema_any_marked_definition_with_annotations_keeps
'type' => 'object',
'properties' => ['anything' => ['description' => 'accepts anything']],
],
- (new SchemaConverter())->toJsonSchema(schema(json_schema(
+ new SchemaConverter()->toJsonSchema(schema(json_schema(
'anything',
true,
Metadata::with(JsonSchemaMetadata::ANY->value, true)->add(
@@ -822,7 +822,7 @@ public function test_to_json_schema_empty_schema_throws_exception(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Cannot convert empty Flow schema to JSON Schema');
- (new SchemaConverter())->toJsonSchema(schema());
+ new SchemaConverter()->toJsonSchema(schema());
}
public function test_to_json_schema_basic_types_and_required(): void
@@ -839,7 +839,7 @@ public function test_to_json_schema_basic_types_and_required(): void
],
'required' => ['id', 'price', 'active'],
],
- (new SchemaConverter())->toJsonSchema(schema(
+ new SchemaConverter()->toJsonSchema(schema(
int_schema('id'),
str_schema('name', true),
float_schema('price'),
@@ -861,7 +861,7 @@ public function test_to_json_schema_enum_definitions(): void
],
'required' => ['string_enum', 'int_enum', 'unit_enum'],
],
- (new SchemaConverter())->toJsonSchema(schema(
+ new SchemaConverter()->toJsonSchema(schema(
enum_schema('string_enum', BackedStringEnum::class),
enum_schema('int_enum', BackedIntEnum::class),
enum_schema('unit_enum', BasicEnum::class),
@@ -878,7 +878,7 @@ public function test_to_json_schema_list_of_mixed_omits_items(): void
'properties' => ['values' => ['type' => 'array']],
'required' => ['values'],
],
- (new SchemaConverter())->toJsonSchema(schema(list_schema('values', type_list(type_mixed())))),
+ new SchemaConverter()->toJsonSchema(schema(list_schema('values', type_list(type_mixed())))),
);
}
@@ -896,7 +896,7 @@ public function test_to_json_schema_logical_string_types_use_formats(): void
],
'required' => ['created_date', 'created_at', 'created_time', 'uuid'],
],
- (new SchemaConverter())->toJsonSchema(schema(
+ new SchemaConverter()->toJsonSchema(schema(
date_schema('created_date'),
datetime_schema('created_at'),
time_schema('created_time'),
@@ -914,7 +914,7 @@ public function test_to_json_schema_map_of_mixed_omits_additional_properties():
'properties' => ['attributes' => ['type' => 'object']],
'required' => ['attributes'],
],
- (new SchemaConverter())->toJsonSchema(schema(map_schema('attributes', type_map(
+ new SchemaConverter()->toJsonSchema(schema(map_schema('attributes', type_map(
type_string(),
type_mixed(),
)))),
@@ -926,7 +926,7 @@ public function test_to_json_schema_map_with_non_string_keys_throws_exception():
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('Only maps with string keys can be converted to JSON Schema');
- (new SchemaConverter())->toJsonSchema(schema(map_schema('lookup', type_map(type_integer(), type_string()))));
+ new SchemaConverter()->toJsonSchema(schema(map_schema('lookup', type_map(type_integer(), type_string()))));
}
public function test_to_json_schema_metadata_is_reemitted_as_keywords(): void
@@ -945,7 +945,7 @@ public function test_to_json_schema_metadata_is_reemitted_as_keywords(): void
],
'required' => ['name'],
],
- (new SchemaConverter())->toJsonSchema(schema(str_schema('name', metadata: Metadata::empty()->add(
+ new SchemaConverter()->toJsonSchema(schema(str_schema('name', metadata: Metadata::empty()->add(
JsonSchemaMetadata::DESCRIPTION->value,
'Full name',
)->add(JsonSchemaMetadata::PATTERN->value, '^[a-z]+$')->add(JsonSchemaMetadata::FORMAT->value, 'email')))),
@@ -960,7 +960,7 @@ public function test_to_json_schema_null_definition(): void
'type' => 'object',
'properties' => ['nothing' => ['type' => 'null']],
],
- (new SchemaConverter())->toJsonSchema(schema(null_schema('nothing'))),
+ new SchemaConverter()->toJsonSchema(schema(null_schema('nothing'))),
);
}
@@ -975,7 +975,7 @@ public function test_to_json_schema_prefix_items_metadata_restores_tuple(): void
],
'required' => ['pair'],
],
- (new SchemaConverter())->toJsonSchema(schema(json_schema('pair', metadata: Metadata::with(
+ new SchemaConverter()->toJsonSchema(schema(json_schema('pair', metadata: Metadata::with(
JsonSchemaMetadata::PREFIX_ITEMS->value,
[['type' => 'string'], ['type' => 'integer']],
)))),
@@ -1000,7 +1000,7 @@ public function test_to_json_schema_structure_with_optional_elements(): void
],
'required' => ['address'],
],
- (new SchemaConverter())->toJsonSchema(schema(structure_schema('address', type_structure([
+ new SchemaConverter()->toJsonSchema(schema(structure_schema('address', type_structure([
'street' => type_string(),
'zip' => structure_element('zip', type_optional(type_string()), optional: true),
])))),
@@ -1014,7 +1014,7 @@ public function test_to_flow_nullable_structure_member_uses_optional_type(): voi
'name' => type_string(),
'age' => type_optional(type_integer()),
]))),
- (new SchemaConverter())->toFlowSchema([
+ new SchemaConverter()->toFlowSchema([
'type' => 'object',
'required' => ['profile'],
'properties' => [
diff --git a/src/adapter/etl-adapter-logger/composer.json b/src/adapter/etl-adapter-logger/composer.json
index 12eb254f9f..5ee970173e 100644
--- a/src/adapter/etl-adapter-logger/composer.json
+++ b/src/adapter/etl-adapter-logger/composer.json
@@ -11,7 +11,7 @@
"psr"
],
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/etl": "self.version",
"psr/log": "^2.0 || ^3.0"
},
diff --git a/src/adapter/etl-adapter-logger/tests/Flow/ETL/Adapter/Logger/Tests/Unit/DescribableRoundTripTest.php b/src/adapter/etl-adapter-logger/tests/Flow/ETL/Adapter/Logger/Tests/Unit/DescribableRoundTripTest.php
index ee81499f9d..f4fdd9e288 100644
--- a/src/adapter/etl-adapter-logger/tests/Flow/ETL/Adapter/Logger/Tests/Unit/DescribableRoundTripTest.php
+++ b/src/adapter/etl-adapter-logger/tests/Flow/ETL/Adapter/Logger/Tests/Unit/DescribableRoundTripTest.php
@@ -6,7 +6,6 @@
use Flow\ETL\Adapter\Logger\Tests\Context\DescribableFixtures;
use Flow\ETL\Foundation\Describe\Describable;
-use Flow\ETL\Foundation\Exception\RequiredPHPVersionException;
use Flow\ETL\Foundation\Exception\RuntimeException;
use Flow\ETL\Tests\Context\DescribeRoundTrip;
use Flow\ETL\Tests\Context\ExtractorClasses;
@@ -58,11 +57,7 @@ public function test_a_rebuilt_describable_equals_the_described_one(string $clas
$this->expectException(RuntimeException::class);
}
- try {
- $describable = DescribableFixtures::all()[$class]();
- } catch (RequiredPHPVersionException $e) {
- static::markTestSkipped($e->getMessage());
- }
+ $describable = DescribableFixtures::all()[$class]();
if (in_array($class, DescribableFixtures::undescribable(), true)) {
static::assertNull($describable->describe());
diff --git a/src/adapter/etl-adapter-logger/tests/Flow/ETL/Adapter/Logger/Tests/Unit/IO/Loader/PsrLoggerLoaderTest.php b/src/adapter/etl-adapter-logger/tests/Flow/ETL/Adapter/Logger/Tests/Unit/IO/Loader/PsrLoggerLoaderTest.php
index a571e5ad14..bbaa795a0a 100644
--- a/src/adapter/etl-adapter-logger/tests/Flow/ETL/Adapter/Logger/Tests/Unit/IO/Loader/PsrLoggerLoaderTest.php
+++ b/src/adapter/etl-adapter-logger/tests/Flow/ETL/Adapter/Logger/Tests/Unit/IO/Loader/PsrLoggerLoaderTest.php
@@ -39,7 +39,7 @@ public function test_a_json_column_is_logged_as_an_array(): void
{
$logger = new TestLogger();
- (new PsrLoggerLoader($logger, 'row log'))->load(array_to_rows([['payload' => Json::fromArray([
+ new PsrLoggerLoader($logger, 'row log')->load(array_to_rows([['payload' => Json::fromArray([
'a' => 1,
])]], schema(json_schema('payload'))), flow_context(config())->backend());
diff --git a/src/adapter/etl-adapter-parquet/composer.json b/src/adapter/etl-adapter-parquet/composer.json
index 68dd7cc670..b983529cfd 100644
--- a/src/adapter/etl-adapter-parquet/composer.json
+++ b/src/adapter/etl-adapter-parquet/composer.json
@@ -11,7 +11,7 @@
"adapter"
],
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"ext-json": "*",
"flow-php/etl": "self.version",
"flow-php/parquet": "self.version"
diff --git a/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/ConfiguredParquetEngine.php b/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/ConfiguredParquetEngine.php
index 3081af3cbb..96a04fa3f3 100644
--- a/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/ConfiguredParquetEngine.php
+++ b/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/ConfiguredParquetEngine.php
@@ -43,7 +43,7 @@ public static function fromDescription(#[SensitiveParameter] array $data, Rebuil
{
$class = type_string()->assert($data['engine'] ?? null);
- if (!is_a($class, ParquetEngine::class, true) || (new ReflectionClass($class))->isAbstract()) {
+ if (!is_a($class, ParquetEngine::class, true) || new ReflectionClass($class)->isAbstract()) {
throw InvalidArgumentException::because('%s is not a concrete ParquetEngine', $class);
}
@@ -54,7 +54,7 @@ public static function fromDescription(#[SensitiveParameter] array $data, Rebuil
public function describe(): ?Description
{
$configuration = $this->engine->normalize();
- $module = (new ReflectionClass($this->engine))->getExtensionName();
+ $module = new ReflectionClass($this->engine)->getExtensionName();
return (
$configuration === null
diff --git a/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Extractor/ParquetExtractor.php b/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Extractor/ParquetExtractor.php
index 8257ac626d..34dd10bba0 100644
--- a/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Extractor/ParquetExtractor.php
+++ b/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Extractor/ParquetExtractor.php
@@ -247,10 +247,8 @@ public function partitionTypes(PartitionTypes $types): static
public function prunes(ScalarFunction $conjunct): bool
{
return (
- (new FilterTranslator())->translate(
- [$conjunct],
- $this->fileColumns->columns()->withoutTail($this->schema()),
- ) !== []
+ new FilterTranslator()->translate([$conjunct], $this->fileColumns->columns()->withoutTail($this->schema()))
+ !== []
);
}
diff --git a/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Extractor/ParquetFileBatches.php b/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Extractor/ParquetFileBatches.php
index d606f593d6..21980769df 100644
--- a/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Extractor/ParquetFileBatches.php
+++ b/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Extractor/ParquetFileBatches.php
@@ -108,18 +108,18 @@ public function batches(
ReadWindow $window,
): Generator {
if ($this->translatedFor !== $criteria) {
- $this->conjuncts = (new FilterTranslator())->translate($criteria->conjuncts, $body);
+ $this->conjuncts = new FilterTranslator()->translate($criteria->conjuncts, $body);
$this->translatedFor = $criteria;
}
$split = $criteria->split;
- $file = $this->firstFile?->forSource($source) ?? (new ParquetSourceFileOpener(
+ $file = $this->firstFile?->forSource($source) ?? new ParquetSourceFileOpener(
$read->files->filesystem,
$this->engine,
$this->options,
$this->schemaConverter,
$this->columns,
- ))->open($source);
+ )->open($source);
$this->firstFile = null;
$opened = null;
@@ -166,7 +166,7 @@ public function batches(
// a conjunct over partition columns is one value per file, so TRUE for the file is TRUE for every row
if (
$partitionOnly
- && (new ScalarFunctionFilter($conjunct, $partitions, $backend))->accept(
+ && new ScalarFunctionFilter($conjunct, $partitions, $backend)->accept(
new FileStatus($source->path, true),
)
) {
diff --git a/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Extractor/PhpParquetOpenSource.php b/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Extractor/PhpParquetOpenSource.php
index 3424e06d4e..5919d162d4 100644
--- a/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Extractor/PhpParquetOpenSource.php
+++ b/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Extractor/PhpParquetOpenSource.php
@@ -73,7 +73,7 @@ public function batches(Schema $schema, int $batchSize, ReadPlan $plan, Backend
$logical[$definition->name()] = $fileType === null
|| $comparator->equals(type_bare($fileType), type_bare($definition->type()))
? null
- : (new PhysicalFor())->physical($fileType);
+ : new PhysicalFor()->physical($fileType);
}
$rows =
diff --git a/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Extractor/Pushdown/FilterTranslator.php b/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Extractor/Pushdown/FilterTranslator.php
index f8211a0fe3..5ae4b7c6ae 100644
--- a/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Extractor/Pushdown/FilterTranslator.php
+++ b/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Extractor/Pushdown/FilterTranslator.php
@@ -78,7 +78,7 @@ public function translate(array $conjuncts, Schema $body): array
if ($parquet !== null) {
$translated[$position] = new TranslatedConjunct(
$parquet,
- array_values((new ReferencedColumns())->in($conjunct)->names()),
+ array_values(new ReferencedColumns()->in($conjunct)->names()),
!$this->listsNull($conjunct),
array_values(array_unique($this->nanSensitiveColumns($parquet, $body))),
);
@@ -355,7 +355,7 @@ private function literal(Type $column, Type $literal, mixed $value, bool $orderi
=> $value instanceof DateTimeInterface ? $value : null,
$column::class !== $literal::class,
$ordering && $column instanceof UuidType,
- !(new ComparableValues())->equalByPhysical($column),
+ !new ComparableValues()->equalByPhysical($column),
=> null,
$value instanceof Uuid => $value->toString(),
is_bool($value),
diff --git a/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Loader/ParquetLoader.php b/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Loader/ParquetLoader.php
index 22a3159791..3683e059fe 100644
--- a/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Loader/ParquetLoader.php
+++ b/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Loader/ParquetLoader.php
@@ -83,10 +83,10 @@ public function __construct(Path $path, Filesystem $filesystem = new NativeLocal
public static function fromDescription(#[SensitiveParameter] array $data, Rebuild $rebuild): static
{
- $loader = (new self(
+ $loader = new self(
Path::fromArray(type_array()->assert($data['path'] ?? null)),
$rebuild->of($data['filesystem'] ?? null, ConfiguredFilesystem::class)->filesystem(),
- ))
+ )
->saveMode(type_enum(SaveMode::class)->assert(constant(
SaveMode::class . '::' . type_string()->assert($data['save_mode'] ?? null),
)))
@@ -141,7 +141,7 @@ public function describe(): ?Description
...ConfiguredParquetEngine::EXTENSIONS,
...match (true) {
$this->engine === null => FlowPhpExtension::detect()->available() ? ['flow_php'] : $codecs,
- is_string((new ReflectionClass($this->engine))->getExtensionName()) => [],
+ is_string(new ReflectionClass($this->engine)->getExtensionName()) => [],
default => $codecs,
},
],
@@ -191,7 +191,7 @@ public function partitioning(): Partitioning
public function inTask(Part $task): static
{
- $loader = (new self($this->path, $this->filesystem))
+ $loader = new self($this->path, $this->filesystem)
->saveMode($this->saveMode)
->withCompressions($this->compressions)
->withEngine($this->engine)
diff --git a/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Loader/ParquetSchemaConformance.php b/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Loader/ParquetSchemaConformance.php
index 932edc767c..4fdb90d242 100644
--- a/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Loader/ParquetSchemaConformance.php
+++ b/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/IO/Loader/ParquetSchemaConformance.php
@@ -25,7 +25,7 @@ public function __construct(ParquetSchema $schema)
{
$definitions = [];
- foreach ((new SchemaConverter())
+ foreach (new SchemaConverter()
->toFlowSchema($schema)
->definitions() as $definition) {
$definitions[$definition->name()] = $definition;
diff --git a/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/functions.php b/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/functions.php
index a0f2545c4e..b931a19399 100644
--- a/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/functions.php
+++ b/src/adapter/etl-adapter-parquet/src/Flow/ETL/Adapter/Parquet/functions.php
@@ -24,7 +24,6 @@
use function count;
use function Flow\Filesystem\DSL\path_real;
-use function Flow\Parquet\empty_generator as parquet_empty_generator;
use function is_string;
/**
@@ -43,7 +42,7 @@ function from_parquet(
?ParquetEngine $engine = null,
Filesystem $filesystem = new NativeLocalFilesystem(),
): ParquetExtractor {
- $loader = (new ParquetExtractor(is_string($path) ? path_real($path) : $path, $filesystem))
+ $loader = new ParquetExtractor(is_string($path) ? path_real($path) : $path, $filesystem)
->withOptions($options)
->withByteOrder($byte_order)
->withEngine($engine);
@@ -71,7 +70,7 @@ function to_parquet(
?ParquetEngine $engine = null,
Filesystem $filesystem = new NativeLocalFilesystem(),
): ParquetLoader {
- $loader = (new ParquetLoader(is_string($path) ? path_real($path) : $path, $filesystem))
+ $loader = new ParquetLoader(is_string($path) ? path_real($path) : $path, $filesystem)
->withCompressions($compressions)
->withEngine($engine);
@@ -101,23 +100,14 @@ function array_to_generator(array $data): Generator
}
}
-/**
- * @deprecated use Flow\Parquet\empty_generator() instead
- */
-#[DocumentationDSL(module: Module::PARQUET, type: DSLType::HELPER)]
-function empty_generator(): Generator
-{
- return parquet_empty_generator();
-}
-
#[DocumentationDSL(module: Module::PARQUET, type: DSLType::HELPER)]
function schema_to_parquet(Schema $schema): ParquetSchema
{
- return (new SchemaConverter())->toParquetSchema($schema);
+ return new SchemaConverter()->toParquetSchema($schema);
}
#[DocumentationDSL(module: Module::PARQUET, type: DSLType::HELPER)]
function schema_from_parquet(ParquetSchema $schema): Schema
{
- return (new SchemaConverter())->toFlowSchema($schema);
+ return new SchemaConverter()->toFlowSchema($schema);
}
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Context/ParquetFilesContext.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Context/ParquetFilesContext.php
index bbde7ed426..e4a6b22fd7 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Context/ParquetFilesContext.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Context/ParquetFilesContext.php
@@ -68,7 +68,7 @@ public static function plan(
?int $limit = null,
?ParquetFilter $filter = null,
): ReadPlan {
- $file = (new Reader())->readStream($filesystem->readFrom(path($uri)));
+ $file = new Reader()->readStream($filesystem->readFrom(path($uri)));
return ReadPlan::forFilter(
$file->reader()->footer(),
@@ -86,7 +86,7 @@ public static function columnNames(Filesystem $filesystem, string $uri): array
{
return array_map(
static fn(Column $column): string => $column->name(),
- (new Reader())
+ new Reader()
->readStream($filesystem->readFrom(path($uri)))
->schema()
->columns(),
@@ -99,7 +99,7 @@ public static function columnNames(Filesystem $filesystem, string $uri): array
public static function values(Filesystem $filesystem, string $uri): array
{
return iterator_to_array(
- (new Reader())
+ new Reader()
->readStream($filesystem->readFrom(path($uri)))
->values(),
false,
@@ -238,9 +238,9 @@ public static function scores(
public static function writtenThroughTheLoader(Rows $rows): array
{
$filesystem = memory_filesystem();
- $parquetSchema = (new SchemaConverter())->toParquetSchema($rows->schema());
+ $parquetSchema = new SchemaConverter()->toParquetSchema($rows->schema());
$writer = new ParquetFileWriter(
- (new PhpParquetEngine())->openForWrite(
+ new PhpParquetEngine()->openForWrite(
$filesystem->writeTo(path('memory://loader.parquet')),
$parquetSchema,
Compressions::SNAPPY,
@@ -261,7 +261,7 @@ public static function writtenThroughTheLoader(Rows $rows): array
public static function phpEngineValues(Filesystem $filesystem, string $uri): array
{
return iterator_to_array(
- (new Reader(engine: new PhpParquetEngine()))
+ new Reader(engine: new PhpParquetEngine())
->readStream($filesystem->readFrom(path($uri)))
->values(),
false,
@@ -270,10 +270,10 @@ public static function phpEngineValues(Filesystem $filesystem, string $uri): arr
public static function nativeWriter(Filesystem $filesystem, string $uri, FlowSchema $schema): RustParquetFileWriter
{
- $parquetSchema = (new SchemaConverter())->toParquetSchema($schema);
+ $parquetSchema = new SchemaConverter()->toParquetSchema($schema);
return new RustParquetFileWriter(
- (new FlowPhpParquetEngine())->openForWrite(
+ new FlowPhpParquetEngine()->openForWrite(
$filesystem->writeTo(path($uri)),
$parquetSchema,
Compressions::SNAPPY,
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Context/PushdownParityContext.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Context/PushdownParityContext.php
index 158c850cef..c8348dc719 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Context/PushdownParityContext.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Context/PushdownParityContext.php
@@ -88,9 +88,9 @@ public static function write(Filesystem $filesystem): void
'd92' => $id + 0.25,
'd182' => $id + 0.25,
'tenth' => $id + 0.1,
- 'day' => (new DateTimeImmutable('2024-01-01'))->modify(sprintf('+%d days', $id)),
- 'ts_us' => (new DateTimeImmutable('2024-01-01 00:00:00.123456'))->modify(sprintf('+%d hours', $id)),
- 'ts_ns' => (new DateTimeImmutable('2024-01-01 00:00:00.123456'))->modify(sprintf('+%d hours', $id)),
+ 'day' => new DateTimeImmutable('2024-01-01')->modify(sprintf('+%d days', $id)),
+ 'ts_us' => new DateTimeImmutable('2024-01-01 00:00:00.123456')->modify(sprintf('+%d hours', $id)),
+ 'ts_ns' => new DateTimeImmutable('2024-01-01 00:00:00.123456')->modify(sprintf('+%d hours', $id)),
'uuid' => sprintf('00000000-0000-4000-8000-%012d', $id),
];
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/IO/Extractor/ParquetExtractorTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/IO/Extractor/ParquetExtractorTest.php
index 245d2d4460..f9707d3007 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/IO/Extractor/ParquetExtractorTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/IO/Extractor/ParquetExtractorTest.php
@@ -795,10 +795,10 @@ public function test_union_by_name_reads_every_file_under_one_schema(): void
public function test_one_extractor_read_twice_interleaved_gives_each_read_every_row_and_closes_every_stream(): void
{
$filesystem = new RecordingFilesystem(native_local_filesystem());
- [$first, $second] = ExtractedRows::interleaved((new ParquetExtractor(
+ [$first, $second] = ExtractedRows::interleaved(new ParquetExtractor(
path_real(__DIR__ . '/../../../Fixtures/Pagination/*.parquet'),
$filesystem,
- ))->withBatchSize(7));
+ )->withBatchSize(7));
static::assertGreaterThan(0, $first->count());
static::assertSame($first->toArray(), $second->toArray());
@@ -953,7 +953,7 @@ public function test_extract_split_stops_on_the_stop_signal(): void
$generator = FlowTestCase::extracted(
$extractor,
flow_context()->backend(),
- (new Criteria())->withSplit($extractor->splits(new Criteria(), 100_000)[0]),
+ new Criteria()->withSplit($extractor->splits(new Criteria(), 100_000)[0]),
);
$totalRows = 0;
@@ -972,7 +972,7 @@ public function test_extract_split_stops_on_the_stop_signal_of_a_whole_source_sp
$generator = FlowTestCase::extracted(
from_parquet('memory://split/a.parquet', filesystem: $filesystem)->withBatchSize(1),
flow_context()->backend(),
- (new Criteria())->withSplit(new FileSplit(path('memory://split/a.parquet'), 0, null)),
+ new Criteria()->withSplit(new FileSplit(path('memory://split/a.parquet'), 0, null)),
);
$totalRows = 0;
@@ -995,7 +995,7 @@ public function test_extract_split_reads_no_more_than_the_limit(): void
foreach (FlowTestCase::extracted(
$extractor,
flow_context()->backend(),
- (new Criteria(25))->withSplit($extractor->splits(new Criteria(), 100_000)[0]),
+ new Criteria(25)->withSplit($extractor->splits(new Criteria(), 100_000)[0]),
) as $rows) {
$total += $rows->count();
}
@@ -1062,7 +1062,7 @@ public function test_a_pushed_path_filter_prunes_the_files_splits_are_cut_from()
static::assertEquals(
[new FileSplit($extractor->source(), 0, null)],
- $extractor->splits((new Criteria())->withPathFilter(new RejectingFilter()), 1),
+ $extractor->splits(new Criteria()->withPathFilter(new RejectingFilter()), 1),
);
}
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/IO/FileFormatContractTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/IO/FileFormatContractTest.php
index 303fbd3bf6..50a2a2e58e 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/IO/FileFormatContractTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/IO/FileFormatContractTest.php
@@ -30,109 +30,109 @@ public static function formats(): Generator
#[DataProvider('formats')]
public function test_overwrite_replaces_what_the_destination_held(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->overwriteReplacesWhatTheDestinationHeld($format);
+ new FileFormatContract($this->cacheDir)->overwriteReplacesWhatTheDestinationHeld($format);
}
#[DataProvider('formats')]
public function test_append_keeps_what_the_destination_held(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->appendKeepsWhatTheDestinationHeld($format);
+ new FileFormatContract($this->cacheDir)->appendKeepsWhatTheDestinationHeld($format);
}
#[DataProvider('formats')]
public function test_ignore_leaves_an_existing_destination_untouched(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->ignoreLeavesAnExistingDestinationUntouched($format);
+ new FileFormatContract($this->cacheDir)->ignoreLeavesAnExistingDestinationUntouched($format);
}
#[DataProvider('formats')]
public function test_exception_if_exists_refuses_an_existing_destination(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->exceptionIfExistsRefusesAnExistingDestination($format);
+ new FileFormatContract($this->cacheDir)->exceptionIfExistsRefusesAnExistingDestination($format);
}
#[DataProvider('formats')]
public function test_a_batch_of_zero_rows_creates_no_file(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aBatchOfZeroRowsCreatesNoFile($format);
+ new FileFormatContract($this->cacheDir)->aBatchOfZeroRowsCreatesNoFile($format);
}
#[DataProvider('formats')]
public function test_a_write_that_ends_reports_its_file_operations(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aWriteThatEndsReportsItsFileOperations($format);
+ new FileFormatContract($this->cacheDir)->aWriteThatEndsReportsItsFileOperations($format);
}
#[DataProvider('formats')]
public function test_a_partitioned_write_reads_back_every_partition(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aPartitionedWriteReadsBackEveryPartition($format);
+ new FileFormatContract($this->cacheDir)->aPartitionedWriteReadsBackEveryPartition($format);
}
#[DataProvider('formats')]
public function test_a_loader_in_a_task_survives_describe(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aLoaderInATaskSurvivesDescribe($format);
+ new FileFormatContract($this->cacheDir)->aLoaderInATaskSurvivesDescribe($format);
}
#[DataProvider('formats')]
public function test_an_extractor_reader_survives_describe(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->anExtractorReaderSurvivesDescribe($format);
+ new FileFormatContract($this->cacheDir)->anExtractorReaderSurvivesDescribe($format);
}
#[DataProvider('formats')]
public function test_the_splits_read_every_row_once(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->theSplitsReadEveryRowOnce($format);
+ new FileFormatContract($this->cacheDir)->theSplitsReadEveryRowOnce($format);
}
#[DataProvider('formats')]
public function test_metadata_columns_name_the_source_file(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->metadataColumnsNameTheSourceFile($format);
+ new FileFormatContract($this->cacheDir)->metadataColumnsNameTheSourceFile($format);
}
#[DataProvider('formats')]
public function test_the_batch_size_bounds_every_batch(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->theBatchSizeBoundsEveryBatch($format);
+ new FileFormatContract($this->cacheDir)->theBatchSizeBoundsEveryBatch($format);
}
#[DataProvider('formats')]
public function test_refresh_lists_the_files_written_after_a_read(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->refreshListsTheFilesWrittenAfterARead($format);
+ new FileFormatContract($this->cacheDir)->refreshListsTheFilesWrittenAfterARead($format);
}
#[DataProvider('formats')]
public function test_a_failed_run_leaves_no_file_at_the_destination(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aFailedRunLeavesNoFileAtTheDestination($format);
+ new FileFormatContract($this->cacheDir)->aFailedRunLeavesNoFileAtTheDestination($format);
}
#[DataProvider('formats')]
public function test_an_extractor_rejects_a_path_its_filesystem_does_not_serve(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->anExtractorRejectsAPathItsFilesystemDoesNotServe($format);
+ new FileFormatContract($this->cacheDir)->anExtractorRejectsAPathItsFilesystemDoesNotServe($format);
}
#[DataProvider('formats')]
public function test_a_loader_rejects_a_path_its_filesystem_does_not_serve(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aLoaderRejectsAPathItsFilesystemDoesNotServe($format);
+ new FileFormatContract($this->cacheDir)->aLoaderRejectsAPathItsFilesystemDoesNotServe($format);
}
#[DataProvider('formats')]
public function test_reads_back_through_the_same_filesystem_instance(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->readsBackThroughTheSameFilesystemInstance($format);
+ new FileFormatContract($this->cacheDir)->readsBackThroughTheSameFilesystemInstance($format);
}
#[DataProvider('formats')]
public function test_a_pushed_filter_returns_what_the_filter_node_returns(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aPushedFilterReturnsWhatTheFilterNodeReturns(
+ new FileFormatContract($this->cacheDir)->aPushedFilterReturnsWhatTheFilterNodeReturns(
$format,
ref('id')->notEquals(lit('b')),
);
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/PaginationTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/PaginationTest.php
index bde49b242c..d87d176c1e 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/PaginationTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/PaginationTest.php
@@ -90,7 +90,7 @@ public function test_reading_file_from_given_offset(): void
foreach (FlowTestCase::extracted(
from_parquet(path_real(__DIR__ . '/../Fixtures/orders_1k.parquet')),
flow_context(config())->backend(),
- new Criteria(offset: (new Reader())
+ new Criteria(offset: new Reader()
->read(__DIR__ . '/../Fixtures/orders_1k.parquet')
->metadata()
->rowsNumber() - 100),
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/ParquetTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/ParquetTest.php
index 0716123441..e0e923ec17 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/ParquetTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/ParquetTest.php
@@ -465,7 +465,7 @@ public function test_a_given_engine_is_honoured_with_both_extensions_loaded(): v
->read(from_rows(array_to_rows([['name' => "\xff\xfe"]], schema(str_schema('name')))))
->write(to_parquet(
$path,
- options: (new Options())->set(Option::VALIDATE_DATA, false),
+ options: new Options()->set(Option::VALIDATE_DATA, false),
engine: new PhpParquetEngine(),
filesystem: $memory,
))
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/PushdownParityTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/PushdownParityTest.php
index 49b6494295..a98e32b2d3 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/PushdownParityTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/PushdownParityTest.php
@@ -175,7 +175,7 @@ public function test_a_date_literal_on_a_timestamp_column_read_in_a_non_utc_zone
$writer->writeBatch(array_map(
static fn(int $id): array => [
'id' => $id,
- 'at' => (new DateTimeImmutable('2024-01-01 20:00:00'))->modify(sprintf('+%d hours', $id)),
+ 'at' => new DateTimeImmutable('2024-01-01 20:00:00')->modify(sprintf('+%d hours', $id)),
],
range(0, 8),
));
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/DescribableRoundTripTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/DescribableRoundTripTest.php
index 032ce5e0d9..45832fb3dd 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/DescribableRoundTripTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/DescribableRoundTripTest.php
@@ -6,7 +6,6 @@
use Flow\ETL\Adapter\Parquet\Tests\Context\DescribableFixtures;
use Flow\ETL\Foundation\Describe\Describable;
-use Flow\ETL\Foundation\Exception\RequiredPHPVersionException;
use Flow\ETL\Foundation\Exception\RuntimeException;
use Flow\ETL\Tests\Context\DescribeRoundTrip;
use Flow\ETL\Tests\Context\ExtractorClasses;
@@ -58,11 +57,7 @@ public function test_a_rebuilt_describable_equals_the_described_one(string $clas
$this->expectException(RuntimeException::class);
}
- try {
- $describable = DescribableFixtures::all()[$class]();
- } catch (RequiredPHPVersionException $e) {
- static::markTestSkipped($e->getMessage());
- }
+ $describable = DescribableFixtures::all()[$class]();
if (in_array($class, DescribableFixtures::undescribable(), true)) {
static::assertNull($describable->describe());
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/EmptyGeneratorTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/EmptyGeneratorTest.php
deleted file mode 100644
index b3100e5151..0000000000
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/EmptyGeneratorTest.php
+++ /dev/null
@@ -1,19 +0,0 @@
-set(Option::PAGE_SIZE_BYTES, 7));
- $description = (new ConfiguredParquetEngine($engine))->describe();
+ $description = new ConfiguredParquetEngine($engine)->describe();
static::assertNotNull($description);
static::assertFalse($description->sensitive());
static::assertSame(PhpParquetEngine::class, $description->data['engine']);
static::assertEquals(
$engine,
- (new Rebuild())->of($description->normalize(), ConfiguredParquetEngine::class)->engine(),
+ new Rebuild()->of($description->normalize(), ConfiguredParquetEngine::class)->engine(),
);
}
@@ -40,13 +40,13 @@ public function test_an_engine_round_trips_without_secrecy(): void
public function test_an_arrow_engine_round_trips(): void
{
$engine = new RustParquetEngine(Options::default()->set(Option::PAGE_SIZE_BYTES, 7));
- $description = (new ConfiguredParquetEngine($engine))->describe();
+ $description = new ConfiguredParquetEngine($engine)->describe();
static::assertNotNull($description);
static::assertSame(RustParquetEngine::class, $description->data['engine']);
static::assertSame(
$engine->normalize(),
- (new Rebuild())
+ new Rebuild()
->of($description->normalize(), ConfiguredParquetEngine::class)
->engine()
->normalize(),
@@ -57,13 +57,13 @@ public function test_an_arrow_engine_round_trips(): void
public function test_a_flow_php_engine_round_trips(): void
{
$engine = new FlowPhpParquetEngine(Options::default()->set(Option::PAGE_SIZE_BYTES, 7));
- $description = (new ConfiguredParquetEngine($engine))->describe();
+ $description = new ConfiguredParquetEngine($engine)->describe();
static::assertNotNull($description);
static::assertSame(FlowPhpParquetEngine::class, $description->data['engine']);
static::assertSame(
$engine->normalize(),
- (new Rebuild())
+ new Rebuild()
->of($description->normalize(), ConfiguredParquetEngine::class)
->engine()
->normalize(),
@@ -75,7 +75,7 @@ public function test_a_flow_php_engine_declares_flow_php_and_no_codec(): void
{
static::assertSame(
['bcmath', 'flow_php', 'json', 'zlib'],
- (new ConfiguredParquetEngine(new FlowPhpParquetEngine()))->describe()?->extensions(),
+ new ConfiguredParquetEngine(new FlowPhpParquetEngine())->describe()?->extensions(),
);
}
@@ -84,13 +84,13 @@ public function test_an_arrow_engine_declares_arrow_and_no_codec(): void
{
static::assertSame(
['arrow', 'bcmath', 'json', 'zlib'],
- (new ConfiguredParquetEngine(new RustParquetEngine()))->describe()?->extensions(),
+ new ConfiguredParquetEngine(new RustParquetEngine())->describe()?->extensions(),
);
}
public function test_an_engine_without_a_normal_form_does_not_describe(): void
{
- static::assertNull((new ConfiguredParquetEngine(new RefusingParquetEngine()))->describe());
+ static::assertNull(new ConfiguredParquetEngine(new RefusingParquetEngine())->describe());
}
public function test_a_class_that_is_not_an_engine_is_refused(): void
@@ -111,6 +111,6 @@ public function test_an_engine_declares_the_parquet_extensions_and_the_codecs_lo
];
sort($expected);
- static::assertSame($expected, (new ConfiguredParquetEngine(new PhpParquetEngine()))->describe()?->extensions());
+ static::assertSame($expected, new ConfiguredParquetEngine(new PhpParquetEngine())->describe()?->extensions());
}
}
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/MetadataColumnsExtractorTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/MetadataColumnsExtractorTest.php
index 38472e90ec..e0dcc41306 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/MetadataColumnsExtractorTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/MetadataColumnsExtractorTest.php
@@ -31,7 +31,7 @@ public static function extractors(): Generator
#[DataProvider('extractors')]
public function test_an_extractor_carries_the_metadata_setter_only_when_it_declares_metadata(string $class): void
{
- if ((new ReflectionClass($class))->implementsInterface(MetadataColumnsExtractor::class)) {
+ if (new ReflectionClass($class)->implementsInterface(MetadataColumnsExtractor::class)) {
MetadataColumnsContract::declares($class);
return;
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/ParquetExtractorTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/ParquetExtractorTest.php
index 3775771832..cb60b19d3f 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/ParquetExtractorTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/ParquetExtractorTest.php
@@ -172,7 +172,7 @@ public function test_a_count_over_a_plain_read_reads_the_number_from_the_footer(
static::assertEquals(
from_rows(array_to_rows([['count' => 25]], schema(int_schema('count')))),
- (new CountFromStatistics())
+ new CountFromStatistics()
->apply(
df()
->read(from_parquet(path('memory://count/file.parquet'), filesystem: $memory))
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/ParquetFileBatchesTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/ParquetFileBatchesTest.php
index fcd81e84aa..c4b2e025f9 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/ParquetFileBatchesTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/ParquetFileBatchesTest.php
@@ -49,7 +49,7 @@ public function test_an_offset_that_covers_the_file_skips_it_and_yields_its_row_
['id' => 1],
['id' => 2],
], schema(int_schema('id')))]);
- $file = (new ParquetFileBatches(new PhpParquetEngine(), Options::default(), [], null))->batches(
+ $file = new ParquetFileBatches(new PhpParquetEngine(), Options::default(), [], null)->batches(
FileReadMother::of(
schema(int_schema('id', nullable: true)),
FileColumnsContext::discovering(names: []),
@@ -75,7 +75,7 @@ public function test_an_offset_inside_the_file_starts_the_read_there_and_yields_
['id' => 3],
], schema(int_schema('id')))]);
$batches = iterator_to_array(
- (new ParquetFileBatches(new PhpParquetEngine(), Options::default(), [], null))->batches(
+ new ParquetFileBatches(new PhpParquetEngine(), Options::default(), [], null)->batches(
FileReadMother::of(
schema(int_schema('id', nullable: true)),
FileColumnsContext::discovering(names: []),
@@ -114,13 +114,7 @@ public function test_the_kept_first_file_is_read_instead_of_opened_again(): void
$kept = $opener->open(new SourceFile(path('memory://a.parquet')));
$opened = $filesystem->readFromCalls;
- iterator_to_array((new ParquetFileBatches(
- new PhpParquetEngine(),
- Options::default(),
- [],
- null,
- $kept,
- ))->batches(
+ iterator_to_array(new ParquetFileBatches(new PhpParquetEngine(), Options::default(), [], null, $kept)->batches(
FileReadMother::of(
schema(int_schema('id', nullable: true)),
FileColumnsContext::discovering(names: []),
@@ -155,13 +149,13 @@ public function test_a_kept_first_file_of_another_path_is_closed_and_the_file_op
static::assertSame(
[['id' => 2]],
- ParquetFilesContext::rows((new ParquetFileBatches(
+ ParquetFilesContext::rows(new ParquetFileBatches(
new PhpParquetEngine(),
Options::default(),
[],
null,
$opener->open(new SourceFile(path('memory://a.parquet'))),
- ))->batches(
+ )->batches(
FileReadMother::of(
schema(int_schema('id', nullable: true)),
FileColumnsContext::discovering(names: []),
@@ -192,13 +186,13 @@ public function test_close_releases_a_kept_first_file_the_read_never_reached():
[],
);
- (new ParquetFileBatches(
+ new ParquetFileBatches(
new PhpParquetEngine(),
Options::default(),
[],
null,
$opener->open(new SourceFile(path('memory://a.parquet'))),
- ))->close();
+ )->close();
static::assertSame($filesystem->readFromCalls, $filesystem->closedStreams());
}
@@ -211,12 +205,12 @@ public function test_a_file_that_diverges_from_the_derived_schema_is_refused_and
]], schema(str_schema('name')))]);
try {
- iterator_to_array((new ParquetFileBatches(
+ iterator_to_array(new ParquetFileBatches(
new PhpParquetEngine(),
Options::default(),
[],
new DerivedSchema(schema(int_schema('id', nullable: true)), 'memory://a.parquet'),
- ))->batches(
+ )->batches(
FileReadMother::of(
schema(int_schema('id')),
FileColumnsContext::discovering(names: []),
@@ -242,12 +236,12 @@ public function test_a_body_predicate_skips_the_row_groups_it_proves_cannot_matc
static::assertSame(
3,
- ParquetFilesContext::rowCount((new ParquetFileBatches(
+ ParquetFilesContext::rowCount(new ParquetFileBatches(
new PhpParquetEngine(),
Options::default(),
[],
null,
- ))->batches(
+ )->batches(
FileReadMother::of(
schema(int_schema('id', nullable: true), str_schema('name', nullable: true)),
FileColumnsContext::discovering(names: []),
@@ -271,12 +265,12 @@ public function test_a_conjunct_the_file_answers_exactly_is_left_out_of_the_yiel
static::assertEquals(
Filter::bind($schema, ref('name')->endsWith(lit('1'))),
- ParquetFilesContext::yieldedFilter((new ParquetFileBatches(
+ ParquetFilesContext::yieldedFilter(new ParquetFileBatches(
new PhpParquetEngine(),
Options::default(),
[],
null,
- ))->batches(
+ )->batches(
FileReadMother::of($schema, FileColumnsContext::discovering(names: []), 10, $filesystem),
new Criteria(conjuncts: [ref('id')->greaterThan(lit(5)), ref('name')->endsWith(lit('1'))]),
new SourceFile(path('memory://groups.parquet')),
@@ -293,12 +287,12 @@ public function test_no_filter_is_yielded_when_the_file_answers_no_conjunct_exac
ParquetFilesContext::rowGroups($filesystem, 'memory://groups.parquet', 9, 3);
$schema = schema(int_schema('id', nullable: true), str_schema('name', nullable: true));
- static::assertNull(ParquetFilesContext::yieldedFilter((new ParquetFileBatches(
+ static::assertNull(ParquetFilesContext::yieldedFilter(new ParquetFileBatches(
new PhpParquetEngine(),
Options::default(),
[],
null,
- ))->batches(
+ )->batches(
FileReadMother::of($schema, FileColumnsContext::discovering(names: []), 10, $filesystem),
new Criteria(conjuncts: [ref('name')->endsWith(lit('1'))]),
new SourceFile(path('memory://groups.parquet')),
@@ -316,12 +310,12 @@ public function test_an_is_in_holding_null_stays_in_the_yielded_filter(): void
static::assertEquals(
Filter::bind($schema, not(ref('id')->isIn(lit([1, null])))),
- ParquetFilesContext::yieldedFilter((new ParquetFileBatches(
+ ParquetFilesContext::yieldedFilter(new ParquetFileBatches(
new PhpParquetEngine(),
Options::default(),
[],
null,
- ))->batches(
+ )->batches(
FileReadMother::of($schema, FileColumnsContext::discovering(names: []), 10, $filesystem),
new Criteria(conjuncts: [ref('id')->greaterThan(lit(5)), not(ref('id')->isIn(lit([1, null])))]),
new SourceFile(path('memory://groups.parquet')),
@@ -340,12 +334,12 @@ public function test_a_greater_than_on_a_float_column_proven_free_of_nan_is_answ
static::assertEquals(
Filter::bind($schema),
- ParquetFilesContext::yieldedFilter((new ParquetFileBatches(
+ ParquetFilesContext::yieldedFilter(new ParquetFileBatches(
new PhpParquetEngine(),
Options::default(),
[],
null,
- ))->batches(
+ )->batches(
FileReadMother::of($schema, FileColumnsContext::discovering(names: []), 10, $filesystem),
new Criteria(conjuncts: [ref('score')->greaterThan(lit(2.0))]),
new SourceFile(path('memory://scores.parquet')),
@@ -362,7 +356,7 @@ public function test_a_greater_than_on_a_float_column_holding_nan_is_neither_pru
ParquetFilesContext::scores($filesystem, 'memory://scores.parquet', [1.0, 2.0, NAN, 4.0, 5.0, 6.0]);
$schema = schema(int_schema('id', nullable: true), float_schema('score', nullable: true));
$batches = iterator_to_array(
- (new ParquetFileBatches(new PhpParquetEngine(), Options::default(), [], null))->batches(
+ new ParquetFileBatches(new PhpParquetEngine(), Options::default(), [], null)->batches(
FileReadMother::of($schema, FileColumnsContext::discovering(names: []), 10, $filesystem),
new Criteria(conjuncts: [ref('score')->greaterThan(lit(100.0)), ref('id')->greaterThanEqual(lit(0))]),
new SourceFile(path('memory://scores.parquet')),
@@ -393,12 +387,12 @@ public function test_a_greater_than_on_a_float_column_without_statistics_stays_i
static::assertEquals(
Filter::bind($schema, ref('score')->greaterThan(lit(2.0))),
- ParquetFilesContext::yieldedFilter((new ParquetFileBatches(
+ ParquetFilesContext::yieldedFilter(new ParquetFileBatches(
new PhpParquetEngine(),
Options::default(),
[],
null,
- ))->batches(
+ )->batches(
FileReadMother::of($schema, FileColumnsContext::discovering(names: []), 10, $filesystem),
new Criteria(conjuncts: [ref('score')->greaterThan(lit(2.0)), ref('id')->greaterThanEqual(lit(0))]),
new SourceFile(path('memory://scores.parquet')),
@@ -417,12 +411,12 @@ public function test_a_less_than_on_a_float_column_holding_nan_is_answered_exact
static::assertEquals(
Filter::bind($schema),
- ParquetFilesContext::yieldedFilter((new ParquetFileBatches(
+ ParquetFilesContext::yieldedFilter(new ParquetFileBatches(
new PhpParquetEngine(),
Options::default(),
[],
null,
- ))->batches(
+ )->batches(
FileReadMother::of($schema, FileColumnsContext::discovering(names: []), 10, $filesystem),
new Criteria(conjuncts: [ref('score')->lessThan(lit(3.0))]),
new SourceFile(path('memory://scores.parquet')),
@@ -438,7 +432,7 @@ public function test_the_conjunct_on_a_column_the_file_stores_as_another_type_is
$filesystem = memory_filesystem();
ParquetFilesContext::unsignedInt64($filesystem, 'memory://uint64.parquet', ['9', '10', '100']);
// the body reads the UINT_64 leaf as a string, ordered by bytes: '10' and '100' are below '2', numerically none is
- $file = (new ParquetFileBatches(new PhpParquetEngine(), Options::default(), [], null))->batches(
+ $file = new ParquetFileBatches(new PhpParquetEngine(), Options::default(), [], null)->batches(
FileReadMother::of(
schema(str_schema('big', nullable: true)),
FileColumnsContext::discovering(names: []),
@@ -462,12 +456,12 @@ public function test_equality_on_a_column_absent_from_the_file_reads_no_row(): v
static::assertSame(
0,
- ParquetFilesContext::rowCount((new ParquetFileBatches(
+ ParquetFilesContext::rowCount(new ParquetFileBatches(
new PhpParquetEngine(),
Options::default(),
[],
null,
- ))->batches(
+ )->batches(
FileReadMother::of(
schema(
int_schema('id', nullable: true),
@@ -498,12 +492,12 @@ public function test_is_null_on_a_column_absent_from_the_file_reads_every_row():
static::assertSame(
9,
- ParquetFilesContext::rowCount((new ParquetFileBatches(
+ ParquetFilesContext::rowCount(new ParquetFileBatches(
new PhpParquetEngine(),
Options::default(),
[],
null,
- ))->batches(
+ )->batches(
FileReadMother::of(
schema(
int_schema('id', nullable: true),
@@ -532,7 +526,7 @@ public function test_beside_an_exact_conjunct_a_file_whose_groups_are_all_pruned
$filesystem = memory_filesystem();
ParquetFilesContext::rowGroups($filesystem, 'memory://groups.parquet', 9, 3);
$batches = iterator_to_array(
- (new ParquetFileBatches(new PhpParquetEngine(), Options::default(), [], null))->batches(
+ new ParquetFileBatches(new PhpParquetEngine(), Options::default(), [], null)->batches(
FileReadMother::of(
schema(int_schema('id', nullable: true), str_schema('name', nullable: true)),
FileColumnsContext::discovering(names: []),
@@ -557,7 +551,7 @@ public function test_beside_exact_conjuncts_the_offset_and_the_limit_count_match
$filesystem = memory_filesystem();
ParquetFilesContext::rowGroups($filesystem, 'memory://groups.parquet', 9, 3);
$batches = iterator_to_array(
- (new ParquetFileBatches(new PhpParquetEngine(), Options::default(), [], null))->batches(
+ new ParquetFileBatches(new PhpParquetEngine(), Options::default(), [], null)->batches(
FileReadMother::of(
schema(int_schema('id', nullable: true), str_schema('name', nullable: true)),
FileColumnsContext::discovering(names: []),
@@ -585,7 +579,7 @@ public function test_a_partition_conjunct_true_for_the_file_is_answered_so_the_f
$filesystem = memory_filesystem();
ParquetFilesContext::rowGroups($filesystem, 'memory://t/year=2024/groups.parquet', 9, 3);
$batches = iterator_to_array(
- (new ParquetFileBatches(new PhpParquetEngine(), Options::default(), [], null))->batches(
+ new ParquetFileBatches(new PhpParquetEngine(), Options::default(), [], null)->batches(
FileReadMother::of(
schema(
int_schema('id', nullable: true),
@@ -622,7 +616,7 @@ public function test_a_partition_conjunct_false_for_the_file_stays_in_the_yielde
$filesystem = memory_filesystem();
ParquetFilesContext::rowGroups($filesystem, 'memory://t/year=2024/groups.parquet', 9, 3);
$batches = iterator_to_array(
- (new ParquetFileBatches(new PhpParquetEngine(), Options::default(), [], null))->batches(
+ new ParquetFileBatches(new PhpParquetEngine(), Options::default(), [], null)->batches(
FileReadMother::of(
schema(
int_schema('id', nullable: true),
@@ -662,7 +656,7 @@ public function test_beside_a_residual_conjunct_the_offset_and_the_limit_are_lef
$filesystem = memory_filesystem();
ParquetFilesContext::rowGroups($filesystem, 'memory://groups.parquet', 9, 3);
$batches = iterator_to_array(
- (new ParquetFileBatches(new PhpParquetEngine(), Options::default(), [], null))->batches(
+ new ParquetFileBatches(new PhpParquetEngine(), Options::default(), [], null)->batches(
FileReadMother::of(
schema(int_schema('id', nullable: true), str_schema('name', nullable: true)),
FileColumnsContext::discovering(names: []),
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/ParquetSourceFileOpenerTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/ParquetSourceFileOpenerTest.php
index 6feea8d93e..38fa283335 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/ParquetSourceFileOpenerTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/ParquetSourceFileOpenerTest.php
@@ -23,13 +23,13 @@ final class ParquetSourceFileOpenerTest extends FlowTestCase
{
public function test_opens_the_file_narrowed_to_the_requested_columns(): void
{
- $file = (new ParquetSourceFileOpener(
+ $file = new ParquetSourceFileOpener(
new NativeLocalFilesystem(),
new PhpParquetEngine(),
Options::default(),
new SchemaConverter(),
['id'],
- ))->open(new SourceFile(ParquetSourceFileContext::fixture()));
+ )->open(new SourceFile(ParquetSourceFileContext::fixture()));
static::assertEquals(schema(int_schema('id')), $file->schema());
@@ -41,13 +41,13 @@ public function test_a_stream_the_engine_refuses_is_closed(): void
$filesystem = new CountingFilesystem(new NativeLocalFilesystem());
try {
- (new ParquetSourceFileOpener(
+ new ParquetSourceFileOpener(
$filesystem,
new RefusingParquetEngine(),
Options::default(),
new SchemaConverter(),
[],
- ))->open(new SourceFile(ParquetSourceFileContext::fixture()));
+ )->open(new SourceFile(ParquetSourceFileContext::fixture()));
static::fail('the engine must refuse the stream');
} catch (RuntimeException) {
static::assertSame(1, $filesystem->readFromCalls);
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/PhpParquetOpenSourceTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/PhpParquetOpenSourceTest.php
index efac907ff9..0570ad4af3 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/PhpParquetOpenSourceTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/PhpParquetOpenSourceTest.php
@@ -55,9 +55,9 @@ public function test_a_planned_window_crosses_row_groups(int $offset, ?int $limi
$read = [];
- foreach (ParquetFilesContext::rows((new PhpParquetOpenSource((new Reader(
+ foreach (ParquetFilesContext::rows(new PhpParquetOpenSource(new Reader(
engine: new PhpParquetEngine(),
- ))->readStream($filesystem->readFrom(path('memory://groups.parquet')))))->batches(
+ )->readStream($filesystem->readFrom(path('memory://groups.parquet'))))->batches(
schema(int_schema('id')),
3,
ParquetFilesContext::plan($filesystem, 'memory://groups.parquet', $offset, $limit),
@@ -79,9 +79,9 @@ public function test_an_empty_schema_yields_the_rows_of_the_window(int $offset,
$counted = 0;
- foreach (ParquetFilesContext::rows((new PhpParquetOpenSource((new Reader(
+ foreach (ParquetFilesContext::rows(new PhpParquetOpenSource(new Reader(
engine: new PhpParquetEngine(),
- ))->readStream($filesystem->readFrom(path('memory://groups.parquet')))))->batches(
+ )->readStream($filesystem->readFrom(path('memory://groups.parquet'))))->batches(
schema(),
3,
ParquetFilesContext::plan($filesystem, 'memory://groups.parquet', $offset, $limit),
@@ -102,9 +102,9 @@ public function test_an_empty_schema_yields_the_rows_the_row_filter_keeps(): voi
$counted = 0;
- foreach (ParquetFilesContext::rows((new PhpParquetOpenSource((new Reader(
+ foreach (ParquetFilesContext::rows(new PhpParquetOpenSource(new Reader(
engine: new PhpParquetEngine(),
- ))->readStream($filesystem->readFrom(path('memory://groups.parquet')))))->batches(
+ )->readStream($filesystem->readFrom(path('memory://groups.parquet'))))->batches(
schema(),
100,
ParquetFilesContext::plan(
@@ -146,9 +146,9 @@ public function test_columns_declared_as_the_file_types_them_read_as_their_value
static::assertEquals(
$rows->toArray(),
- ParquetFilesContext::rows((new PhpParquetOpenSource((new Reader(
+ ParquetFilesContext::rows(new PhpParquetOpenSource(new Reader(
engine: new PhpParquetEngine(),
- ))->readStream($filesystem->readFrom(path('memory://typed.parquet')))))->batches(
+ )->readStream($filesystem->readFrom(path('memory://typed.parquet'))))->batches(
$rows->schema(),
100,
ParquetFilesContext::plan($filesystem, 'memory://typed.parquet'),
@@ -169,9 +169,9 @@ public function test_a_column_declared_as_another_type_is_cast_from_the_file_val
static::assertSame(
array_to_rows([['ats' => [$at]]], $declared)->toArray(),
- ParquetFilesContext::rows((new PhpParquetOpenSource((new Reader(
+ ParquetFilesContext::rows(new PhpParquetOpenSource(new Reader(
engine: new PhpParquetEngine(),
- ))->readStream($filesystem->readFrom(path('memory://typed.parquet')))))->batches(
+ )->readStream($filesystem->readFrom(path('memory://typed.parquet'))))->batches(
$declared,
100,
ParquetFilesContext::plan($filesystem, 'memory://typed.parquet'),
@@ -184,9 +184,9 @@ public function test_batches_hold_the_schema_columns(): void
{
$filesystem = memory_filesystem();
ParquetFilesContext::rowGroups($filesystem, 'memory://groups.parquet', 10, 4);
- $source = new PhpParquetOpenSource((new Reader(
+ $source = new PhpParquetOpenSource(new Reader(
engine: new PhpParquetEngine(),
- ))->readStream($filesystem->readFrom(path('memory://groups.parquet'))));
+ )->readStream($filesystem->readFrom(path('memory://groups.parquet'))));
$names = [];
@@ -213,9 +213,9 @@ public function test_a_column_the_file_lacks_is_refused(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Parquet file has no column "missing"');
- iterator_to_array((new PhpParquetOpenSource((new Reader(
+ iterator_to_array(new PhpParquetOpenSource(new Reader(
engine: new PhpParquetEngine(),
- ))->readStream($filesystem->readFrom(path('memory://groups.parquet')))))->batches(
+ )->readStream($filesystem->readFrom(path('memory://groups.parquet'))))->batches(
schema(int_schema('missing')),
10,
ParquetFilesContext::plan($filesystem, 'memory://groups.parquet'),
@@ -231,9 +231,9 @@ public function test_a_batch_size_below_one_is_refused(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Parquet batch size must be greater than 0');
- iterator_to_array((new PhpParquetOpenSource((new Reader(
+ iterator_to_array(new PhpParquetOpenSource(new Reader(
engine: new PhpParquetEngine(),
- ))->readStream($filesystem->readFrom(path('memory://groups.parquet')))))->batches(
+ )->readStream($filesystem->readFrom(path('memory://groups.parquet'))))->batches(
schema(int_schema('id')),
0,
ParquetFilesContext::plan($filesystem, 'memory://groups.parquet'),
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/Pushdown/FilterTranslatorTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/Pushdown/FilterTranslatorTest.php
index 2993b7f7da..40c9fd07d8 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/Pushdown/FilterTranslatorTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/Pushdown/FilterTranslatorTest.php
@@ -129,7 +129,7 @@ public static function translated(): Generator
#[DataProvider('translated')]
public function test_a_pushable_conjunct_is_translated(ScalarFunction $function, Filter $expected): void
{
- $translated = (new FilterTranslator())->translate([$function], BodySchemaMother::everyLeafType());
+ $translated = new FilterTranslator()->translate([$function], BodySchemaMother::everyLeafType());
static::assertCount(1, $translated);
static::assertEquals($expected, $translated[0]->filter);
@@ -170,7 +170,7 @@ public static function refused(): Generator
#[DataProvider('refused')]
public function test_a_conjunct_that_cannot_be_pushed_is_refused(ScalarFunction $function): void
{
- static::assertSame([], (new FilterTranslator())->translate([$function], BodySchemaMother::everyLeafType()));
+ static::assertSame([], new FilterTranslator()->translate([$function], BodySchemaMother::everyLeafType()));
}
public static function throwingInPhp(): Generator
@@ -188,7 +188,7 @@ public static function throwingInPhp(): Generator
public function test_a_pushed_conjunct_runs_before_the_kept_ones_so_one_that_can_throw_in_php_is_never_translated(
ScalarFunction $function,
): void {
- static::assertSame([], (new FilterTranslator())->translate([$function], BodySchemaMother::everyLeafType()));
+ static::assertSame([], new FilterTranslator()->translate([$function], BodySchemaMother::everyLeafType()));
}
public static function inexact(): Generator
@@ -202,7 +202,7 @@ public static function inexact(): Generator
public function test_a_conjunct_whose_filter_keeps_more_rows_is_translated_as_inexact(
ScalarFunction $function,
): void {
- static::assertFalse((new FilterTranslator())->translate(
+ static::assertFalse(new FilterTranslator()->translate(
[$function],
BodySchemaMother::everyLeafType(),
)[0]->exact);
@@ -210,7 +210,7 @@ public function test_a_conjunct_whose_filter_keeps_more_rows_is_translated_as_in
public function test_a_conjunct_without_an_is_in_holding_null_is_translated_as_exact(): void
{
- static::assertTrue((new FilterTranslator())->translate([ref('id')->isIn(lit([
+ static::assertTrue(new FilterTranslator()->translate([ref('id')->isIn(lit([
1,
2,
]))], BodySchemaMother::everyLeafType())[0]->exact);
@@ -243,13 +243,13 @@ public function test_the_float_columns_ordered_with_greater_than_are_nan_sensiti
): void {
static::assertSame(
$columns,
- (new FilterTranslator())->translate([$function], BodySchemaMother::everyLeafType())[0]->nanSensitiveColumns,
+ new FilterTranslator()->translate([$function], BodySchemaMother::everyLeafType())[0]->nanSensitiveColumns,
);
}
public function test_every_conjunct_is_translated_on_its_own(): void
{
- $translated = (new FilterTranslator())->translate([
+ $translated = new FilterTranslator()->translate([
ref('id')->greaterThan(lit(1)),
ref('name')->endsWith(lit('a')),
ref('name')->equals(lit('b'))->or(ref('price')->lessThan(lit(2.0))),
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/Pushdown/TranslatedConjunctTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/Pushdown/TranslatedConjunctTest.php
index c0193d5a58..c0095422f9 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/Pushdown/TranslatedConjunctTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/Pushdown/TranslatedConjunctTest.php
@@ -18,7 +18,7 @@ final class TranslatedConjunctTest extends FlowTestCase
{
public function test_a_file_storing_every_column_as_the_body_types_it_is_read_as_is(): void
{
- static::assertTrue((new TranslatedConjunct(parquet_column('id')->equals(1), ['id', 'name'], true, []))->readsAs(
+ static::assertTrue(new TranslatedConjunct(parquet_column('id')->equals(1), ['id', 'name'], true, [])->readsAs(
schema(int_schema('id'), str_schema('name')),
schema(int_schema('id', nullable: true), str_schema('name', nullable: true)),
));
@@ -26,12 +26,12 @@ public function test_a_file_storing_every_column_as_the_body_types_it_is_read_as
public function test_a_column_the_file_stores_as_another_type_is_not_read_as_is(): void
{
- static::assertFalse((new TranslatedConjunct(
+ static::assertFalse(new TranslatedConjunct(
parquet_column('big')->lessThan('2'),
['id', 'big'],
true,
[],
- ))->readsAs(
+ )->readsAs(
schema(int_schema('id'), definition_from_type('big', type_numeric_string())),
schema(int_schema('id'), str_schema('big')),
));
@@ -39,11 +39,9 @@ public function test_a_column_the_file_stores_as_another_type_is_not_read_as_is(
public function test_a_column_absent_from_the_file_is_read_as_is(): void
{
- static::assertTrue((new TranslatedConjunct(
- parquet_column('missing')->isNull(),
- ['missing'],
- true,
- [],
- ))->readsAs(schema(int_schema('id')), schema(int_schema('id'), str_schema('missing', nullable: true))));
+ static::assertTrue(new TranslatedConjunct(parquet_column('missing')->isNull(), ['missing'], true, [])->readsAs(
+ schema(int_schema('id')),
+ schema(int_schema('id'), str_schema('missing', nullable: true)),
+ ));
}
}
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/RustParquetOpenSourceTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/RustParquetOpenSourceTest.php
index 8cc3c54512..b9b697e7d9 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/RustParquetOpenSourceTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/RustParquetOpenSourceTest.php
@@ -42,9 +42,9 @@ public function test_a_planned_window_crosses_row_groups(int $offset, ?int $limi
$read = [];
- foreach ((new RustParquetOpenSource(new FlowPhpParquetFileReader($filesystem->readFrom(path(
+ foreach (new RustParquetOpenSource(new FlowPhpParquetFileReader($filesystem->readFrom(path(
'memory://groups.parquet',
- )))))->batches(
+ ))))->batches(
schema(int_schema('id')),
3,
ParquetFilesContext::plan($filesystem, 'memory://groups.parquet', $offset, $limit),
@@ -66,9 +66,9 @@ public function test_an_empty_schema_yields_the_rows_of_the_window(int $offset,
$counted = 0;
- foreach (ParquetFilesContext::rows((new RustParquetOpenSource(new FlowPhpParquetFileReader($filesystem->readFrom(path(
+ foreach (ParquetFilesContext::rows(new RustParquetOpenSource(new FlowPhpParquetFileReader($filesystem->readFrom(path(
'memory://groups.parquet',
- )))))->batches(
+ ))))->batches(
schema(),
3,
ParquetFilesContext::plan($filesystem, 'memory://groups.parquet', $offset, $limit),
@@ -89,9 +89,9 @@ public function test_an_empty_schema_yields_the_rows_the_row_filter_keeps(): voi
$counted = 0;
- foreach (ParquetFilesContext::rows((new RustParquetOpenSource(new FlowPhpParquetFileReader($filesystem->readFrom(path(
+ foreach (ParquetFilesContext::rows(new RustParquetOpenSource(new FlowPhpParquetFileReader($filesystem->readFrom(path(
'memory://groups.parquet',
- )))))->batches(
+ ))))->batches(
schema(),
100,
ParquetFilesContext::plan(
@@ -171,9 +171,9 @@ public function test_close_before_batches_is_harmless(): void
$filesystem = memory_filesystem();
ParquetFilesContext::rowGroups($filesystem, 'memory://groups.parquet', 10, 4);
- (new RustParquetOpenSource(new FlowPhpParquetFileReader($filesystem->readFrom(path(
+ new RustParquetOpenSource(new FlowPhpParquetFileReader($filesystem->readFrom(path(
'memory://groups.parquet',
- )))))->close();
+ ))))->close();
$this->expectNotToPerformAssertions();
}
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/ParquetFileWriterFactoryTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/ParquetFileWriterFactoryTest.php
index b10d3f99e3..c22a74b0bf 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/ParquetFileWriterFactoryTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/ParquetFileWriterFactoryTest.php
@@ -116,13 +116,13 @@ public function test_the_first_writer_fixes_the_schema_every_stream_is_written_u
public function test_a_declared_schema_is_the_written_one(): void
{
$filesystem = memory_filesystem();
- $writer = (new ParquetFileWriterFactory(
+ $writer = new ParquetFileWriterFactory(
schema(int_schema('id', nullable: true), str_schema('note', nullable: true)),
new SchemaConverter(),
Compressions::UNCOMPRESSED,
Options::default(),
new PhpParquetEngine(),
- ))->writer($filesystem->writeTo(path('memory://a.parquet')), schema(int_schema('id')), new PhpBackend());
+ )->writer($filesystem->writeTo(path('memory://a.parquet')), schema(int_schema('id')), new PhpBackend());
$writer->write(array_to_rows([['id' => 1]], schema(int_schema('id'))));
$writer->close();
@@ -153,13 +153,13 @@ public function test_a_default_engine_writes_a_file_php_reads(?ParquetEngine $en
{
$filesystem = memory_filesystem();
$schema = schema(int_schema('id'));
- $writer = (new ParquetFileWriterFactory(
+ $writer = new ParquetFileWriterFactory(
$schema,
new SchemaConverter(),
Compressions::GZIP,
Options::default(),
$engine,
- ))->writer($filesystem->writeTo(path('memory://out.parquet')), $schema, new PhpBackend());
+ )->writer($filesystem->writeTo(path('memory://out.parquet')), $schema, new PhpBackend());
$writer->write(array_to_rows([['id' => 1], ['id' => 2]], $schema));
$writer->close();
@@ -177,13 +177,13 @@ public function test_a_default_engine_writes_a_file_php_reads(?ParquetEngine $en
#[DataProvider('lanes')]
public function test_the_engine_decides_which_lane_writes(Closure $engine, string $lane): void
{
- static::assertInstanceOf($lane, (new ParquetFileWriterFactory(
+ static::assertInstanceOf($lane, new ParquetFileWriterFactory(
schema(int_schema('id')),
new SchemaConverter(),
Compressions::SNAPPY,
Options::default(),
$engine(),
- ))->writer(
+ )->writer(
memory_filesystem()->writeTo(path('memory://out.parquet')),
schema(int_schema('id')),
new PhpBackend(),
@@ -195,13 +195,13 @@ public function test_any_other_engine_writes_the_file(): void
$filesystem = memory_filesystem();
$schema = schema(int_schema('id'));
$engine = new RecordingParquetEngine();
- $writer = (new ParquetFileWriterFactory(
+ $writer = new ParquetFileWriterFactory(
$schema,
new SchemaConverter(),
Compressions::SNAPPY,
Options::default(),
$engine,
- ))->writer($filesystem->writeTo(path('memory://out.parquet')), $schema, new PhpBackend());
+ )->writer($filesystem->writeTo(path('memory://out.parquet')), $schema, new PhpBackend());
$writer->write(array_to_rows([['id' => 1], ['id' => 2]], $schema));
$writer->close();
@@ -218,14 +218,14 @@ public function test_a_flow_php_of_another_abi_is_refused(): void
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('does not match flow-php/etl');
- (new ParquetFileWriterFactory(
+ new ParquetFileWriterFactory(
schema(int_schema('id')),
new SchemaConverter(),
Compressions::SNAPPY,
Options::default(),
new PhpParquetEngine(),
new FlowPhpExtension(true, FlowPhpExtension::ABI + 1, '0.46.0'),
- ))->writer(
+ )->writer(
memory_filesystem()->writeTo(path('memory://out.parquet')),
schema(int_schema('id')),
new PhpBackend(),
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/ParquetFileWriterTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/ParquetFileWriterTest.php
index fed75d1eb1..9127ea2f96 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/ParquetFileWriterTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/ParquetFileWriterTest.php
@@ -115,9 +115,9 @@ public function test_written_batches_read_back_equal(): void
{
$filesystem = memory_filesystem();
$schema = schema(int_schema('id'), str_schema('name', nullable: true));
- $parquetSchema = (new SchemaConverter())->toParquetSchema($schema);
+ $parquetSchema = new SchemaConverter()->toParquetSchema($schema);
$writer = new ParquetFileWriter(
- (new PhpParquetEngine())->openForWrite(
+ new PhpParquetEngine()->openForWrite(
$filesystem->writeTo(path('memory://out.parquet')),
$parquetSchema,
Compressions::SNAPPY,
@@ -140,9 +140,9 @@ public function test_written_batches_read_back_equal(): void
public function test_a_column_of_another_stored_type_is_conformed_before_it_is_written(): void
{
$filesystem = memory_filesystem();
- $parquetSchema = (new SchemaConverter())->toParquetSchema(schema(int_schema('id', nullable: true)));
+ $parquetSchema = new SchemaConverter()->toParquetSchema(schema(int_schema('id', nullable: true)));
$writer = new ParquetFileWriter(
- (new PhpParquetEngine())->openForWrite(
+ new PhpParquetEngine()->openForWrite(
$filesystem->writeTo(path('memory://out.parquet')),
$parquetSchema,
Compressions::SNAPPY,
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/ParquetLoaderTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/ParquetLoaderTest.php
index d9be62da94..e368009842 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/ParquetLoaderTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/ParquetLoaderTest.php
@@ -82,7 +82,7 @@ public function test_a_batch_without_rows_writes_no_file(): void
public function test_setting_content_type_on_path(): void
{
static::assertEquals(
- (new ParquetLoader(path(__DIR__ . '/file.parquet')))
+ new ParquetLoader(path(__DIR__ . '/file.parquet'))
->destination()
->getOption(Option::CONTENT_TYPE),
ContentType::PARQUET,
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/ParquetSchemaConformanceTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/ParquetSchemaConformanceTest.php
index b6debd6af8..daceb26466 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/ParquetSchemaConformanceTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/ParquetSchemaConformanceTest.php
@@ -30,10 +30,10 @@ final class ParquetSchemaConformanceTest extends FlowTestCase
{
public function test_a_column_of_another_type_is_cast_to_the_writer_type(): void
{
- $conformed = (new ParquetSchemaConformance((new SchemaConverter())->toParquetSchema(schema(
+ $conformed = new ParquetSchemaConformance(new SchemaConverter()->toParquetSchema(schema(
str_schema('id'),
str_schema('name'),
- ))))->conform(
+ )))->conform(
array_to_rows(
[['id' => 1, 'name' => 'a'], ['id' => 2, 'name' => 'b']],
schema(int_schema('id'), str_schema('name')),
@@ -47,9 +47,9 @@ public function test_a_column_of_another_type_is_cast_to_the_writer_type(): void
public function test_a_date_is_cast_to_a_datetime(): void
{
- $conformed = (new ParquetSchemaConformance((new SchemaConverter())->toParquetSchema(schema(datetime_schema(
+ $conformed = new ParquetSchemaConformance(new SchemaConverter()->toParquetSchema(schema(datetime_schema(
'at',
- )))))->conform(array_to_rows([[
+ ))))->conform(array_to_rows([[
'at' => new DateTimeImmutable('2026-09-01'),
]], schema(date_schema('at'))), new AdaptiveBackend());
@@ -59,9 +59,9 @@ public function test_a_date_is_cast_to_a_datetime(): void
public function test_a_null_typed_column_is_cast_to_a_string_column(): void
{
- $conformed = (new ParquetSchemaConformance((new SchemaConverter())->toParquetSchema(schema(null_schema(
+ $conformed = new ParquetSchemaConformance(new SchemaConverter()->toParquetSchema(schema(null_schema(
'nothing',
- )))))->conform(array_to_rows([['nothing' => null]], schema(null_schema('nothing'))), new AdaptiveBackend());
+ ))))->conform(array_to_rows([['nothing' => null]], schema(null_schema('nothing'))), new AdaptiveBackend());
static::assertEquals(schema(str_schema('nothing', nullable: true)), $conformed->schema());
static::assertSame([null], $conformed->column('nothing')->values());
@@ -71,10 +71,10 @@ public function test_a_matching_column_is_passed_on_as_it_is(): void
{
$rows = array_to_rows([['id' => 1, 'name' => 'a']], schema(int_schema('id'), str_schema('name')));
- $conformed = (new ParquetSchemaConformance((new SchemaConverter())->toParquetSchema(schema(
+ $conformed = new ParquetSchemaConformance(new SchemaConverter()->toParquetSchema(schema(
str_schema('id'),
str_schema('name'),
- ))))->conform($rows, new AdaptiveBackend());
+ )))->conform($rows, new AdaptiveBackend());
static::assertSame($rows->column('name'), $conformed->column('name'));
}
@@ -90,27 +90,27 @@ public function test_a_zoned_datetime_column_is_passed_on_as_it_is(): void
'history' => [new DateTimeImmutable('2026-09-01 11:00:00 UTC')],
]], $schema);
- static::assertSame($rows, (new ParquetSchemaConformance((new SchemaConverter())->toParquetSchema(
+ static::assertSame($rows, new ParquetSchemaConformance(new SchemaConverter()->toParquetSchema(
$schema,
- )))->conform($rows, new AdaptiveBackend()));
+ ))->conform($rows, new AdaptiveBackend()));
}
public function test_rows_matching_the_writer_schema_are_passed_on_as_they_are(): void
{
$rows = array_to_rows([['id' => 1]], schema(int_schema('id')));
- static::assertSame($rows, (new ParquetSchemaConformance((new SchemaConverter())->toParquetSchema(schema(int_schema(
+ static::assertSame($rows, new ParquetSchemaConformance(new SchemaConverter()->toParquetSchema(schema(int_schema(
'id',
- )))))->conform($rows, new AdaptiveBackend()));
+ ))))->conform($rows, new AdaptiveBackend()));
}
public function test_a_column_the_writer_does_not_know_is_passed_on_as_it_is(): void
{
$rows = array_to_rows([['id' => 1, 'extra' => 'x']], schema(int_schema('id'), str_schema('extra')));
- static::assertSame($rows, (new ParquetSchemaConformance((new SchemaConverter())->toParquetSchema(schema(int_schema(
+ static::assertSame($rows, new ParquetSchemaConformance(new SchemaConverter()->toParquetSchema(schema(int_schema(
'id',
- )))))->conform($rows, new AdaptiveBackend()));
+ ))))->conform($rows, new AdaptiveBackend()));
}
public function test_a_datetime_zone_is_not_stored(): void
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/RustParquetFileWriterTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/RustParquetFileWriterTest.php
index 4eedc9b237..abd0231736 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/RustParquetFileWriterTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/RustParquetFileWriterTest.php
@@ -65,9 +65,9 @@ public function test_an_exception_append_throws_surfaces_as_itself(): void
{
$filesystem = memory_filesystem();
$schema = schema(int_schema('id'));
- $parquetSchema = (new SchemaConverter())->toParquetSchema($schema);
+ $parquetSchema = new SchemaConverter()->toParquetSchema($schema);
$writer = new RustParquetFileWriter(
- (new FlowPhpParquetEngine())->openForWrite(
+ new FlowPhpParquetEngine()->openForWrite(
new FailingAppendDestinationStream($filesystem->writeTo(path('memory://out.parquet'))),
$parquetSchema,
Compressions::SNAPPY,
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/Values/Schema/FlowToParquetSchemaTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/Values/Schema/FlowToParquetSchemaTest.php
index dc14f7e724..f80c6a4fbd 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/Values/Schema/FlowToParquetSchemaTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/Values/Schema/FlowToParquetSchemaTest.php
@@ -64,7 +64,7 @@ public function test_convert_etl_entries_to_parquet_fields(): void
ParquetSchema\Repetition::REQUIRED,
),
),
- (new SchemaConverter())->toParquetSchema(schema(
+ new SchemaConverter()->toParquetSchema(schema(
integer_schema('integer'),
bool_schema('boolean'),
string_schema('string'),
@@ -94,7 +94,7 @@ public function test_converting_structure_with_optional_elements_throws(): void
'Parquet schema does not support structure optional elements, given: structure{a: string, b?: string}',
);
- (new SchemaConverter())->toParquetSchema(schema(structure_schema('structure', type_structure([
+ new SchemaConverter()->toParquetSchema(schema(structure_schema('structure', type_structure([
'a' => type_string(),
'b' => structure_element('b', type_string(), optional: true),
]))));
@@ -107,7 +107,7 @@ public function test_converting_structure_with_an_interleaved_optional_element_t
'Parquet schema does not support structure optional elements, given: structure{b?: string, a: string}',
);
- (new SchemaConverter())->toParquetSchema(schema(structure_schema('structure', type_structure([
+ new SchemaConverter()->toParquetSchema(schema(structure_schema('structure', type_structure([
'b' => structure_element('b', type_string(), optional: true),
'a' => type_string(),
]))));
@@ -120,7 +120,7 @@ public function test_converting_nested_structure_with_optional_elements_throws()
'Parquet schema does not support structure optional elements, given: structure{b: string, c?: string}',
);
- (new SchemaConverter())->toParquetSchema(schema(structure_schema('structure', type_structure([
+ new SchemaConverter()->toParquetSchema(schema(structure_schema('structure', type_structure([
'a' => type_structure(['b' => type_string(), 'c' => structure_element('c', type_string(), optional: true)]),
]))));
}
@@ -129,7 +129,7 @@ public function test_a_numeric_string_column_is_written_as_a_string(): void
{
static::assertEquals(
ParquetSchema::with(FlatColumn::string('id')),
- (new SchemaConverter())->toParquetSchema(schema(definition_from_type('id', type_numeric_string(), true))),
+ new SchemaConverter()->toParquetSchema(schema(definition_from_type('id', type_numeric_string(), true))),
);
}
}
diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/Values/Schema/ParquetToFlowSchemaTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/Values/Schema/ParquetToFlowSchemaTest.php
index 22f88e7f70..6c40dfb42a 100644
--- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/Values/Schema/ParquetToFlowSchemaTest.php
+++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/Values/Schema/ParquetToFlowSchemaTest.php
@@ -136,7 +136,7 @@ public function test_converting_struct_to_flow_schema(): void
public function test_uint64_columns_are_numeric_strings(): void
{
- $flowSchema = (new SchemaConverter())->toFlowSchema(Schema::with(
+ $flowSchema = new SchemaConverter()->toFlowSchema(Schema::with(
new FlatColumn('converted', PhysicalType::INT64, ConvertedType::UINT_64, repetition: Repetition::REQUIRED),
new FlatColumn('logical', PhysicalType::INT64, logicalType: LogicalType::integer(64, false)),
new FlatColumn('uint32', PhysicalType::INT32, ConvertedType::UINT_32),
@@ -149,13 +149,13 @@ public function test_uint64_columns_are_numeric_strings(): void
static::assertTrue(type_equals(type_integer(), $flowSchema->get('uint32')->type()));
static::assertTrue(type_equals(
type_optional(type_numeric_string()),
- (new SchemaConverter())->parquetToFlowType(
+ new SchemaConverter()->parquetToFlowType(
new FlatColumn('u', PhysicalType::INT64, logicalType: LogicalType::integer(64, false)),
),
));
static::assertTrue(type_equals(
type_numeric_string(),
- (new SchemaConverter())->parquetToFlowType(
+ new SchemaConverter()->parquetToFlowType(
new FlatColumn('u', PhysicalType::INT64, ConvertedType::UINT_64, repetition: Repetition::REQUIRED),
),
));
diff --git a/src/adapter/etl-adapter-postgresql/composer.json b/src/adapter/etl-adapter-postgresql/composer.json
index 27ab387bdc..6731991878 100644
--- a/src/adapter/etl-adapter-postgresql/composer.json
+++ b/src/adapter/etl-adapter-postgresql/composer.json
@@ -11,7 +11,7 @@
"extractor"
],
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/etl": "self.version",
"flow-php/postgresql": "self.version"
},
diff --git a/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Extractor/PostgreSqlCursorExtractor.php b/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Extractor/PostgreSqlCursorExtractor.php
index 84a7a17f4a..7ba010c94f 100644
--- a/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Extractor/PostgreSqlCursorExtractor.php
+++ b/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Extractor/PostgreSqlCursorExtractor.php
@@ -123,7 +123,7 @@ public function extract(Backend $backend, Criteria $criteria): Generator
$cursor->free();
- $rows = (new RowsBuilder($schema, $backend))
+ $rows = new RowsBuilder($schema, $backend)
->appendRows($rawBatch)
->finish();
@@ -182,7 +182,7 @@ public function schema(): Schema
}
try {
- return $this->derivedSchema ??= (new ResultSchema())->of(
+ return $this->derivedSchema ??= new ResultSchema()->of(
$this->client,
$this->read ??= ReadQuery::of($this->query, self::class),
$this->parameters,
@@ -197,7 +197,7 @@ public function schema(): Schema
public function statistics(): Statistics
{
- return $this->statistics ??= new Statistics(rows: (new ExplainedRows())->of(
+ return $this->statistics ??= new Statistics(rows: new ExplainedRows()->of(
$this->client,
$this->query,
$this->parameters,
diff --git a/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Extractor/PostgreSqlKeySetExtractor.php b/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Extractor/PostgreSqlKeySetExtractor.php
index d2247b70d1..e3bd8b1336 100644
--- a/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Extractor/PostgreSqlKeySetExtractor.php
+++ b/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Extractor/PostgreSqlKeySetExtractor.php
@@ -115,7 +115,7 @@ public function extract(Backend $backend, Criteria $criteria): Generator
$page = KeySetPage::of($this->keySet, $fetched, $size, $expected);
if ($page->rows !== []) {
- $rows = (new RowsBuilder($schema, $backend))
+ $rows = new RowsBuilder($schema, $backend)
->appendRows($page->rows)
->finish();
@@ -153,7 +153,7 @@ public function schema(): Schema
}
try {
- return $this->derivedSchema ??= (new ResultSchema())->of(
+ return $this->derivedSchema ??= new ResultSchema()->of(
$this->client,
$this->read ??= ReadQuery::of($this->query, self::class),
$this->parameters,
@@ -168,7 +168,7 @@ public function schema(): Schema
public function statistics(): Statistics
{
- return $this->statistics ??= new Statistics(rows: (new ExplainedRows())->of(
+ return $this->statistics ??= new Statistics(rows: new ExplainedRows()->of(
$this->client,
$this->query,
$this->parameters,
diff --git a/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Extractor/PostgreSqlLimitOffsetExtractor.php b/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Extractor/PostgreSqlLimitOffsetExtractor.php
index 27cd78d801..4bfdfb255c 100644
--- a/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Extractor/PostgreSqlLimitOffsetExtractor.php
+++ b/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Extractor/PostgreSqlLimitOffsetExtractor.php
@@ -112,7 +112,7 @@ public function extract(Backend $backend, Criteria $criteria): Generator
return;
}
- $rows = (new RowsBuilder($schema, $backend))
+ $rows = new RowsBuilder($schema, $backend)
->appendRows($rawBatch)
->finish();
@@ -147,7 +147,7 @@ public function schema(): Schema
}
try {
- return $this->derivedSchema ??= (new ResultSchema())->of(
+ return $this->derivedSchema ??= new ResultSchema()->of(
$this->client,
$this->read ??= ReadQuery::of($this->query, self::class),
$this->parameters,
@@ -162,7 +162,7 @@ public function schema(): Schema
public function statistics(): Statistics
{
- return $this->statistics ??= new Statistics(rows: (new ExplainedRows())->of(
+ return $this->statistics ??= new Statistics(rows: new ExplainedRows()->of(
$this->client,
$this->query,
$this->parameters,
diff --git a/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Extractor/ReadQuery.php b/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Extractor/ReadQuery.php
index 8652fe7326..b0e8706ea0 100644
--- a/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Extractor/ReadQuery.php
+++ b/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Extractor/ReadQuery.php
@@ -123,7 +123,7 @@ public function keySetNullCheck(KeySet $keySet): string
$copy->mergeFrom($this->select->raw());
return select(literal(1))
- ->from(new DerivedTable((new Node())->setSelectStmt($copy), '_flow_keyset_nulls'))
+ ->from(new DerivedTable(new Node()->setSelectStmt($copy), '_flow_keyset_nulls'))
->where(or_(...$conditions))
->limit(1)
->toSql();
diff --git a/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Loader/HTMLConverter.php b/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Loader/HTMLConverter.php
index 3e6d34020a..8193b66f1e 100644
--- a/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Loader/HTMLConverter.php
+++ b/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Loader/HTMLConverter.php
@@ -28,7 +28,6 @@ public function toDatabase(mixed $value): ?string
}
if ($value instanceof HTMLDocument) {
- // @mago-ignore analysis:unavailable-method
return $value->saveHTML() ?: null;
}
diff --git a/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Loader/QueryBuilder/DeleteQueryBuilder.php b/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Loader/QueryBuilder/DeleteQueryBuilder.php
index 8855e8bb74..c08f71da23 100644
--- a/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Loader/QueryBuilder/DeleteQueryBuilder.php
+++ b/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Loader/QueryBuilder/DeleteQueryBuilder.php
@@ -52,7 +52,7 @@ public function build(array $value, Schema $schema, DeleteOptions $options): arr
$conditions[] = eq(col($key), param($paramIndex++));
$params[] = $this->typesMap->map(
$key,
- $schema->get((new UnresolvedReference($key))->name())->type(),
+ $schema->get(new UnresolvedReference($key)->name())->type(),
$value[$key],
);
}
diff --git a/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Loader/QueryBuilder/InsertQueryBuilder.php b/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Loader/QueryBuilder/InsertQueryBuilder.php
index be9b3873ed..f2e817a8c4 100644
--- a/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Loader/QueryBuilder/InsertQueryBuilder.php
+++ b/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Loader/QueryBuilder/InsertQueryBuilder.php
@@ -64,7 +64,7 @@ public function build(
$columnConverters = [];
foreach ($names as $column) {
- $types[$column] = $schema->get((new UnresolvedReference($column))->name())->type();
+ $types[$column] = $schema->get(new UnresolvedReference($column)->name())->type();
}
for ($i = 0; $i < $count; $i++) {
diff --git a/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Loader/QueryBuilder/UpdateQueryBuilder.php b/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Loader/QueryBuilder/UpdateQueryBuilder.php
index 522f299a87..5891be307c 100644
--- a/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Loader/QueryBuilder/UpdateQueryBuilder.php
+++ b/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/IO/Loader/QueryBuilder/UpdateQueryBuilder.php
@@ -54,7 +54,7 @@ public function build(array $value, Schema $schema, UpdateOptions $options): arr
$assignments[$column] = param($paramIndex++);
$params[] = $this->typesMap->map(
$column,
- $schema->get((new UnresolvedReference($column))->name())->type(),
+ $schema->get(new UnresolvedReference($column)->name())->type(),
$columnValue,
);
}
@@ -73,7 +73,7 @@ public function build(array $value, Schema $schema, UpdateOptions $options): arr
$conditions[] = eq(col($key), param($paramIndex++));
$params[] = $this->typesMap->map(
$key,
- $schema->get((new UnresolvedReference($key))->name())->type(),
+ $schema->get(new UnresolvedReference($key)->name())->type(),
$value[$key],
);
}
diff --git a/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/Values/Schema/SchemaConverter.php b/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/Values/Schema/SchemaConverter.php
index b5ec539bc0..a0b196ba32 100644
--- a/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/Values/Schema/SchemaConverter.php
+++ b/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/Values/Schema/SchemaConverter.php
@@ -77,14 +77,14 @@ public function toPostgreSqlTable(
);
}
- return (new Table(
+ return new Table(
schema: $databaseSchema,
name: $tableName,
columns: $columns,
primaryKey: $this->primaryKey($schema),
indexes: $this->indexes($schema),
uniqueConstraints: $this->uniqueConstraints($schema),
- ))->withOptions($options ?? new TableOptions());
+ )->withOptions($options ?? new TableOptions());
}
/**
diff --git a/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/functions.php b/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/functions.php
index 8b465de7c2..af7965ce2a 100644
--- a/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/functions.php
+++ b/src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/functions.php
@@ -175,7 +175,7 @@ function to_pgsql_schema_table(
?TypesMap $typesMap = null,
?TableOptions $options = null,
): Table {
- return (new SchemaConverter($typesMap))->toPostgreSqlTable($schema, $tableName, $databaseSchema, $options);
+ return new SchemaConverter($typesMap)->toPostgreSqlTable($schema, $tableName, $databaseSchema, $options);
}
/**
@@ -184,7 +184,7 @@ function to_pgsql_schema_table(
#[DocumentationDSL(module: Module::POSTGRESQL, type: DSLType::HELPER)]
function pgsql_table_to_flow_schema(Table $table, ?TypesMap $typesMap = null): Schema
{
- return (new SchemaConverter($typesMap))->toFlowSchema($table);
+ return new SchemaConverter($typesMap)->toFlowSchema($table);
}
#[DocumentationDSL(module: Module::POSTGRESQL, type: DSLType::HELPER)]
diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/DescribableRoundTripTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/DescribableRoundTripTest.php
index a04f918d85..0509e9b53c 100644
--- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/DescribableRoundTripTest.php
+++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/DescribableRoundTripTest.php
@@ -6,7 +6,6 @@
use Flow\ETL\Adapter\PostgreSql\Tests\Context\DescribableFixtures;
use Flow\ETL\Foundation\Describe\Describable;
-use Flow\ETL\Foundation\Exception\RequiredPHPVersionException;
use Flow\ETL\Foundation\Exception\RuntimeException;
use Flow\ETL\Tests\Context\DescribeRoundTrip;
use Flow\ETL\Tests\Context\ExtractorClasses;
@@ -58,11 +57,7 @@ public function test_a_rebuilt_describable_equals_the_described_one(string $clas
$this->expectException(RuntimeException::class);
}
- try {
- $describable = DescribableFixtures::all()[$class]();
- } catch (RequiredPHPVersionException $e) {
- static::markTestSkipped($e->getMessage());
- }
+ $describable = DescribableFixtures::all()[$class]();
if (in_array($class, DescribableFixtures::undescribable(), true)) {
static::assertNull($describable->describe());
diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/ExplainedRowsTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/ExplainedRowsTest.php
index 089a68be35..bfa23ff2e8 100644
--- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/ExplainedRowsTest.php
+++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/ExplainedRowsTest.php
@@ -16,7 +16,7 @@ public function test_a_maximum_above_the_estimate_only_bounds_it(): void
{
static::assertEquals(
new Cardinality(atMost: 50, estimate: 7, relativeError: Cardinality::DEFAULT_RELATIVE_ERROR),
- (new ExplainedRows())->of((new SpyClient())->willExplain(7), 'SELECT 1', maximum: 50),
+ new ExplainedRows()->of(new SpyClient()->willExplain(7), 'SELECT 1', maximum: 50),
);
}
@@ -24,15 +24,15 @@ public function test_a_maximum_below_the_estimate_caps_it(): void
{
static::assertEquals(
new Cardinality(atMost: 5, estimate: 5, relativeError: Cardinality::DEFAULT_RELATIVE_ERROR),
- (new ExplainedRows())->of((new SpyClient())->willExplain(7), 'SELECT 1', maximum: 5),
+ new ExplainedRows()->of(new SpyClient()->willExplain(7), 'SELECT 1', maximum: 5),
);
}
public function test_the_plan_is_asked_for_an_estimate_only(): void
{
- $client = (new SpyClient())->willExplain(7);
+ $client = new SpyClient()->willExplain(7);
- static::assertEquals(Cardinality::approximately(7), (new ExplainedRows())->of($client, 'SELECT $1', [3]));
+ static::assertEquals(Cardinality::approximately(7), new ExplainedRows()->of($client, 'SELECT $1', [3]));
static::assertEquals(
[['sql' => 'SELECT $1', 'parameters' => [3], 'config' => ExplainConfig::forEstimate()]],
$client->explained,
diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/MetadataColumnsExtractorTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/MetadataColumnsExtractorTest.php
index 78ff994f30..4f7a3fa577 100644
--- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/MetadataColumnsExtractorTest.php
+++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/MetadataColumnsExtractorTest.php
@@ -31,7 +31,7 @@ public static function extractors(): Generator
#[DataProvider('extractors')]
public function test_an_extractor_carries_the_metadata_setter_only_when_it_declares_metadata(string $class): void
{
- if ((new ReflectionClass($class))->implementsInterface(MetadataColumnsExtractor::class)) {
+ if (new ReflectionClass($class)->implementsInterface(MetadataColumnsExtractor::class)) {
MetadataColumnsContract::declares($class);
return;
diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlCursorExtractorTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlCursorExtractorTest.php
index e6246c6443..b0b1a78ee8 100644
--- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlCursorExtractorTest.php
+++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlCursorExtractorTest.php
@@ -33,7 +33,7 @@ final class PostgreSqlCursorExtractorTest extends FlowTestCase
{
public function test_a_close_failure_never_replaces_the_read_failure(): void
{
- $client = (new SpyClient(transactionNestingLevel: 1))
+ $client = new SpyClient(transactionNestingLevel: 1)
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willReturnCursors(new StubCursor([['id' => 'abc']]))
->willFailExecute(2, QueryException::executionFailed('CLOSE c', PostgreSqlError::fromDiagnostics(
@@ -51,7 +51,7 @@ public function test_a_close_failure_never_replaces_the_read_failure(): void
public function test_a_declare_that_fails_inside_a_callers_transaction_closes_nothing(): void
{
- $client = (new SpyClient(transactionNestingLevel: 1))
+ $client = new SpyClient(transactionNestingLevel: 1)
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willFailExecute(1, QueryException::executionFailed('DECLARE c', PostgreSqlError::fromDiagnostics(
'42P01',
@@ -73,7 +73,7 @@ public function test_a_declare_that_fails_inside_a_callers_transaction_closes_no
public function test_a_failed_declare_rolls_back_its_own_transaction_and_rethrows_it(): void
{
$failure = QueryException::executionFailed('DECLARE c', PostgreSqlError::fromDiagnostics('42P01', 'x'));
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willFailExecute(1, $failure);
@@ -92,7 +92,7 @@ public function test_a_failed_declare_rolls_back_its_own_transaction_and_rethrow
public function test_a_failed_read_inside_a_callers_transaction_closes_its_cursor(): void
{
- $client = (new SpyClient(transactionNestingLevel: 1))
+ $client = new SpyClient(transactionNestingLevel: 1)
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willReturnCursors(new StubCursor([['id' => 'abc']]));
@@ -112,7 +112,7 @@ public function test_a_failed_read_inside_a_callers_transaction_closes_its_curso
public function test_a_failed_read_rolls_back_its_own_transaction_instead_of_committing(): void
{
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willReturnCursors(new StubCursor([['id' => 'abc']]));
@@ -129,7 +129,7 @@ public function test_a_failed_read_rolls_back_its_own_transaction_instead_of_com
public function test_a_failing_read_probes_once(): void
{
- $client = (new SpyClient())->willRefuseDescribe(QueryException::executionFailed(
+ $client = new SpyClient()->willRefuseDescribe(QueryException::executionFailed(
'SELECT id FROM t ORDER BY id',
PostgreSqlError::unknown('boom'),
));
@@ -163,7 +163,7 @@ public function test_a_non_select_statement_is_refused_before_any_round_trip():
public function test_a_rollback_failure_never_replaces_the_read_failure(): void
{
$failure = QueryException::executionFailed('DECLARE c', PostgreSqlError::fromDiagnostics('42P01', 'x'));
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willFailExecute(1, $failure)
->willFailRollBack(new RuntimeException('connection lost'));
@@ -192,10 +192,7 @@ public function test_a_declared_schema_wins_over_the_probe(): void
{
static::assertEquals(
schema(int_schema('id')),
- from_pgsql_cursor(
- (new SpyClient())->willDescribe(ColumnMother::of(['other' => 'text'])),
- 'SELECT id FROM t',
- )
+ from_pgsql_cursor(new SpyClient()->willDescribe(ColumnMother::of(['other' => 'text'])), 'SELECT id FROM t')
->withSchema(schema(int_schema('id')))
->schema(),
);
@@ -203,7 +200,7 @@ public function test_a_declared_schema_wins_over_the_probe(): void
public function test_cursor_loop_breaks_immediately_when_empty_result(): void
{
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willReturnCursors(new StubCursor());
@@ -219,7 +216,7 @@ public function test_cursor_loop_breaks_immediately_when_empty_result(): void
public function test_cursor_loop_breaks_when_rows_less_than_batch_size(): void
{
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willReturnCursors(new StubCursor([['id' => '1'], ['id' => '2']]));
@@ -229,7 +226,7 @@ public function test_cursor_loop_breaks_when_rows_less_than_batch_size(): void
public function test_cursor_loop_fetches_multiple_batches_when_needed(): void
{
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willReturnCursors(new StubCursor([['id' => '1'], ['id' => '2']]), new StubCursor([['id' => '3']]));
@@ -239,7 +236,7 @@ public function test_cursor_loop_fetches_multiple_batches_when_needed(): void
public function test_cursor_loop_with_exact_batch_size_multiple_does_extra_fetch(): void
{
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willReturnCursors(new StubCursor([['id' => '1'], ['id' => '2']]), new StubCursor());
@@ -249,7 +246,7 @@ public function test_cursor_loop_with_exact_batch_size_multiple_does_extra_fetch
public function test_extract_declares_and_closes_its_own_cursor_in_its_own_transaction(): void
{
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willReturnCursors(new StubCursor([['id' => '1']]));
@@ -265,7 +262,7 @@ public function test_extract_declares_and_closes_its_own_cursor_in_its_own_trans
public function test_extract_joins_a_callers_transaction_instead_of_opening_its_own(): void
{
- $client = (new SpyClient(transactionNestingLevel: 1))
+ $client = new SpyClient(transactionNestingLevel: 1)
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willReturnCursors(new StubCursor([['id' => '1']]));
@@ -284,7 +281,7 @@ public function test_extract_joins_a_callers_transaction_instead_of_opening_its_
public function test_extract_casts_an_array_column_through_the_derived_schema(): void
{
- static::assertSame(['a', 'b'], iterator_to_array(from_pgsql_cursor((new SpyClient())
+ static::assertSame(['a', 'b'], iterator_to_array(from_pgsql_cursor(new SpyClient()
->willDescribe(ColumnMother::of(['tags' => '_text']))
->willReturnCursors(new StubCursor([['tags' => [
'a',
@@ -294,7 +291,7 @@ public function test_extract_casts_an_array_column_through_the_derived_schema():
public function test_extract_casts_through_the_derived_schema(): void
{
- $rows = iterator_to_array(from_pgsql_cursor((new SpyClient())
+ $rows = iterator_to_array(from_pgsql_cursor(new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8', 'amount' => 'numeric']))
->willReturnCursors(new StubCursor([[
'id' => '1',
@@ -307,7 +304,7 @@ public function test_extract_casts_through_the_derived_schema(): void
public function test_extract_derives_the_schema_once_and_reuses_it_across_batches(): void
{
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willReturnCursors(new StubCursor([['id' => '1'], ['id' => '2']]), new StubCursor([['id' => '3']]));
@@ -325,7 +322,7 @@ public function test_extract_derives_the_schema_once_and_reuses_it_across_batche
public function test_extract_refuses_to_read_when_the_schema_cannot_be_derived(): void
{
- $client = (new SpyClient())->willDescribe(ColumnMother::of(['location' => 'point']));
+ $client = new SpyClient()->willDescribe(ColumnMother::of(['location' => 'point']));
$this->expectException(SchemaNotDerivableException::class);
$this->expectExceptionMessage('column "location" has PostgreSQL type "point", which Flow has no type for');
@@ -342,7 +339,7 @@ public function test_extract_refuses_to_read_when_the_schema_cannot_be_derived()
public function test_pushed_limit_issues_no_query_once_satisfied(): void
{
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willReturnCursors(
new StubCursor(array_map(static fn(int $id): array => ['id' => (string) $id], range(1, 1000))),
@@ -362,7 +359,7 @@ public function test_pushed_limit_issues_no_query_once_satisfied(): void
public function test_schema_is_derived_from_result_metadata(): void
{
$schema = from_pgsql_cursor(
- (new SpyClient())->willDescribe(ColumnMother::of(['id' => 'int8', 'label' => 'text'])),
+ new SpyClient()->willDescribe(ColumnMother::of(['id' => 'int8', 'label' => 'text'])),
'SELECT id, label FROM t',
)->schema();
@@ -372,7 +369,7 @@ public function test_schema_is_derived_from_result_metadata(): void
public function test_the_derived_schema_is_memoised(): void
{
- $client = (new SpyClient())->willDescribe(ColumnMother::of(['id' => 'int8']));
+ $client = new SpyClient()->willDescribe(ColumnMother::of(['id' => 'int8']));
$extractor = from_pgsql_cursor($client, 'SELECT id FROM t');
$extractor->schema();
@@ -448,7 +445,7 @@ public function test_is_repeatable(): void
public function test_statistics_are_the_planner_estimate_without_analyze(): void
{
- $client = (new SpyClient())->willExplain(42);
+ $client = new SpyClient()->willExplain(42);
static::assertEquals(
Cardinality::approximately(42),
@@ -462,7 +459,7 @@ public function test_statistics_are_the_planner_estimate_without_analyze(): void
public function test_statistics_are_explained_once(): void
{
- $client = (new SpyClient())->willExplain(42);
+ $client = new SpyClient()->willExplain(42);
$extractor = from_pgsql_cursor($client, 'SELECT * FROM t WHERE id > $1', [1]);
static::assertSame($extractor->statistics(), $extractor->statistics());
@@ -472,7 +469,7 @@ public function test_statistics_are_explained_once(): void
public function test_a_maximum_bounds_and_caps_the_estimate_and_a_new_one_drops_the_statistics(): void
{
$extractor = from_pgsql_cursor(
- (new SpyClient())->willExplain(42),
+ new SpyClient()->willExplain(42),
'SELECT * FROM t WHERE id > $1',
[1],
)->withMaximum(10);
@@ -492,7 +489,7 @@ public function test_a_maximum_bounds_and_caps_the_estimate_and_a_new_one_drops_
public function test_extract_builds_through_the_config_backend(): void
{
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willReturnCursors(new StubCursor([['id' => '1']]), new StubCursor());
$backend = new SpyBackend();
diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlKeySetExtractorTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlKeySetExtractorTest.php
index c06e65bdaa..910e4201f1 100644
--- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlKeySetExtractorTest.php
+++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlKeySetExtractorTest.php
@@ -99,7 +99,7 @@ public static function null_keys(): Generator
public function test_a_failing_read_probes_once(): void
{
- $client = (new SpyClient())->willRefuseDescribe(QueryException::executionFailed(
+ $client = new SpyClient()->willRefuseDescribe(QueryException::executionFailed(
'SELECT id FROM t ORDER BY id',
PostgreSqlError::unknown('boom'),
));
@@ -142,7 +142,7 @@ public function test_a_non_select_statement_is_refused_before_any_round_trip():
public function test_every_page_sends_the_same_sql_with_new_parameters(): void
{
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willReturnCursors(
new StubCursor([['id' => '1'], ['id' => '2'], ['id' => '3']]),
@@ -197,7 +197,7 @@ public function test_a_declared_schema_wins_over_the_probe(): void
static::assertEquals(
schema(int_schema('id')),
from_pgsql_key_set(
- (new SpyClient())->willDescribe(ColumnMother::of(['other' => 'text'])),
+ new SpyClient()->willDescribe(ColumnMother::of(['other' => 'text'])),
'SELECT id FROM t',
pgsql_pagination_key_set(pgsql_pagination_key_asc('id')),
)
@@ -209,7 +209,7 @@ public function test_a_declared_schema_wins_over_the_probe(): void
public function test_extract_casts_through_the_derived_schema(): void
{
$rows = iterator_to_array(from_pgsql_key_set(
- (new SpyClient())
+ new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8', 'amount' => 'numeric']))
->willReturnCursors(new StubCursor([['id' => '1', 'amount' => '10.5']]), new StubCursor()),
'SELECT id, amount FROM t',
@@ -222,7 +222,7 @@ public function test_extract_casts_through_the_derived_schema(): void
public function test_extract_derives_the_schema_once_and_reuses_it_across_batches(): void
{
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willReturnCursors(
new StubCursor([['id' => '1'], ['id' => '2'], ['id' => '3']]),
@@ -245,7 +245,7 @@ public function test_extract_derives_the_schema_once_and_reuses_it_across_batche
public function test_extract_refuses_to_read_when_the_schema_cannot_be_derived(): void
{
- $client = (new SpyClient())->willDescribe(ColumnMother::of(['location' => 'point']));
+ $client = new SpyClient()->willDescribe(ColumnMother::of(['location' => 'point']));
$this->expectException(SchemaNotDerivableException::class);
$this->expectExceptionMessage('column "location" has PostgreSQL type "point", which Flow has no type for');
@@ -264,7 +264,7 @@ public function test_extract_refuses_to_read_when_the_schema_cannot_be_derived()
public function test_schema_is_derived_from_result_metadata(): void
{
$schema = from_pgsql_key_set(
- (new SpyClient())->willDescribe(ColumnMother::of(['id' => 'int8', 'label' => 'text'])),
+ new SpyClient()->willDescribe(ColumnMother::of(['id' => 'int8', 'label' => 'text'])),
'SELECT id, label FROM t',
pgsql_pagination_key_set(pgsql_pagination_key_asc('id')),
)->schema();
@@ -275,7 +275,7 @@ public function test_schema_is_derived_from_result_metadata(): void
public function test_the_derived_schema_is_memoised(): void
{
- $client = (new SpyClient())->willDescribe(ColumnMother::of(['id' => 'int8']));
+ $client = new SpyClient()->willDescribe(ColumnMother::of(['id' => 'int8']));
$extractor = from_pgsql_key_set(
$client,
'SELECT id FROM t',
@@ -371,7 +371,7 @@ public function test_with_batch_size_validates_positive_value(): void
public function test_pushed_limit_issues_no_query_once_satisfied(): void
{
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willReturnCursors(
new StubCursor(array_map(static fn(int $id): array => ['id' => (string) $id], range(1, 1001))),
@@ -400,7 +400,7 @@ public function test_is_repeatable(): void
public function test_statistics_are_the_planner_estimate_without_analyze(): void
{
- $client = (new SpyClient())->willExplain(42);
+ $client = new SpyClient()->willExplain(42);
static::assertEquals(
Cardinality::approximately(42),
@@ -419,7 +419,7 @@ public function test_statistics_are_the_planner_estimate_without_analyze(): void
public function test_statistics_are_explained_once(): void
{
- $client = (new SpyClient())->willExplain(42);
+ $client = new SpyClient()->willExplain(42);
$extractor = from_pgsql_key_set(
$client,
'SELECT * FROM t WHERE id > $1',
@@ -434,7 +434,7 @@ public function test_statistics_are_explained_once(): void
public function test_a_maximum_bounds_and_caps_the_estimate_and_a_new_one_drops_the_statistics(): void
{
$extractor = from_pgsql_key_set(
- (new SpyClient())->willExplain(42),
+ new SpyClient()->willExplain(42),
'SELECT * FROM t WHERE id > $1',
pgsql_pagination_key_set(pgsql_pagination_key_asc('id')),
[1],
@@ -455,7 +455,7 @@ public function test_a_maximum_bounds_and_caps_the_estimate_and_a_new_one_drops_
public function test_extract_builds_through_the_config_backend(): void
{
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willReturnCursors(new StubCursor([['id' => '1']]), new StubCursor());
$backend = new SpyBackend();
@@ -592,7 +592,7 @@ public function test_exact_multiple_ends_without_an_empty_page(): void
#[DataProvider('null_checks')]
public function test_null_check_runs_before_the_first_page(string $query, KeySet $keySet, string $nullCheck): void
{
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8', 'created_at' => 'int8']))
->willReturnCursors(
new StubCursor([
@@ -615,7 +615,7 @@ public function test_null_check_runs_before_the_first_page(string $query, KeySet
public function test_null_key_throws_before_any_page(): void
{
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willFindNullKey();
diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlLimitOffsetExtractorTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlLimitOffsetExtractorTest.php
index 30d435c834..4485dbb6cb 100644
--- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlLimitOffsetExtractorTest.php
+++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlLimitOffsetExtractorTest.php
@@ -32,7 +32,7 @@ final class PostgreSqlLimitOffsetExtractorTest extends FlowTestCase
{
public function test_a_failing_read_probes_once(): void
{
- $client = (new SpyClient())->willRefuseDescribe(QueryException::executionFailed(
+ $client = new SpyClient()->willRefuseDescribe(QueryException::executionFailed(
'SELECT id FROM t ORDER BY id',
PostgreSqlError::unknown('boom'),
));
@@ -97,7 +97,7 @@ public function test_an_empty_page_is_not_yielded(): void
[5],
array_map(
static fn(Rows $rows): int => $rows->count(),
- iterator_to_array(from_pgsql_limit_offset((new SpyClient())
+ iterator_to_array(from_pgsql_limit_offset(new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willReturnCursors(new StubCursor([
['id' => '1'],
@@ -126,7 +126,7 @@ public function test_a_declared_schema_wins_over_the_probe(): void
static::assertEquals(
schema(int_schema('id')),
from_pgsql_limit_offset(
- (new SpyClient())->willDescribe(ColumnMother::of(['other' => 'text'])),
+ new SpyClient()->willDescribe(ColumnMother::of(['other' => 'text'])),
'SELECT id FROM t ORDER BY id',
)
->withSchema(schema(int_schema('id')))
@@ -136,7 +136,7 @@ public function test_a_declared_schema_wins_over_the_probe(): void
public function test_every_page_sends_the_same_sql_with_new_parameters(): void
{
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willCountTotal(3)
->willReturnCursors(new StubCursor([['id' => '1'], ['id' => '2']]), new StubCursor([['id' => '3']]));
@@ -157,7 +157,7 @@ public function test_every_page_sends_the_same_sql_with_new_parameters(): void
public function test_extract_casts_through_the_derived_schema(): void
{
- $rows = iterator_to_array(from_pgsql_limit_offset((new SpyClient())
+ $rows = iterator_to_array(from_pgsql_limit_offset(new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8', 'amount' => 'numeric']))
->willCountTotal(1)
->willReturnCursors(new StubCursor([[
@@ -171,7 +171,7 @@ public function test_extract_casts_through_the_derived_schema(): void
public function test_extract_derives_the_schema_once_and_reuses_it_across_batches(): void
{
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willCountTotal(3)
->willReturnCursors(new StubCursor([['id' => '1'], ['id' => '2']]), new StubCursor([['id' => '3']]));
@@ -188,7 +188,7 @@ public function test_extract_derives_the_schema_once_and_reuses_it_across_batche
public function test_extract_refuses_to_read_when_the_schema_cannot_be_derived(): void
{
- $client = (new SpyClient())->willDescribe(ColumnMother::of(['location' => 'point']));
+ $client = new SpyClient()->willDescribe(ColumnMother::of(['location' => 'point']));
$this->expectException(SchemaNotDerivableException::class);
$this->expectExceptionMessage('column "location" has PostgreSQL type "point", which Flow has no type for');
@@ -208,7 +208,7 @@ public function test_extract_refuses_to_read_when_the_schema_cannot_be_derived()
public function test_schema_is_derived_from_result_metadata(): void
{
$schema = from_pgsql_limit_offset(
- (new SpyClient())->willDescribe(ColumnMother::of(['id' => 'int8', 'label' => 'text'])),
+ new SpyClient()->willDescribe(ColumnMother::of(['id' => 'int8', 'label' => 'text'])),
'SELECT id, label FROM t ORDER BY id',
)->schema();
@@ -218,7 +218,7 @@ public function test_schema_is_derived_from_result_metadata(): void
public function test_the_derived_schema_is_memoised(): void
{
- $client = (new SpyClient())->willDescribe(ColumnMother::of(['id' => 'int8']));
+ $client = new SpyClient()->willDescribe(ColumnMother::of(['id' => 'int8']));
$extractor = from_pgsql_limit_offset($client, 'SELECT id FROM t ORDER BY id');
$extractor->schema();
@@ -292,7 +292,7 @@ public function test_with_batch_size_validates_positive_value(): void
public function test_pushed_limit_skips_the_count_query(): void
{
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willCountTotal(1000)
->willReturnCursors(new StubCursor([['id' => '1'], ['id' => '2']]), new StubCursor([['id' => '3']]));
@@ -308,7 +308,7 @@ public function test_pushed_limit_skips_the_count_query(): void
public function test_stops_issuing_pages_when_a_page_comes_back_short(): void
{
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willReturnCursors(new StubCursor([['id' => '1'], ['id' => '2']]), new StubCursor([['id' => '3']]));
@@ -327,7 +327,7 @@ public function test_is_repeatable(): void
public function test_statistics_are_the_planner_estimate_without_analyze(): void
{
- $client = (new SpyClient())->willExplain(42);
+ $client = new SpyClient()->willExplain(42);
static::assertEquals(
Cardinality::approximately(42),
@@ -341,7 +341,7 @@ public function test_statistics_are_the_planner_estimate_without_analyze(): void
public function test_statistics_are_explained_once(): void
{
- $client = (new SpyClient())->willExplain(42);
+ $client = new SpyClient()->willExplain(42);
$extractor = from_pgsql_limit_offset($client, 'SELECT * FROM t WHERE id > $1', [1]);
static::assertSame($extractor->statistics(), $extractor->statistics());
@@ -351,7 +351,7 @@ public function test_statistics_are_explained_once(): void
public function test_a_maximum_bounds_and_caps_the_estimate_and_a_new_one_drops_the_statistics(): void
{
$extractor = from_pgsql_limit_offset(
- (new SpyClient())->willExplain(42),
+ new SpyClient()->willExplain(42),
'SELECT * FROM t WHERE id > $1',
[1],
)->withMaximum(10);
@@ -371,7 +371,7 @@ public function test_a_maximum_bounds_and_caps_the_estimate_and_a_new_one_drops_
public function test_extract_builds_through_the_config_backend(): void
{
- $client = (new SpyClient())
+ $client = new SpyClient()
->willDescribe(ColumnMother::of(['id' => 'int8']))
->willCountTotal(1)
->willReturnCursors(new StubCursor([['id' => '1']]));
diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/ResultSchemaTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/ResultSchemaTest.php
index a122e15008..6444a8bb08 100644
--- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/ResultSchemaTest.php
+++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/ResultSchemaTest.php
@@ -100,9 +100,9 @@ protected function setUp(): void
public function test_every_mapped_postgresql_type_becomes_a_nullable_definition(string $type): void
{
static::assertTrue(
- (new ResultSchema())
+ new ResultSchema()
->of(
- (new SpyClient())->willDescribe(ColumnMother::of(['value' => $type])),
+ new SpyClient()->willDescribe(ColumnMother::of(['value' => $type])),
ReadQuery::of('SELECT value FROM t', self::class),
[],
self::class,
@@ -121,8 +121,8 @@ public function test_an_unmapped_postgresql_type_is_refused(string $type): void
$type,
));
- (new ResultSchema())->of(
- (new SpyClient())->willDescribe(ColumnMother::of(['value' => $type])),
+ new ResultSchema()->of(
+ new SpyClient()->willDescribe(ColumnMother::of(['value' => $type])),
ReadQuery::of('SELECT value FROM t', self::class),
[],
self::class,
@@ -134,9 +134,9 @@ public function test_a_multi_dimensional_array_column_is_typed_one_dimensional()
// The element type admits null because a pg array may hold SQL NULLs.
static::assertEquals(
type_list(type_optional(type_integer())),
- (new ResultSchema())
+ new ResultSchema()
->of(
- (new SpyClient())->willDescribe(ColumnMother::of(['tags' => '_int4'])),
+ new SpyClient()->willDescribe(ColumnMother::of(['tags' => '_int4'])),
ReadQuery::of('SELECT tags FROM t', self::class),
[],
self::class,
@@ -154,8 +154,8 @@ public function test_a_refused_probe_becomes_a_schema_not_derivable_exception():
);
try {
- (new ResultSchema())->of(
- (new SpyClient())->willRefuseDescribe($refused),
+ new ResultSchema()->of(
+ new SpyClient()->willRefuseDescribe($refused),
ReadQuery::of('SELECT 1;;', self::class),
[],
self::class,
@@ -176,15 +176,15 @@ public function test_a_refused_probe_becomes_a_schema_not_derivable_exception():
public function test_a_rethrown_database_error_inside_an_open_transaction_rolls_back_to_the_savepoint(): void
{
- $client = (new SpyClient(
+ $client = new SpyClient(
transactionNestingLevel: 1,
- ))->willRefuseDescribe(QueryException::executionFailed('SELECT id FROM t', PostgreSqlError::fromDiagnostics(
+ )->willRefuseDescribe(QueryException::executionFailed('SELECT id FROM t', PostgreSqlError::fromDiagnostics(
'42P01',
'relation "t" does not exist',
)));
try {
- (new ResultSchema())->of($client, ReadQuery::of('SELECT id FROM t', self::class), [], self::class);
+ new ResultSchema()->of($client, ReadQuery::of('SELECT id FROM t', self::class), [], self::class);
} catch (QueryException) {
}
@@ -197,8 +197,8 @@ public function test_a_query_naming_a_missing_object_rethrows_the_database_error
$refused = QueryException::executionFailed('SELECT id FROM t', PostgreSqlError::fromDiagnostics($state, 'x'));
try {
- (new ResultSchema())->of(
- (new SpyClient())->willRefuseDescribe($refused),
+ new ResultSchema()->of(
+ new SpyClient()->willRefuseDescribe($refused),
ReadQuery::of('SELECT id FROM t', self::class),
[],
self::class,
@@ -211,13 +211,13 @@ public function test_a_query_naming_a_missing_object_rethrows_the_database_error
public function test_a_refused_probe_inside_an_open_transaction_rolls_back_to_the_savepoint(): void
{
- $client = (new SpyClient(transactionNestingLevel: 1))->willRefuseDescribe(QueryException::executionFailed(
+ $client = new SpyClient(transactionNestingLevel: 1)->willRefuseDescribe(QueryException::executionFailed(
'SELECT 1;;',
PostgreSqlError::unknown('syntax error'),
));
try {
- (new ResultSchema())->of($client, ReadQuery::of('SELECT 1;;', self::class), [], self::class);
+ new ResultSchema()->of($client, ReadQuery::of('SELECT 1;;', self::class), [], self::class);
} catch (SchemaNotDerivableException) {
}
@@ -226,27 +226,27 @@ public function test_a_refused_probe_inside_an_open_transaction_rolls_back_to_th
public function test_a_savepoint_wraps_the_probe_inside_an_open_transaction(): void
{
- $nested = (new SpyClient(transactionNestingLevel: 1))->willDescribe(ColumnMother::of(['id' => 'int8']));
- (new ResultSchema())->of($nested, ReadQuery::of('SELECT id FROM t', self::class), [], self::class);
+ $nested = new SpyClient(transactionNestingLevel: 1)->willDescribe(ColumnMother::of(['id' => 'int8']));
+ new ResultSchema()->of($nested, ReadQuery::of('SELECT id FROM t', self::class), [], self::class);
// Rolled back, not committed: the probe is a read-only LIMIT 0, so discarding the savepoint
// is equivalent and closes every failure path with one unconditional finally.
static::assertSame(['beginTransaction', 'describe', 'rollBack'], $nested->calls);
- $topLevel = (new SpyClient())->willDescribe(ColumnMother::of(['id' => 'int8']));
- (new ResultSchema())->of($topLevel, ReadQuery::of('SELECT id FROM t', self::class), [], self::class);
+ $topLevel = new SpyClient()->willDescribe(ColumnMother::of(['id' => 'int8']));
+ new ResultSchema()->of($topLevel, ReadQuery::of('SELECT id FROM t', self::class), [], self::class);
static::assertSame(['describe'], $topLevel->calls);
}
public function test_a_savepoint_is_released_when_describe_throws_something_other_than_a_query_exception(): void
{
- $client = (new SpyClient(transactionNestingLevel: 1))->willThrowFromDescribe(
+ $client = new SpyClient(transactionNestingLevel: 1)->willThrowFromDescribe(
new RuntimeException('parser blew up'),
);
try {
- (new ResultSchema())->of($client, ReadQuery::of('SELECT id FROM t', self::class), [], self::class);
+ new ResultSchema()->of($client, ReadQuery::of('SELECT id FROM t', self::class), [], self::class);
static::fail('the throwable should propagate');
} catch (RuntimeException $e) {
static::assertSame('parser blew up', $e->getMessage());
@@ -257,8 +257,8 @@ public function test_a_savepoint_is_released_when_describe_throws_something_othe
public function test_duplicate_output_names_collapse_last_wins(): void
{
- $schema = (new ResultSchema())->of(
- (new SpyClient())->willDescribe([ColumnMother::pair('a', 'int8'), ColumnMother::pair('a', 'text')]),
+ $schema = new ResultSchema()->of(
+ new SpyClient()->willDescribe([ColumnMother::pair('a', 'int8'), ColumnMother::pair('a', 'text')]),
ReadQuery::of('SELECT id AS a, label AS a FROM t', self::class),
[],
self::class,
@@ -270,9 +270,9 @@ public function test_duplicate_output_names_collapse_last_wins(): void
public function test_the_probe_never_receives_the_callers_values(): void
{
- $client = (new SpyClient())->willDescribe(ColumnMother::of(['id' => 'int8']));
+ $client = new SpyClient()->willDescribe(ColumnMother::of(['id' => 'int8']));
- (new ResultSchema())->of(
+ new ResultSchema()->of(
$client,
ReadQuery::of('SELECT id FROM t WHERE id > $1', self::class),
[42],
diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/HTMLConverterTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/HTMLConverterTest.php
index ac5dc1b18f..7181dc0b4c 100644
--- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/HTMLConverterTest.php
+++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/HTMLConverterTest.php
@@ -10,8 +10,6 @@
use Flow\PostgreSql\Client\Types\ValueType;
use PHPUnit\Framework\TestCase;
-use function class_exists;
-
final class HTMLConverterTest extends TestCase
{
public function test_delegates_string_to_next_converter(): void
@@ -23,13 +21,8 @@ public function test_delegates_string_to_next_converter(): void
public function test_html_document_returns_html_string(): void
{
- if (!class_exists(HTMLDocument::class)) {
- static::markTestSkipped('Dom\HTMLDocument requires PHP 8.4+');
- }
-
$converter = new HTMLConverter();
- // @mago-ignore analysis:unavailable-method
$doc = HTMLDocument::createFromString('Hello
');
$result = $converter->toDatabase($doc);
@@ -39,13 +32,8 @@ public function test_html_document_returns_html_string(): void
public function test_html_element_returns_html_string(): void
{
- if (!class_exists(HTMLDocument::class)) {
- static::markTestSkipped('Dom\HTMLDocument requires PHP 8.4+');
- }
-
$converter = new HTMLConverter();
- // @mago-ignore analysis:unavailable-method
$doc = HTMLDocument::createFromString('Hello
');
$element = $doc->getElementById('test');
diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/PostgreSqlEncoderTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/PostgreSqlEncoderTest.php
index 20b07b8ae7..d54c31f55c 100644
--- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/PostgreSqlEncoderTest.php
+++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/PostgreSqlEncoderTest.php
@@ -22,7 +22,7 @@ public function test_encode_returns_each_row_as_its_value_map(): void
{
static::assertSame(
[['id' => 1, 'name' => 'Norbert'], ['id' => 2, 'name' => null]],
- (new PostgreSqlEncoder())->encode(array_to_rows(
+ new PostgreSqlEncoder()->encode(array_to_rows(
[['id' => 1, 'name' => 'Norbert'], ['id' => 2, 'name' => null]],
schema(int_schema('id'), str_schema('name', nullable: true)),
)),
@@ -33,7 +33,7 @@ public function test_encode_returns_the_original_value_maps(): void
{
static::assertSame(
[['id' => 1, 'active' => true], ['id' => 2, 'active' => false]],
- (new PostgreSqlEncoder())->encode(array_to_rows(
+ new PostgreSqlEncoder()->encode(array_to_rows(
[['id' => 1, 'active' => true], ['id' => 2, 'active' => false]],
schema(int_schema('id'), bool_schema('active')),
)),
@@ -42,14 +42,14 @@ public function test_encode_returns_the_original_value_maps(): void
public function test_encode_of_an_empty_batch_returns_empty(): void
{
- static::assertSame([], (new PostgreSqlEncoder())->encode(array_to_rows([], schema(int_schema('id')))));
+ static::assertSame([], new PostgreSqlEncoder()->encode(array_to_rows([], schema(int_schema('id')))));
}
public function test_columns_returns_every_columns_values_in_schema_order(): void
{
static::assertSame(
['id' => [1, 2], 'name' => ['a', null]],
- (new PostgreSqlEncoder())->columns(array_to_rows(
+ new PostgreSqlEncoder()->columns(array_to_rows(
[['id' => 1, 'name' => 'a'], ['id' => 2, 'name' => null]],
schema(int_schema('id'), str_schema('name', nullable: true)),
)),
@@ -63,7 +63,7 @@ public function test_columns_render_markup_from_the_physicals(): void
static::assertSame(
['x' => [''], 'e' => ['']],
- (new PostgreSqlEncoder())->columns(array_to_rows(
+ new PostgreSqlEncoder()->columns(array_to_rows(
[['x' => $document, 'e' => $document->getElementsByTagName('a')->item(0)]],
schema(xml_schema('x'), xml_element_schema('e')),
)),
diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/PostgreSqlLoaderTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/PostgreSqlLoaderTest.php
index 9ed14f8be1..bf17222304 100644
--- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/PostgreSqlLoaderTest.php
+++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/PostgreSqlLoaderTest.php
@@ -27,7 +27,7 @@ final class PostgreSqlLoaderTest extends TestCase
{
public function test_its_collection_is_the_table(): void
{
- static::assertSame('contacts', (new PostgreSqlLoader(new SpyClient(), 'contacts'))->collection());
+ static::assertSame('contacts', new PostgreSqlLoader(new SpyClient(), 'contacts')->collection());
}
public function test_load_delete_requires_delete_options(): void
@@ -93,19 +93,19 @@ public function test_a_chunked_insert_joins_a_callers_transaction(): void
$client = new SpyClient(transactionNestingLevel: 1);
// 70 columns x 1000 rows: 936 rows fit under the cap, so the INSERT is two statements
- (new PostgreSqlLoader($client, 'wide'))->load(WideRowsMother::of(70, 1000), flow_context()->backend());
+ new PostgreSqlLoader($client, 'wide')->load(WideRowsMother::of(70, 1000), flow_context()->backend());
static::assertSame(['execute', 'execute'], $client->calls);
}
public function test_a_failing_chunk_rolls_back_the_transaction_the_loader_opened(): void
{
- $client = (new SpyClient())->willFailExecute(2, new LogicException('second statement failed'));
+ $client = new SpyClient()->willFailExecute(2, new LogicException('second statement failed'));
$thrown = null;
try {
- (new PostgreSqlLoader($client, 'wide'))->load(WideRowsMother::of(70, 1000), flow_context()->backend());
+ new PostgreSqlLoader($client, 'wide')->load(WideRowsMother::of(70, 1000), flow_context()->backend());
} catch (LogicException $e) {
$thrown = $e;
}
@@ -118,14 +118,14 @@ public function test_a_chunked_insert_commits_the_transaction_the_loader_opened(
{
$client = new SpyClient();
- (new PostgreSqlLoader($client, 'wide'))->load(WideRowsMother::of(70, 1000), flow_context()->backend());
+ new PostgreSqlLoader($client, 'wide')->load(WideRowsMother::of(70, 1000), flow_context()->backend());
static::assertSame(['beginTransaction', 'execute', 'execute', 'commit'], $client->calls);
}
public function test_a_failing_chunk_leaves_the_callers_transaction_to_the_caller(): void
{
- $client = (new SpyClient(transactionNestingLevel: 1))->willFailExecute(
+ $client = new SpyClient(transactionNestingLevel: 1)->willFailExecute(
2,
new LogicException('second statement failed'),
);
@@ -133,7 +133,7 @@ public function test_a_failing_chunk_leaves_the_callers_transaction_to_the_calle
$thrown = null;
try {
- (new PostgreSqlLoader($client, 'wide'))->load(WideRowsMother::of(70, 1000), flow_context()->backend());
+ new PostgreSqlLoader($client, 'wide')->load(WideRowsMother::of(70, 1000), flow_context()->backend());
} catch (LogicException $e) {
$thrown = $e;
}
@@ -147,7 +147,7 @@ public function test_an_insert_that_exactly_fits_is_one_statement_without_a_tran
$client = new SpyClient();
// 70 columns x 936 rows = 65 520 parameters, the most one statement can carry
- (new PostgreSqlLoader($client, 'wide'))->load(WideRowsMother::of(70, 936), flow_context()->backend());
+ new PostgreSqlLoader($client, 'wide')->load(WideRowsMother::of(70, 936), flow_context()->backend());
static::assertSame(['execute'], $client->calls);
}
diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/PostgreSqlTransactionTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/PostgreSqlTransactionTest.php
index dd53725218..cfd41941a7 100644
--- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/PostgreSqlTransactionTest.php
+++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/PostgreSqlTransactionTest.php
@@ -21,7 +21,7 @@ public function test_begin_opens_a_transaction_without_setting_an_isolation_leve
$client->expects(self::once())->method('beginTransaction');
$client->expects(self::never())->method('execute');
- (new PostgreSqlTransaction($client))->begin();
+ new PostgreSqlTransaction($client)->begin();
}
public function test_begin_sets_the_isolation_level_inside_the_transaction(): void
@@ -37,7 +37,7 @@ public function test_begin_sets_the_isolation_level_inside_the_transaction(): vo
))
->willReturn(0);
- (new PostgreSqlTransaction($client))
+ new PostgreSqlTransaction($client)
->withIsolationLevel(IsolationLevel::SERIALIZABLE)
->begin();
}
@@ -52,7 +52,7 @@ public function test_a_failing_isolation_level_closes_the_transaction_begin_open
$this->expectExceptionObject($failure);
- (new PostgreSqlTransaction($client))
+ new PostgreSqlTransaction($client)
->withIsolationLevel(IsolationLevel::SERIALIZABLE)
->begin();
}
@@ -62,7 +62,7 @@ public function test_commit_commits(): void
$client = $this->createMock(Client::class);
$client->expects(self::once())->method('commit');
- (new PostgreSqlTransaction($client))->commit();
+ new PostgreSqlTransaction($client)->commit();
}
public function test_rollback_rolls_back_and_suppresses_its_own_failure(): void
@@ -70,7 +70,7 @@ public function test_rollback_rolls_back_and_suppresses_its_own_failure(): void
$client = $this->createMock(Client::class);
$client->expects(self::once())->method('rollBack')->willThrowException(new RuntimeException('rollback failed'));
- (new PostgreSqlTransaction($client))->rollback(new RuntimeException('load failed'));
+ new PostgreSqlTransaction($client)->rollback(new RuntimeException('load failed'));
}
public function test_with_isolation_level_returns_a_new_instance(): void
diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/QueryBuilder/InsertQueryBuilderTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/QueryBuilder/InsertQueryBuilderTest.php
index 5be6ac64c5..07e1c686e8 100644
--- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/QueryBuilder/InsertQueryBuilderTest.php
+++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/QueryBuilder/InsertQueryBuilderTest.php
@@ -20,7 +20,7 @@ final class InsertQueryBuilderTest extends TestCase
{
public function test_build_converts_each_value_with_its_columns_converter(): void
{
- [$_query, $params] = (new InsertQueryBuilder('users', new TypesMap()))->build(
+ [$_query, $params] = new InsertQueryBuilder('users', new TypesMap())->build(
['id' => [1, 2], 'name' => ['Alice', 'Bob'], 'active' => [true, false]],
2,
schema(int_schema('id'), str_schema('name'), bool_schema('active')),
@@ -32,7 +32,7 @@ public function test_build_converts_each_value_with_its_columns_converter(): voi
public function test_build_simple_insert(): void
{
- [$query, $params] = (new InsertQueryBuilder('users', new TypesMap()))->build(
+ [$query, $params] = new InsertQueryBuilder('users', new TypesMap())->build(
['id' => [1, 2], 'name' => ['Alice', 'Bob']],
2,
schema(int_schema('id'), str_schema('name')),
@@ -47,7 +47,7 @@ public function test_build_simple_insert(): void
public function test_build_with_null_values(): void
{
- [$_query, $params] = (new InsertQueryBuilder('users', new TypesMap()))->build(
+ [$_query, $params] = new InsertQueryBuilder('users', new TypesMap())->build(
['id' => [1], 'name' => [null]],
1,
schema(int_schema('id'), str_schema('name', nullable: true)),
@@ -59,7 +59,7 @@ public function test_build_with_null_values(): void
public function test_build_with_skip_conflicts(): void
{
- [$query, $_params] = (new InsertQueryBuilder('users', new TypesMap()))->build(
+ [$query, $_params] = new InsertQueryBuilder('users', new TypesMap())->build(
['id' => [1], 'name' => ['Alice']],
1,
schema(int_schema('id'), str_schema('name')),
@@ -72,7 +72,7 @@ public function test_build_with_skip_conflicts(): void
public function test_build_with_upsert_on_columns(): void
{
- [$query, $_params] = (new InsertQueryBuilder('users', new TypesMap()))->build(
+ [$query, $_params] = new InsertQueryBuilder('users', new TypesMap())->build(
['id' => [1], 'name' => ['Alice']],
1,
schema(int_schema('id'), str_schema('name')),
@@ -87,7 +87,7 @@ public function test_build_with_upsert_on_columns(): void
public function test_build_with_upsert_on_constraint(): void
{
- [$query, $_params] = (new InsertQueryBuilder('users', new TypesMap()))->build(
+ [$query, $_params] = new InsertQueryBuilder('users', new TypesMap())->build(
['id' => [1], 'name' => ['Alice']],
1,
schema(int_schema('id'), str_schema('name')),
@@ -105,7 +105,7 @@ public function test_build_refuses_a_column_of_another_length(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Column "name" holds 1 values, the insert 2 rows');
- (new InsertQueryBuilder('users', new TypesMap()))->build(
+ new InsertQueryBuilder('users', new TypesMap())->build(
['id' => [1, 2], 'name' => ['Alice']],
2,
schema(int_schema('id'), str_schema('name')),
diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/Values/Schema/SchemaConverterTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/Values/Schema/SchemaConverterTest.php
index f18787e69d..2a0eb837e1 100644
--- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/Values/Schema/SchemaConverterTest.php
+++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/Values/Schema/SchemaConverterTest.php
@@ -46,7 +46,7 @@ final class SchemaConverterTest extends TestCase
{
public function test_composite_primary_key(): void
{
- $table = (new SchemaConverter())->toPostgreSqlTable(
+ $table = new SchemaConverter()->toPostgreSqlTable(
schema(
int_schema('order_id', metadata: PostgreSqlMetadata::primaryKey('pk_order_item')),
int_schema('item_id', metadata: PostgreSqlMetadata::primaryKey('pk_order_item')),
@@ -62,7 +62,7 @@ public function test_composite_primary_key(): void
public function test_default_value(): void
{
- $table = (new SchemaConverter())->toPostgreSqlTable(
+ $table = new SchemaConverter()->toPostgreSqlTable(
schema(bool_schema('active', metadata: PostgreSqlMetadata::default(true))),
'flags',
);
@@ -74,12 +74,12 @@ public function test_empty_schema_throws(): void
{
$this->expectException(RuntimeException::class);
- (new SchemaConverter())->toPostgreSqlTable(schema(), 'empty');
+ new SchemaConverter()->toPostgreSqlTable(schema(), 'empty');
}
public function test_explicit_type_override(): void
{
- $table = (new SchemaConverter())->toPostgreSqlTable(
+ $table = new SchemaConverter()->toPostgreSqlTable(
schema(str_schema('payload', metadata: PostgreSqlMetadata::type('jsonb'))),
'events',
);
@@ -89,7 +89,7 @@ public function test_explicit_type_override(): void
public function test_forward_maps_scalar_types(): void
{
- $table = (new SchemaConverter())->toPostgreSqlTable(
+ $table = new SchemaConverter()->toPostgreSqlTable(
schema(
int_schema('id'),
str_schema('name'),
@@ -115,7 +115,7 @@ public function test_forward_maps_scalar_types(): void
public function test_generated_column(): void
{
- $table = (new SchemaConverter())->toPostgreSqlTable(
+ $table = new SchemaConverter()->toPostgreSqlTable(
schema(int_schema('total', metadata: PostgreSqlMetadata::generated('price * quantity'))),
'line_items',
);
@@ -126,7 +126,7 @@ public function test_generated_column(): void
public function test_identity_column(): void
{
- $table = (new SchemaConverter())->toPostgreSqlTable(
+ $table = new SchemaConverter()->toPostgreSqlTable(
schema(int_schema('id', metadata: PostgreSqlMetadata::identity(IdentityGeneration::BY_DEFAULT))),
'users',
);
@@ -137,7 +137,7 @@ public function test_identity_column(): void
public function test_length_produces_varchar(): void
{
- $table = (new SchemaConverter())->toPostgreSqlTable(
+ $table = new SchemaConverter()->toPostgreSqlTable(
schema(str_schema('name', metadata: PostgreSqlMetadata::length(120))),
'users',
);
@@ -147,7 +147,7 @@ public function test_length_produces_varchar(): void
public function test_named_index(): void
{
- $table = (new SchemaConverter())->toPostgreSqlTable(
+ $table = new SchemaConverter()->toPostgreSqlTable(
schema(str_schema('email', metadata: PostgreSqlMetadata::index('idx_email'))),
'users',
);
@@ -160,7 +160,7 @@ public function test_named_index(): void
public function test_index_explicit_position_overrides_schema_order(): void
{
- $table = (new SchemaConverter())->toPostgreSqlTable(
+ $table = new SchemaConverter()->toPostgreSqlTable(
schema(
int_schema('id', metadata: PostgreSqlMetadata::index('idx', 2)),
datetime_schema('created_at', metadata: PostgreSqlMetadata::index('idx', 1)),
@@ -175,7 +175,7 @@ public function test_index_explicit_position_overrides_schema_order(): void
public function test_composite_index_without_positions_preserves_schema_order(): void
{
- $table = (new SchemaConverter())->toPostgreSqlTable(
+ $table = new SchemaConverter()->toPostgreSqlTable(
schema(
int_schema('id', metadata: PostgreSqlMetadata::index('idx')),
datetime_schema('created_at', metadata: PostgreSqlMetadata::index('idx')),
@@ -188,7 +188,7 @@ public function test_composite_index_without_positions_preserves_schema_order():
public function test_composite_unique_with_positions_is_ordered(): void
{
- $table = (new SchemaConverter())->toPostgreSqlTable(
+ $table = new SchemaConverter()->toPostgreSqlTable(
schema(
int_schema('warehouse', metadata: PostgreSqlMetadata::indexUnique('uq_stock', 2)),
int_schema('product_id', metadata: PostgreSqlMetadata::indexUnique('uq_stock', 1)),
@@ -203,7 +203,7 @@ public function test_composite_unique_with_positions_is_ordered(): void
public function test_column_can_belong_to_multiple_indexes(): void
{
- $table = (new SchemaConverter())->toPostgreSqlTable(
+ $table = new SchemaConverter()->toPostgreSqlTable(
schema(
int_schema(
'id',
@@ -249,7 +249,7 @@ public function test_reverse_preserves_index_column_order(): void
public function test_nullability_from_definition(): void
{
- $table = (new SchemaConverter())->toPostgreSqlTable(
+ $table = new SchemaConverter()->toPostgreSqlTable(
schema(str_schema('required', nullable: false), str_schema('optional', nullable: true)),
'records',
);
@@ -260,7 +260,7 @@ public function test_nullability_from_definition(): void
public function test_precision_and_scale_produce_numeric(): void
{
- $table = (new SchemaConverter())->toPostgreSqlTable(
+ $table = new SchemaConverter()->toPostgreSqlTable(
schema(float_schema(
'amount',
metadata: PostgreSqlMetadata::precision(10)->merge(PostgreSqlMetadata::scale(2)),
@@ -273,7 +273,7 @@ public function test_precision_and_scale_produce_numeric(): void
public function test_primary_key_forces_not_null(): void
{
- $table = (new SchemaConverter())->toPostgreSqlTable(
+ $table = new SchemaConverter()->toPostgreSqlTable(
schema(int_schema('id', nullable: true, metadata: PostgreSqlMetadata::primaryKey())),
'users',
);
@@ -294,7 +294,7 @@ public function test_reverse_maps_columns_to_flow_definitions(): void
Column::create('document', ColumnType::xml()),
]);
- $flowSchema = (new SchemaConverter())->toFlowSchema($table);
+ $flowSchema = new SchemaConverter()->toFlowSchema($table);
static::assertInstanceOf(IntegerType::class, $flowSchema->get('id')->type());
static::assertInstanceOf(StringType::class, $flowSchema->get('name')->type());
@@ -313,7 +313,7 @@ public function test_reverse_preserves_length_metadata(): void
ColumnType::varchar(120),
)]);
- $definition = (new SchemaConverter())->toFlowSchema($table)->get('name');
+ $definition = new SchemaConverter()->toFlowSchema($table)->get('name');
static::assertTrue($definition->metadata()->has(PostgreSqlMetadata::LENGTH->value));
static::assertSame(120, $definition->metadata()->get(PostgreSqlMetadata::LENGTH->value));
@@ -328,7 +328,7 @@ public function test_reverse_primary_key_is_not_nullable(): void
primaryKey: new PrimaryKey(['id'], 'pk_users'),
);
- $definition = (new SchemaConverter())->toFlowSchema($table)->get('id');
+ $definition = new SchemaConverter()->toFlowSchema($table)->get('id');
static::assertFalse($definition->isNullable());
static::assertSame('pk_users', $definition->metadata()->get(PostgreSqlMetadata::PRIMARY_KEY->value));
@@ -355,7 +355,7 @@ public function test_two_primary_keys_throw(): void
{
$this->expectException(RuntimeException::class);
- (new SchemaConverter())->toPostgreSqlTable(
+ new SchemaConverter()->toPostgreSqlTable(
schema(
int_schema('a', metadata: PostgreSqlMetadata::primaryKey('pk_a')),
int_schema('b', metadata: PostgreSqlMetadata::primaryKey('pk_b')),
@@ -366,7 +366,7 @@ public function test_two_primary_keys_throw(): void
public function test_unique_constraint(): void
{
- $table = (new SchemaConverter())->toPostgreSqlTable(
+ $table = new SchemaConverter()->toPostgreSqlTable(
schema(str_schema('email', metadata: PostgreSqlMetadata::indexUnique('uq_email'))),
'users',
);
@@ -379,7 +379,7 @@ public function test_unique_constraint(): void
public function test_no_options_keeps_defaults(): void
{
- $table = (new SchemaConverter())->toPostgreSqlTable(schema(int_schema('id')), 'events');
+ $table = new SchemaConverter()->toPostgreSqlTable(schema(int_schema('id')), 'events');
static::assertFalse($table->unlogged);
static::assertNull($table->tablespace);
@@ -393,7 +393,7 @@ public function test_no_options_keeps_defaults(): void
public function test_options_collections_thread_into_table(): void
{
- $table = (new SchemaConverter())->toPostgreSqlTable(
+ $table = new SchemaConverter()->toPostgreSqlTable(
schema(int_schema('id'), int_schema('user_id')),
'orders',
'public',
@@ -415,7 +415,7 @@ public function test_options_collections_thread_into_table(): void
public function test_options_thread_into_table(): void
{
- $table = (new SchemaConverter())->toPostgreSqlTable(
+ $table = new SchemaConverter()->toPostgreSqlTable(
schema(int_schema('id')),
'events',
'public',
diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/Values/Schema/TypesMapTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/Values/Schema/TypesMapTest.php
index c6391380bd..1e8d3d6584 100644
--- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/Values/Schema/TypesMapTest.php
+++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/Values/Schema/TypesMapTest.php
@@ -140,22 +140,19 @@ public static function provide_unmapped_types(): Generator
#[DataProvider('provide_mapped_types_with_their_flow_type')]
public function test_every_mapped_postgresql_type_becomes_its_flow_type(string $pgType, Type $expected): void
{
- static::assertEquals($expected, (new TypesMap())->toFlowTypeWithTextFloor(column_type_from_string($pgType)));
+ static::assertEquals($expected, new TypesMap()->toFlowTypeWithTextFloor(column_type_from_string($pgType)));
}
public function test_an_unrecognised_name_is_refused_on_the_catalog_route(): void
{
$this->expectException(TypeMappingException::class);
- (new TypesMap())->toFlowType(column_type_from_string('hstore'));
+ new TypesMap()->toFlowType(column_type_from_string('hstore'));
}
public function test_an_unrecognised_name_takes_the_text_floor_on_the_result_route(): void
{
- static::assertEquals(
- type_string(),
- (new TypesMap())->toFlowTypeWithTextFloor(column_type_from_string('hstore')),
- );
+ static::assertEquals(type_string(), new TypesMap()->toFlowTypeWithTextFloor(column_type_from_string('hstore')));
}
#[DataProvider('provide_mapped_types_with_a_wire_value')]
@@ -163,9 +160,9 @@ public function test_every_mapped_type_has_a_caster_arm(string $pgType, string $
{
// Map subset of arms, not pairwise: a mapping is only legitimate while the caster produces
// a value the derived schema accepts.
- $flowType = (new TypesMap())->toFlowTypeWithTextFloor(column_type_from_string($pgType));
+ $flowType = new TypesMap()->toFlowTypeWithTextFloor(column_type_from_string($pgType));
- static::assertTrue($flowType->isValid($flowType->cast((new ResultCaster())->cast($wireValue, $pgType))));
+ static::assertTrue($flowType->isValid($flowType->cast(new ResultCaster()->cast($wireValue, $pgType))));
}
#[DataProvider('provide_unmapped_types')]
@@ -173,14 +170,14 @@ public function test_record_and_the_geometric_types_are_refused(string $pgType):
{
$this->expectException(TypeMappingException::class);
- (new TypesMap())->toFlowTypeWithTextFloor(column_type_from_string($pgType));
+ new TypesMap()->toFlowTypeWithTextFloor(column_type_from_string($pgType));
}
public function test_an_array_of_an_unmapped_element_type_is_refused(): void
{
$this->expectException(TypeMappingException::class);
- (new TypesMap())->toFlowTypeWithTextFloor(column_type_from_string('_point'));
+ new TypesMap()->toFlowTypeWithTextFloor(column_type_from_string('_point'));
}
public function test_an_array_type_becomes_a_list_of_its_element_type(): void
@@ -206,7 +203,7 @@ public function test_an_array_type_becomes_a_list_of_its_element_type(): void
#[DataProvider('provide_catalog_array_types')]
public function test_an_array_column_becomes_a_list_on_the_catalog_route(string $pgType, Type $expected): void
{
- static::assertEquals($expected, (new TypesMap())->toFlowType(column_type_from_string($pgType)));
+ static::assertEquals($expected, new TypesMap()->toFlowType(column_type_from_string($pgType)));
}
/**
@@ -244,12 +241,12 @@ public function test_value_type_refuses_an_unmapped_type(): void
{
$this->expectException(TypeMappingException::class);
- (new TypesMap())->valueType('payload', type_array());
+ new TypesMap()->valueType('payload', type_array());
}
public function test_maps_boolean_type_to_bool(): void
{
- $result = (new TypesMap())->map('active', type_boolean(), true);
+ $result = new TypesMap()->map('active', type_boolean(), true);
static::assertInstanceOf(TypedValue::class, $result);
static::assertSame(ValueType::BOOL, $result->targetType);
@@ -259,7 +256,7 @@ public function test_maps_boolean_type_to_bool(): void
public function test_maps_datetime_type_to_timestamp(): void
{
$date = new DateTimeImmutable('2024-01-15 10:30:00');
- $result = (new TypesMap())->map('created_at', type_datetime(), $date);
+ $result = new TypesMap()->map('created_at', type_datetime(), $date);
static::assertInstanceOf(TypedValue::class, $result);
static::assertSame(ValueType::TIMESTAMP, $result->targetType);
@@ -268,7 +265,7 @@ public function test_maps_datetime_type_to_timestamp(): void
public function test_maps_float_type_to_float8(): void
{
- $result = (new TypesMap())->map('price', type_float(), 99.99);
+ $result = new TypesMap()->map('price', type_float(), 99.99);
static::assertInstanceOf(TypedValue::class, $result);
static::assertSame(ValueType::FLOAT8, $result->targetType);
@@ -277,7 +274,7 @@ public function test_maps_float_type_to_float8(): void
public function test_maps_integer_type_to_int8(): void
{
- $result = (new TypesMap())->map('count', type_integer(), 42);
+ $result = new TypesMap()->map('count', type_integer(), 42);
static::assertInstanceOf(TypedValue::class, $result);
static::assertSame(ValueType::INT8, $result->targetType);
@@ -286,7 +283,7 @@ public function test_maps_integer_type_to_int8(): void
public function test_maps_json_type_to_jsonb(): void
{
- $result = (new TypesMap())->map('data', type_json(), ['key' => 'value']);
+ $result = new TypesMap()->map('data', type_json(), ['key' => 'value']);
static::assertInstanceOf(TypedValue::class, $result);
static::assertSame(ValueType::JSONB, $result->targetType);
@@ -294,7 +291,7 @@ public function test_maps_json_type_to_jsonb(): void
public function test_maps_list_type_to_jsonb(): void
{
- $result = (new TypesMap())->map('tags', type_list(type_integer()), [1, 2, 3]);
+ $result = new TypesMap()->map('tags', type_list(type_integer()), [1, 2, 3]);
static::assertInstanceOf(TypedValue::class, $result);
static::assertSame(ValueType::JSONB, $result->targetType);
@@ -303,7 +300,7 @@ public function test_maps_list_type_to_jsonb(): void
public function test_maps_map_type_to_jsonb(): void
{
- $result = (new TypesMap())->map('metadata', type_map(type_string(), type_string()), ['key' => 'value']);
+ $result = new TypesMap()->map('metadata', type_map(type_string(), type_string()), ['key' => 'value']);
static::assertInstanceOf(TypedValue::class, $result);
static::assertSame(ValueType::JSONB, $result->targetType);
@@ -312,12 +309,12 @@ public function test_maps_map_type_to_jsonb(): void
public function test_maps_null_value_to_null(): void
{
- static::assertNull((new TypesMap())->map('name', type_string(), null));
+ static::assertNull(new TypesMap()->map('name', type_string(), null));
}
public function test_maps_string_type_to_text(): void
{
- $result = (new TypesMap())->map('name', type_string(), 'Alice');
+ $result = new TypesMap()->map('name', type_string(), 'Alice');
static::assertInstanceOf(TypedValue::class, $result);
static::assertSame(ValueType::TEXT, $result->targetType);
@@ -326,7 +323,7 @@ public function test_maps_string_type_to_text(): void
public function test_maps_structure_type_to_jsonb(): void
{
- $result = (new TypesMap())->map('user', type_structure(['name' => type_string(), 'age' => type_integer()]), [
+ $result = new TypesMap()->map('user', type_structure(['name' => type_string(), 'age' => type_integer()]), [
'name' => 'Alice',
'age' => 30,
]);
@@ -337,7 +334,7 @@ public function test_maps_structure_type_to_jsonb(): void
public function test_maps_uuid_type_to_uuid(): void
{
- $result = (new TypesMap())->map('id', type_uuid(), '550e8400-e29b-41d4-a716-446655440000');
+ $result = new TypesMap()->map('id', type_uuid(), '550e8400-e29b-41d4-a716-446655440000');
static::assertInstanceOf(TypedValue::class, $result);
static::assertSame(ValueType::UUID, $result->targetType);
@@ -345,7 +342,7 @@ public function test_maps_uuid_type_to_uuid(): void
public function test_maps_time_zone_type_to_text(): void
{
- $result = (new TypesMap())->map('tz', type_time_zone(), new DateTimeZone('Europe/Warsaw'));
+ $result = new TypesMap()->map('tz', type_time_zone(), new DateTimeZone('Europe/Warsaw'));
static::assertInstanceOf(TypedValue::class, $result);
static::assertSame(ValueType::TEXT, $result->targetType);
@@ -404,6 +401,6 @@ public function test_to_flow_type_maps_varchar_to_string(): void
public function test_to_flow_type_floors_an_unknown_type_name_to_string(): void
{
- static::assertEquals(type_string(), (new TypesMap())->toFlowTypeWithTextFloor(ColumnType::custom('hstore')));
+ static::assertEquals(type_string(), new TypesMap()->toFlowTypeWithTextFloor(ColumnType::custom('hstore')));
}
}
diff --git a/src/adapter/etl-adapter-seal/composer.json b/src/adapter/etl-adapter-seal/composer.json
index 05407c5d6b..17ed24afa8 100644
--- a/src/adapter/etl-adapter-seal/composer.json
+++ b/src/adapter/etl-adapter-seal/composer.json
@@ -12,7 +12,7 @@
"adapter"
],
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"cmsig/seal": "^0.12",
"flow-php/etl": "self.version"
},
diff --git a/src/adapter/etl-adapter-seal/src/Flow/ETL/Adapter/Seal/IO/Loader/SealEncoder.php b/src/adapter/etl-adapter-seal/src/Flow/ETL/Adapter/Seal/IO/Loader/SealEncoder.php
index 16156393b2..844a1ef3fa 100644
--- a/src/adapter/etl-adapter-seal/src/Flow/ETL/Adapter/Seal/IO/Loader/SealEncoder.php
+++ b/src/adapter/etl-adapter-seal/src/Flow/ETL/Adapter/Seal/IO/Loader/SealEncoder.php
@@ -121,7 +121,7 @@ public function column(Type $type, Column $column): array
if (
$bare instanceof TimeType
|| $bare instanceof NullType
- || (new PhysicalFor())->physical($bare) instanceof IdentityPhysical
+ || new PhysicalFor()->physical($bare) instanceof IdentityPhysical
) {
return $column->physicals();
}
diff --git a/src/adapter/etl-adapter-seal/src/Flow/ETL/Adapter/Seal/functions.php b/src/adapter/etl-adapter-seal/src/Flow/ETL/Adapter/Seal/functions.php
index 9d44524cca..7daa74ec3e 100644
--- a/src/adapter/etl-adapter-seal/src/Flow/ETL/Adapter/Seal/functions.php
+++ b/src/adapter/etl-adapter-seal/src/Flow/ETL/Adapter/Seal/functions.php
@@ -29,11 +29,11 @@ function to_seal_delete(EngineInterface $engine, string $index): SealLoader
#[DocumentationDSL(module: Module::SEAL, type: Type::HELPER)]
function to_seal_schema(Schema $schema, string $index_name, ?string $identifier = null): SealSchema
{
- return (new SchemaConverter())->toSealSchema($schema, $index_name, $identifier);
+ return new SchemaConverter()->toSealSchema($schema, $index_name, $identifier);
}
#[DocumentationDSL(module: Module::SEAL, type: Type::HELPER)]
function seal_schema_to_flow(SealSchema $schema): Schema
{
- return (new SchemaConverter())->toFlowSchema($schema);
+ return new SchemaConverter()->toFlowSchema($schema);
}
diff --git a/src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Integration/SealAllColumnTypesTest.php b/src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Integration/SealAllColumnTypesTest.php
index a604857b03..36a573f487 100644
--- a/src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Integration/SealAllColumnTypesTest.php
+++ b/src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Integration/SealAllColumnTypesTest.php
@@ -17,7 +17,7 @@ final class SealAllColumnTypesTest extends IntegrationTestCase
public function test_indexing_pipeline_loads_all_flow_entry_types(): void
{
$engine = $this->sealContext()->engine(to_seal_schema(
- (new FakeStaticOrdersExtractor())->schema(),
+ new FakeStaticOrdersExtractor()->schema(),
'orders',
'index',
));
diff --git a/src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Unit/DescribableRoundTripTest.php b/src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Unit/DescribableRoundTripTest.php
index 95d58e3811..f36175145f 100644
--- a/src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Unit/DescribableRoundTripTest.php
+++ b/src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Unit/DescribableRoundTripTest.php
@@ -6,7 +6,6 @@
use Flow\ETL\Adapter\Seal\Tests\Context\DescribableFixtures;
use Flow\ETL\Foundation\Describe\Describable;
-use Flow\ETL\Foundation\Exception\RequiredPHPVersionException;
use Flow\ETL\Foundation\Exception\RuntimeException;
use Flow\ETL\Tests\Context\DescribeRoundTrip;
use Flow\ETL\Tests\Context\ExtractorClasses;
@@ -58,11 +57,7 @@ public function test_a_rebuilt_describable_equals_the_described_one(string $clas
$this->expectException(RuntimeException::class);
}
- try {
- $describable = DescribableFixtures::all()[$class]();
- } catch (RequiredPHPVersionException $e) {
- static::markTestSkipped($e->getMessage());
- }
+ $describable = DescribableFixtures::all()[$class]();
if (in_array($class, DescribableFixtures::undescribable(), true)) {
static::assertNull($describable->describe());
diff --git a/src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Unit/IO/Loader/SealEncoderTest.php b/src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Unit/IO/Loader/SealEncoderTest.php
index bbeccee1d6..f9e27d96f4 100644
--- a/src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Unit/IO/Loader/SealEncoderTest.php
+++ b/src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Unit/IO/Loader/SealEncoderTest.php
@@ -16,7 +16,6 @@
use Flow\Types\Value\Uuid;
use Generator;
use PHPUnit\Framework\Attributes\DataProvider;
-use PHPUnit\Framework\Attributes\RequiresPhp;
use function Flow\ETL\DSL\array_to_rows;
use function Flow\ETL\DSL\date_schema;
@@ -94,7 +93,7 @@ public function test_encodes_values_into_documents(mixed $value, mixed $expected
{
static::assertSame(
$expected,
- (new SealEncoder())->encode(array_to_rows([[
+ new SealEncoder()->encode(array_to_rows([[
'field' => $value,
]], schema(definition_from_type('field', $type, nullable: $value === null))))[0]['field'],
);
@@ -107,7 +106,7 @@ public function test_encodes_xml_document_to_string(): void
static::assertSame(
'1',
- (new SealEncoder())->encode(array_to_rows([['xml' => $doc]], schema(xml_schema('xml'))))[0]['xml'],
+ new SealEncoder()->encode(array_to_rows([['xml' => $doc]], schema(xml_schema('xml'))))[0]['xml'],
);
}
@@ -115,7 +114,7 @@ public function test_renders_date_with_the_date_format(): void
{
static::assertSame(
'2023-10-01',
- (new SealEncoder())->encode(array_to_rows([[
+ new SealEncoder()->encode(array_to_rows([[
'date' => new DateTimeImmutable('2023-10-01 00:00:00'),
]], schema(date_schema('date'))))[0]['date'],
);
@@ -125,7 +124,7 @@ public function test_produces_documents_keyed_by_column_name(): void
{
static::assertSame(
[['id' => 1, 'name' => 'Alice'], ['id' => 2, 'name' => 'Bob']],
- (new SealEncoder())->encode(array_to_rows(
+ new SealEncoder()->encode(array_to_rows(
[['id' => 1, 'name' => 'Alice'], ['id' => 2, 'name' => 'Bob']],
schema(int_schema('id'), str_schema('name')),
)),
@@ -139,7 +138,7 @@ public function test_encodes_an_xml_element_as_its_markup(): void
static::assertSame(
[['e' => '']],
- (new SealEncoder())->encode(array_to_rows([[
+ new SealEncoder()->encode(array_to_rows([[
'e' => $document->getElementsByTagName('a')->item(0),
]], schema(xml_element_schema('e')))),
);
@@ -149,30 +148,28 @@ public function test_encodes_a_datetime_column_with_nulls(): void
{
static::assertSame(
[['at' => '2026-01-02T03:04:05+00:00'], ['at' => null]],
- (new SealEncoder())->encode(array_to_rows([
+ new SealEncoder()->encode(array_to_rows([
['at' => new DateTimeImmutable('2026-01-02 03:04:05 UTC')],
['at' => null],
], schema(datetime_schema('at', nullable: true)))),
);
}
- #[RequiresPhp('>= 8.4.0')]
public function test_encodes_an_html_document_as_its_markup(): void
{
static::assertSame(
[['h' => 'a
']],
- (new SealEncoder())->encode(array_to_rows([[
+ new SealEncoder()->encode(array_to_rows([[
'h' => 'a
',
]], schema(html_schema('h')))),
);
}
- #[RequiresPhp('>= 8.4.0')]
public function test_encodes_an_html_element_with_a_parent_as_its_markup(): void
{
static::assertSame(
[['e' => 'a
']],
- (new SealEncoder())->encode(array_to_rows([[
+ new SealEncoder()->encode(array_to_rows([[
'e' => type_html_element()->cast('')->firstElementChild,
]], schema(html_element_schema('e')))),
);
diff --git a/src/adapter/etl-adapter-text/composer.json b/src/adapter/etl-adapter-text/composer.json
index 59bce3cf8c..c16439c02e 100644
--- a/src/adapter/etl-adapter-text/composer.json
+++ b/src/adapter/etl-adapter-text/composer.json
@@ -11,7 +11,7 @@
"adapter"
],
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/etl": "self.version"
},
"config": {
diff --git a/src/adapter/etl-adapter-text/src/Flow/ETL/Adapter/Text/IO/Loader/TextEncoder.php b/src/adapter/etl-adapter-text/src/Flow/ETL/Adapter/Text/IO/Loader/TextEncoder.php
index 91ebce0dd7..7b611f4a77 100644
--- a/src/adapter/etl-adapter-text/src/Flow/ETL/Adapter/Text/IO/Loader/TextEncoder.php
+++ b/src/adapter/etl-adapter-text/src/Flow/ETL/Adapter/Text/IO/Loader/TextEncoder.php
@@ -55,7 +55,7 @@ public function encode(Rows $rows): string
return (
implode(
$this->newLineSeparator,
- (new TextValues())->texts($type, $rows->column($definitions[0]->name())->physicals()),
+ new TextValues()->texts($type, $rows->column($definitions[0]->name())->physicals()),
) . $this->newLineSeparator
);
}
diff --git a/src/adapter/etl-adapter-text/src/Flow/ETL/Adapter/Text/IO/Loader/TextLoader.php b/src/adapter/etl-adapter-text/src/Flow/ETL/Adapter/Text/IO/Loader/TextLoader.php
index a31f5243e4..0679bada9d 100644
--- a/src/adapter/etl-adapter-text/src/Flow/ETL/Adapter/Text/IO/Loader/TextLoader.php
+++ b/src/adapter/etl-adapter-text/src/Flow/ETL/Adapter/Text/IO/Loader/TextLoader.php
@@ -65,10 +65,10 @@ public function __construct(Path $path, Filesystem $filesystem = new NativeLocal
public static function fromDescription(#[SensitiveParameter] array $data, Rebuild $rebuild): static
{
- $loader = (new self(
+ $loader = new self(
Path::fromArray(type_array()->assert($data['path'] ?? null)),
$rebuild->of($data['filesystem'] ?? null, ConfiguredFilesystem::class)->filesystem(),
- ))
+ )
->saveMode(type_enum(SaveMode::class)->assert(constant(
SaveMode::class . '::' . type_string()->assert($data['save_mode'] ?? null),
)))
@@ -140,7 +140,7 @@ public function partitioning(): Partitioning
public function inTask(Part $task): static
{
- $loader = (new self($this->path, $this->filesystem))
+ $loader = new self($this->path, $this->filesystem)
->saveMode($this->saveMode)
->withNewLineSeparator($this->newLineSeparator);
diff --git a/src/adapter/etl-adapter-text/src/Flow/ETL/Adapter/Text/functions.php b/src/adapter/etl-adapter-text/src/Flow/ETL/Adapter/Text/functions.php
index 1265381f8d..9ff5857cdc 100644
--- a/src/adapter/etl-adapter-text/src/Flow/ETL/Adapter/Text/functions.php
+++ b/src/adapter/etl-adapter-text/src/Flow/ETL/Adapter/Text/functions.php
@@ -35,7 +35,7 @@ function to_text(
string $new_line_separator = PHP_EOL,
Filesystem $filesystem = new NativeLocalFilesystem(),
): TextLoader {
- return (new TextLoader(is_string($path) ? path_real($path) : $path, $filesystem))->withNewLineSeparator(
+ return new TextLoader(is_string($path) ? path_real($path) : $path, $filesystem)->withNewLineSeparator(
$new_line_separator,
);
}
diff --git a/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Integration/IO/Extractor/TextExtractorTest.php b/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Integration/IO/Extractor/TextExtractorTest.php
index ff444769dd..08571a0298 100644
--- a/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Integration/IO/Extractor/TextExtractorTest.php
+++ b/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Integration/IO/Extractor/TextExtractorTest.php
@@ -152,7 +152,7 @@ public function test_a_limited_read_closes_its_stream(): void
$filesystem = new RecordingFilesystem(native_local_filesystem());
iterator_to_array(FlowTestCase::extracted(
- (new TextExtractor(path_real(__DIR__ . '/../../../Fixtures/parity_lines.txt'), $filesystem))->withBatchSize(
+ new TextExtractor(path_real(__DIR__ . '/../../../Fixtures/parity_lines.txt'), $filesystem)->withBatchSize(
1,
),
flow_context(config())->backend(),
@@ -166,7 +166,7 @@ public function test_a_stopped_read_closes_its_stream(): void
{
$filesystem = new RecordingFilesystem(native_local_filesystem());
$generator = FlowTestCase::extracted(
- (new TextExtractor(path_real(__DIR__ . '/../../../Fixtures/parity_lines.txt'), $filesystem))->withBatchSize(
+ new TextExtractor(path_real(__DIR__ . '/../../../Fixtures/parity_lines.txt'), $filesystem)->withBatchSize(
1,
),
flow_context(config())->backend(),
@@ -303,7 +303,7 @@ public function test_extract_split_stops_on_the_stop_signal(): void
$generator = FlowTestCase::extracted(
$extractor,
flow_context()->backend(),
- (new Criteria())->withSplit($extractor->splits(new Criteria(), 1)[0]),
+ new Criteria()->withSplit($extractor->splits(new Criteria(), 1)[0]),
);
$totalRows = 0;
@@ -345,7 +345,7 @@ public function test_a_pushed_path_filter_prunes_the_files_splits_are_cut_from()
static::assertEquals(
[new FileSplit($extractor->source(), 0, null)],
- $extractor->splits((new Criteria())->withPathFilter(new RejectingFilter()), 1),
+ $extractor->splits(new Criteria()->withPathFilter(new RejectingFilter()), 1),
);
}
}
diff --git a/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Integration/IO/FileFormatContractTest.php b/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Integration/IO/FileFormatContractTest.php
index c2dfb6e24b..a3346fc9ce 100644
--- a/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Integration/IO/FileFormatContractTest.php
+++ b/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Integration/IO/FileFormatContractTest.php
@@ -30,109 +30,109 @@ public static function formats(): Generator
#[DataProvider('formats')]
public function test_overwrite_replaces_what_the_destination_held(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->overwriteReplacesWhatTheDestinationHeld($format);
+ new FileFormatContract($this->cacheDir)->overwriteReplacesWhatTheDestinationHeld($format);
}
#[DataProvider('formats')]
public function test_append_keeps_what_the_destination_held(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->appendKeepsWhatTheDestinationHeld($format);
+ new FileFormatContract($this->cacheDir)->appendKeepsWhatTheDestinationHeld($format);
}
#[DataProvider('formats')]
public function test_ignore_leaves_an_existing_destination_untouched(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->ignoreLeavesAnExistingDestinationUntouched($format);
+ new FileFormatContract($this->cacheDir)->ignoreLeavesAnExistingDestinationUntouched($format);
}
#[DataProvider('formats')]
public function test_exception_if_exists_refuses_an_existing_destination(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->exceptionIfExistsRefusesAnExistingDestination($format);
+ new FileFormatContract($this->cacheDir)->exceptionIfExistsRefusesAnExistingDestination($format);
}
#[DataProvider('formats')]
public function test_a_batch_of_zero_rows_creates_no_file(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aBatchOfZeroRowsCreatesNoFile($format);
+ new FileFormatContract($this->cacheDir)->aBatchOfZeroRowsCreatesNoFile($format);
}
#[DataProvider('formats')]
public function test_a_write_that_ends_reports_its_file_operations(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aWriteThatEndsReportsItsFileOperations($format);
+ new FileFormatContract($this->cacheDir)->aWriteThatEndsReportsItsFileOperations($format);
}
#[DataProvider('formats')]
public function test_a_partitioned_write_reads_back_every_partition(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aPartitionedWriteReadsBackEveryPartition($format);
+ new FileFormatContract($this->cacheDir)->aPartitionedWriteReadsBackEveryPartition($format);
}
#[DataProvider('formats')]
public function test_a_loader_in_a_task_survives_describe(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aLoaderInATaskSurvivesDescribe($format);
+ new FileFormatContract($this->cacheDir)->aLoaderInATaskSurvivesDescribe($format);
}
#[DataProvider('formats')]
public function test_an_extractor_reader_survives_describe(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->anExtractorReaderSurvivesDescribe($format);
+ new FileFormatContract($this->cacheDir)->anExtractorReaderSurvivesDescribe($format);
}
#[DataProvider('formats')]
public function test_the_splits_read_every_row_once(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->theSplitsReadEveryRowOnce($format);
+ new FileFormatContract($this->cacheDir)->theSplitsReadEveryRowOnce($format);
}
#[DataProvider('formats')]
public function test_metadata_columns_name_the_source_file(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->metadataColumnsNameTheSourceFile($format);
+ new FileFormatContract($this->cacheDir)->metadataColumnsNameTheSourceFile($format);
}
#[DataProvider('formats')]
public function test_the_batch_size_bounds_every_batch(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->theBatchSizeBoundsEveryBatch($format);
+ new FileFormatContract($this->cacheDir)->theBatchSizeBoundsEveryBatch($format);
}
#[DataProvider('formats')]
public function test_refresh_lists_the_files_written_after_a_read(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->refreshListsTheFilesWrittenAfterARead($format);
+ new FileFormatContract($this->cacheDir)->refreshListsTheFilesWrittenAfterARead($format);
}
#[DataProvider('formats')]
public function test_a_failed_run_leaves_no_file_at_the_destination(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aFailedRunLeavesNoFileAtTheDestination($format);
+ new FileFormatContract($this->cacheDir)->aFailedRunLeavesNoFileAtTheDestination($format);
}
#[DataProvider('formats')]
public function test_an_extractor_rejects_a_path_its_filesystem_does_not_serve(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->anExtractorRejectsAPathItsFilesystemDoesNotServe($format);
+ new FileFormatContract($this->cacheDir)->anExtractorRejectsAPathItsFilesystemDoesNotServe($format);
}
#[DataProvider('formats')]
public function test_a_loader_rejects_a_path_its_filesystem_does_not_serve(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aLoaderRejectsAPathItsFilesystemDoesNotServe($format);
+ new FileFormatContract($this->cacheDir)->aLoaderRejectsAPathItsFilesystemDoesNotServe($format);
}
#[DataProvider('formats')]
public function test_reads_back_through_the_same_filesystem_instance(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->readsBackThroughTheSameFilesystemInstance($format);
+ new FileFormatContract($this->cacheDir)->readsBackThroughTheSameFilesystemInstance($format);
}
#[DataProvider('formats')]
public function test_a_pushed_filter_returns_what_the_filter_node_returns(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aPushedFilterReturnsWhatTheFilterNodeReturns(
+ new FileFormatContract($this->cacheDir)->aPushedFilterReturnsWhatTheFilterNodeReturns(
$format,
ref('text')->notEquals(lit('b')),
);
diff --git a/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Integration/IO/Loader/TextLoaderTest.php b/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Integration/IO/Loader/TextLoaderTest.php
index 759c7ee3ab..9a5956e4a9 100644
--- a/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Integration/IO/Loader/TextLoaderTest.php
+++ b/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Integration/IO/Loader/TextLoaderTest.php
@@ -37,7 +37,7 @@ final class TextLoaderTest extends FlowTestCase
public function test_setting_content_type_on_path(): void
{
static::assertEquals(
- (new TextLoader(path(__DIR__ . '/file.txt')))
+ new TextLoader(path(__DIR__ . '/file.txt'))
->destination()
->getOption(Option::CONTENT_TYPE),
ContentType::TEXT,
diff --git a/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Unit/DescribableRoundTripTest.php b/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Unit/DescribableRoundTripTest.php
index 5f6eeace51..295d78127f 100644
--- a/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Unit/DescribableRoundTripTest.php
+++ b/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Unit/DescribableRoundTripTest.php
@@ -6,7 +6,6 @@
use Flow\ETL\Adapter\Text\Tests\Context\DescribableFixtures;
use Flow\ETL\Foundation\Describe\Describable;
-use Flow\ETL\Foundation\Exception\RequiredPHPVersionException;
use Flow\ETL\Foundation\Exception\RuntimeException;
use Flow\ETL\Tests\Context\DescribeRoundTrip;
use Flow\ETL\Tests\Context\ExtractorClasses;
@@ -58,11 +57,7 @@ public function test_a_rebuilt_describable_equals_the_described_one(string $clas
$this->expectException(RuntimeException::class);
}
- try {
- $describable = DescribableFixtures::all()[$class]();
- } catch (RequiredPHPVersionException $e) {
- static::markTestSkipped($e->getMessage());
- }
+ $describable = DescribableFixtures::all()[$class]();
if (in_array($class, DescribableFixtures::undescribable(), true)) {
static::assertNull($describable->describe());
diff --git a/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Unit/IO/Extractor/MetadataColumnsExtractorTest.php b/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Unit/IO/Extractor/MetadataColumnsExtractorTest.php
index 14eeee0832..892b15ee24 100644
--- a/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Unit/IO/Extractor/MetadataColumnsExtractorTest.php
+++ b/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Unit/IO/Extractor/MetadataColumnsExtractorTest.php
@@ -31,7 +31,7 @@ public static function extractors(): Generator
#[DataProvider('extractors')]
public function test_an_extractor_carries_the_metadata_setter_only_when_it_declares_metadata(string $class): void
{
- if ((new ReflectionClass($class))->implementsInterface(MetadataColumnsExtractor::class)) {
+ if (new ReflectionClass($class)->implementsInterface(MetadataColumnsExtractor::class)) {
MetadataColumnsContract::declares($class);
return;
diff --git a/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Unit/IO/Extractor/TextFileBatchesTest.php b/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Unit/IO/Extractor/TextFileBatchesTest.php
index e6bdf03386..2fd7eff314 100644
--- a/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Unit/IO/Extractor/TextFileBatchesTest.php
+++ b/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Unit/IO/Extractor/TextFileBatchesTest.php
@@ -26,7 +26,7 @@ final class TextFileBatchesTest extends FlowTestCase
public function test_lines_land_in_the_text_column_and_no_offset_is_consumed(): void
{
$filesystem = new CountingFilesystem(MemoryFiles::with(['memory://a.txt' => "a\nb\nc\n"]));
- $file = (new TextFileBatches())->batches(
+ $file = new TextFileBatches()->batches(
FileReadMother::of(schema(str_schema('text')), null, 2, $filesystem),
new Criteria(),
new SourceFile(path('memory://a.txt')),
@@ -49,7 +49,7 @@ public function test_a_column_the_body_declares_beside_text_is_padded_with_nulls
array_map(
static fn(Rows $rows): array => $rows->toArray(),
iterator_to_array(
- (new TextFileBatches())->batches(
+ new TextFileBatches()->batches(
FileReadMother::of(
schema(str_schema('text'), str_schema('note', nullable: true)),
null,
diff --git a/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Unit/IO/Loader/TextEncoderTest.php b/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Unit/IO/Loader/TextEncoderTest.php
index 54841e3a97..a15bc7e960 100644
--- a/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Unit/IO/Loader/TextEncoderTest.php
+++ b/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Unit/IO/Loader/TextEncoderTest.php
@@ -41,7 +41,7 @@ public function test_encode_writes_every_value_on_its_own_line_and_a_null_as_an_
{
static::assertSame(
"first\n\nsecond\n",
- (new TextEncoder("\n"))->encode(array_to_rows([
+ new TextEncoder("\n")->encode(array_to_rows([
['text' => 'first'],
['text' => null],
['text' => 'second'],
@@ -53,7 +53,7 @@ public function test_encode_writes_the_text_of_a_value_that_is_no_string(): void
{
static::assertSame(
"0.30000000000000004\n1.0\n",
- (new TextEncoder("\n"))->encode(array_to_rows([
+ new TextEncoder("\n")->encode(array_to_rows([
['price' => 0.1 + 0.2],
['price' => 1.0],
], schema(float_schema('price')))),
@@ -69,14 +69,14 @@ public function test_encode_refuses_a_nested_column(Definition $definition, mixe
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('Text data loader supports only scalar values, got array');
- (new TextEncoder())->encode(array_to_rows([['a' => $value]], schema($definition)));
+ new TextEncoder()->encode(array_to_rows([['a' => $value]], schema($definition)));
}
public function test_encode_ends_every_line_with_the_configured_separator(): void
{
static::assertSame(
"first\r\nsecond\r\n",
- (new TextEncoder("\r\n"))->encode(array_to_rows([
+ new TextEncoder("\r\n")->encode(array_to_rows([
['text' => 'first'],
['text' => 'second'],
], schema(str_schema('text')))),
@@ -88,7 +88,7 @@ public function test_encode_throws_when_a_row_has_more_than_one_column(): void
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('Text data loader writes at most one column, the batch has 3 columns.');
- (new TextEncoder())->encode(array_to_rows(
+ new TextEncoder()->encode(array_to_rows(
[['a' => 1, 'b' => 2, 'c' => 3], ['a' => 4, 'b' => 5, 'c' => 6]],
schema(int_schema('a'), int_schema('b'), int_schema('c')),
));
@@ -96,9 +96,6 @@ public function test_encode_throws_when_a_row_has_more_than_one_column(): void
public function test_encode_of_an_empty_batch_with_more_than_one_column_returns_no_lines(): void
{
- static::assertSame(
- '',
- (new TextEncoder())->encode(array_to_rows([], schema(int_schema('a'), int_schema('b')))),
- );
+ static::assertSame('', new TextEncoder()->encode(array_to_rows([], schema(int_schema('a'), int_schema('b')))));
}
}
diff --git a/src/adapter/etl-adapter-xml/composer.json b/src/adapter/etl-adapter-xml/composer.json
index 5ad21fee10..6d3afbb494 100644
--- a/src/adapter/etl-adapter-xml/composer.json
+++ b/src/adapter/etl-adapter-xml/composer.json
@@ -11,7 +11,7 @@
"adapter"
],
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"ext-dom": "*",
"ext-xml": "*",
"ext-xmlreader": "*",
diff --git a/src/adapter/etl-adapter-xml/src/Flow/ETL/Adapter/XML/IO/Extractor/XMLNodeCursor.php b/src/adapter/etl-adapter-xml/src/Flow/ETL/Adapter/XML/IO/Extractor/XMLNodeCursor.php
index a0834a46ad..cd9d99fce3 100644
--- a/src/adapter/etl-adapter-xml/src/Flow/ETL/Adapter/XML/IO/Extractor/XMLNodeCursor.php
+++ b/src/adapter/etl-adapter-xml/src/Flow/ETL/Adapter/XML/IO/Extractor/XMLNodeCursor.php
@@ -99,7 +99,7 @@ public function of(SourceStream $stream, int $bufferSize): Generator
$error !== false
&& $error->level === LIBXML_ERR_FATAL
&& $error->code !== self::DOCUMENT_EMPTY
- && !($error->code === self::EXTRA_CONTENT && (new RootlessDocument())->matches($stream, $bufferSize))
+ && !($error->code === self::EXTRA_CONTENT && new RootlessDocument()->matches($stream, $bufferSize))
) {
throw $this->failure();
}
diff --git a/src/adapter/etl-adapter-xml/src/Flow/ETL/Adapter/XML/IO/Loader/XMLLoader.php b/src/adapter/etl-adapter-xml/src/Flow/ETL/Adapter/XML/IO/Loader/XMLLoader.php
index 36e006d6e1..0da55fcd28 100644
--- a/src/adapter/etl-adapter-xml/src/Flow/ETL/Adapter/XML/IO/Loader/XMLLoader.php
+++ b/src/adapter/etl-adapter-xml/src/Flow/ETL/Adapter/XML/IO/Loader/XMLLoader.php
@@ -92,11 +92,11 @@ public function __construct(
public static function fromDescription(#[SensitiveParameter] array $data, Rebuild $rebuild): static
{
- $loader = (new self(
+ $loader = new self(
Path::fromArray(type_array()->assert($data['path'] ?? null)),
$rebuild->of($data['xml_writer'] ?? null, XMLWriter::class),
$rebuild->of($data['filesystem'] ?? null, ConfiguredFilesystem::class)->filesystem(),
- ))
+ )
->saveMode(type_enum(SaveMode::class)->assert(constant(
SaveMode::class . '::' . type_string()->assert($data['save_mode'] ?? null),
)))
@@ -191,7 +191,7 @@ public function partitioning(): Partitioning
public function inTask(Part $task): static
{
- $loader = (new self($this->path, $this->xmlWriter, $this->filesystem))
+ $loader = new self($this->path, $this->xmlWriter, $this->filesystem)
->saveMode($this->saveMode)
->withAttributePrefix($this->attributePrefix)
->withDateFormat($this->dateFormat)
diff --git a/src/adapter/etl-adapter-xml/src/Flow/ETL/Adapter/XML/functions.php b/src/adapter/etl-adapter-xml/src/Flow/ETL/Adapter/XML/functions.php
index 7112777c73..10e7cc896d 100644
--- a/src/adapter/etl-adapter-xml/src/Flow/ETL/Adapter/XML/functions.php
+++ b/src/adapter/etl-adapter-xml/src/Flow/ETL/Adapter/XML/functions.php
@@ -42,7 +42,7 @@ function from_xml(
string $xml_node_path = '',
Filesystem $filesystem = new NativeLocalFilesystem(),
): XMLParserExtractor {
- return (new XMLParserExtractor(is_string($path) ? path_real($path) : $path, $filesystem))->withXMLNodePath(
+ return new XMLParserExtractor(is_string($path) ? path_real($path) : $path, $filesystem)->withXMLNodePath(
$xml_node_path,
);
}
@@ -65,7 +65,7 @@ function to_xml(
XMLWriter $xml_writer = new StringXMLWriter(),
Filesystem $filesystem = new NativeLocalFilesystem(),
): XMLLoader {
- return (new XMLLoader(is_string($path) ? path_real($path) : $path, $xml_writer, $filesystem))
+ return new XMLLoader(is_string($path) ? path_real($path) : $path, $xml_writer, $filesystem)
->withRootElementName($root_element_name)
->withRowElementName($row_element_name)
->withAttributePrefix($attribute_prefix)
diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Context/SerializedNodes.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Context/SerializedNodes.php
index 668919a5f4..978968f6ec 100644
--- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Context/SerializedNodes.php
+++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Context/SerializedNodes.php
@@ -24,7 +24,7 @@ public static function of(string $xmlNodePath, string $xml, int $bufferSize = 81
return array_map(
static fn(DOMDocument $document): string => (string) $document->saveXML($document->documentElement),
iterator_to_array(
- (new XMLNodes($xmlNodePath))->documents(
+ new XMLNodes($xmlNodePath)->documents(
new StringSourceStream(path('memory://document.xml'), $xml),
$bufferSize,
),
diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Integration/IO/Extractor/XMLParserExtractorTest.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Integration/IO/Extractor/XMLParserExtractorTest.php
index d760e06de1..c60c023a89 100644
--- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Integration/IO/Extractor/XMLParserExtractorTest.php
+++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Integration/IO/Extractor/XMLParserExtractorTest.php
@@ -409,7 +409,7 @@ public function test_is_repeatable(): void
public function test_a_limited_read_closes_its_stream(): void
{
$filesystem = new RecordingFilesystem(native_local_filesystem());
- $extractor = (new XMLParserExtractor(path_real(__DIR__ . '/../../../Fixtures/simple_items.xml'), $filesystem))
+ $extractor = new XMLParserExtractor(path_real(__DIR__ . '/../../../Fixtures/simple_items.xml'), $filesystem)
->withXMLNodePath('root/items/item')
->withBatchSize(1);
@@ -476,7 +476,7 @@ public function test_a_stopped_read_closes_its_stream(): void
{
$filesystem = new RecordingFilesystem(native_local_filesystem());
$generator = FlowTestCase::extracted(
- (new XMLParserExtractor(path_real(__DIR__ . '/../../../Fixtures/simple_items.xml'), $filesystem))
+ new XMLParserExtractor(path_real(__DIR__ . '/../../../Fixtures/simple_items.xml'), $filesystem)
->withXMLNodePath('root/items/item')
->withBatchSize(1),
flow_context(config())->backend(),
@@ -575,7 +575,7 @@ public function test_extract_split_stops_on_the_stop_signal(): void
$generator = FlowTestCase::extracted(
$extractor,
flow_context()->backend(),
- (new Criteria())->withSplit($extractor->splits(new Criteria(), 1)[0]),
+ new Criteria()->withSplit($extractor->splits(new Criteria(), 1)[0]),
);
$totalRows = 0;
@@ -617,7 +617,7 @@ public function test_a_pushed_path_filter_prunes_the_files_splits_are_cut_from()
static::assertEquals(
[new FileSplit($extractor->source(), 0, null)],
- $extractor->splits((new Criteria())->withPathFilter(new RejectingFilter()), 1),
+ $extractor->splits(new Criteria()->withPathFilter(new RejectingFilter()), 1),
);
}
}
diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Integration/IO/FileFormatContractTest.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Integration/IO/FileFormatContractTest.php
index 4130eac2a8..4e178b2d56 100644
--- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Integration/IO/FileFormatContractTest.php
+++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Integration/IO/FileFormatContractTest.php
@@ -34,109 +34,109 @@ public static function formats(): Generator
#[DataProvider('formats')]
public function test_overwrite_replaces_what_the_destination_held(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->overwriteReplacesWhatTheDestinationHeld($format);
+ new FileFormatContract($this->cacheDir)->overwriteReplacesWhatTheDestinationHeld($format);
}
#[DataProvider('formats')]
public function test_append_keeps_what_the_destination_held(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->appendKeepsWhatTheDestinationHeld($format);
+ new FileFormatContract($this->cacheDir)->appendKeepsWhatTheDestinationHeld($format);
}
#[DataProvider('formats')]
public function test_ignore_leaves_an_existing_destination_untouched(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->ignoreLeavesAnExistingDestinationUntouched($format);
+ new FileFormatContract($this->cacheDir)->ignoreLeavesAnExistingDestinationUntouched($format);
}
#[DataProvider('formats')]
public function test_exception_if_exists_refuses_an_existing_destination(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->exceptionIfExistsRefusesAnExistingDestination($format);
+ new FileFormatContract($this->cacheDir)->exceptionIfExistsRefusesAnExistingDestination($format);
}
#[DataProvider('formats')]
public function test_a_batch_of_zero_rows_creates_no_file(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aBatchOfZeroRowsCreatesNoFile($format);
+ new FileFormatContract($this->cacheDir)->aBatchOfZeroRowsCreatesNoFile($format);
}
#[DataProvider('formats')]
public function test_a_write_that_ends_reports_its_file_operations(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aWriteThatEndsReportsItsFileOperations($format);
+ new FileFormatContract($this->cacheDir)->aWriteThatEndsReportsItsFileOperations($format);
}
#[DataProvider('formats')]
public function test_a_partitioned_write_reads_back_every_partition(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aPartitionedWriteReadsBackEveryPartition($format);
+ new FileFormatContract($this->cacheDir)->aPartitionedWriteReadsBackEveryPartition($format);
}
#[DataProvider('formats')]
public function test_a_loader_in_a_task_survives_describe(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aLoaderInATaskSurvivesDescribe($format);
+ new FileFormatContract($this->cacheDir)->aLoaderInATaskSurvivesDescribe($format);
}
#[DataProvider('formats')]
public function test_an_extractor_reader_survives_describe(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->anExtractorReaderSurvivesDescribe($format);
+ new FileFormatContract($this->cacheDir)->anExtractorReaderSurvivesDescribe($format);
}
#[DataProvider('formats')]
public function test_the_splits_read_every_row_once(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->theSplitsReadEveryRowOnce($format);
+ new FileFormatContract($this->cacheDir)->theSplitsReadEveryRowOnce($format);
}
#[DataProvider('formats')]
public function test_metadata_columns_name_the_source_file(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->metadataColumnsNameTheSourceFile($format);
+ new FileFormatContract($this->cacheDir)->metadataColumnsNameTheSourceFile($format);
}
#[DataProvider('formats')]
public function test_the_batch_size_bounds_every_batch(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->theBatchSizeBoundsEveryBatch($format);
+ new FileFormatContract($this->cacheDir)->theBatchSizeBoundsEveryBatch($format);
}
#[DataProvider('formats')]
public function test_refresh_lists_the_files_written_after_a_read(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->refreshListsTheFilesWrittenAfterARead($format);
+ new FileFormatContract($this->cacheDir)->refreshListsTheFilesWrittenAfterARead($format);
}
#[DataProvider('formats')]
public function test_a_failed_run_leaves_no_file_at_the_destination(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aFailedRunLeavesNoFileAtTheDestination($format);
+ new FileFormatContract($this->cacheDir)->aFailedRunLeavesNoFileAtTheDestination($format);
}
#[DataProvider('formats')]
public function test_an_extractor_rejects_a_path_its_filesystem_does_not_serve(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->anExtractorRejectsAPathItsFilesystemDoesNotServe($format);
+ new FileFormatContract($this->cacheDir)->anExtractorRejectsAPathItsFilesystemDoesNotServe($format);
}
#[DataProvider('formats')]
public function test_a_loader_rejects_a_path_its_filesystem_does_not_serve(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aLoaderRejectsAPathItsFilesystemDoesNotServe($format);
+ new FileFormatContract($this->cacheDir)->aLoaderRejectsAPathItsFilesystemDoesNotServe($format);
}
#[DataProvider('formats')]
public function test_reads_back_through_the_same_filesystem_instance(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->readsBackThroughTheSameFilesystemInstance($format);
+ new FileFormatContract($this->cacheDir)->readsBackThroughTheSameFilesystemInstance($format);
}
#[DataProvider('formats')]
public function test_a_pushed_filter_returns_what_the_filter_node_returns(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aPushedFilterReturnsWhatTheFilterNodeReturns(
+ new FileFormatContract($this->cacheDir)->aPushedFilterReturnsWhatTheFilterNodeReturns(
$format,
ref('node')->xpath('id')->domElementValue()->notEquals(lit('b')),
);
diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/DescribableRoundTripTest.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/DescribableRoundTripTest.php
index 6d0e19ee21..13cf9ed123 100644
--- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/DescribableRoundTripTest.php
+++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/DescribableRoundTripTest.php
@@ -6,7 +6,6 @@
use Flow\ETL\Adapter\XML\Tests\Context\DescribableFixtures;
use Flow\ETL\Foundation\Describe\Describable;
-use Flow\ETL\Foundation\Exception\RequiredPHPVersionException;
use Flow\ETL\Foundation\Exception\RuntimeException;
use Flow\ETL\Tests\Context\DescribeRoundTrip;
use Flow\ETL\Tests\Context\ExtractorClasses;
@@ -58,11 +57,7 @@ public function test_a_rebuilt_describable_equals_the_described_one(string $clas
$this->expectException(RuntimeException::class);
}
- try {
- $describable = DescribableFixtures::all()[$class]();
- } catch (RequiredPHPVersionException $e) {
- static::markTestSkipped($e->getMessage());
- }
+ $describable = DescribableFixtures::all()[$class]();
if (in_array($class, DescribableFixtures::undescribable(), true)) {
static::assertNull($describable->describe());
diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/MetadataColumnsExtractorTest.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/MetadataColumnsExtractorTest.php
index 8e42dc4845..bf051286c4 100644
--- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/MetadataColumnsExtractorTest.php
+++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/MetadataColumnsExtractorTest.php
@@ -31,7 +31,7 @@ public static function extractors(): Generator
#[DataProvider('extractors')]
public function test_an_extractor_carries_the_metadata_setter_only_when_it_declares_metadata(string $class): void
{
- if ((new ReflectionClass($class))->implementsInterface(MetadataColumnsExtractor::class)) {
+ if (new ReflectionClass($class)->implementsInterface(MetadataColumnsExtractor::class)) {
MetadataColumnsContract::declares($class);
return;
diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/RootlessDocumentTest.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/RootlessDocumentTest.php
index 09c1bae86f..c5a16f639d 100644
--- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/RootlessDocumentTest.php
+++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/RootlessDocumentTest.php
@@ -65,7 +65,7 @@ public static function documentsWithMore(): Generator
#[DataProvider('rootlessDocuments')]
public function test_a_document_without_a_root_matches(string $xml, int $bufferSize): void
{
- static::assertTrue((new RootlessDocument())->matches(
+ static::assertTrue(new RootlessDocument()->matches(
new StringSourceStream(path('memory://a.xml'), $xml),
$bufferSize,
));
@@ -77,7 +77,7 @@ public function test_a_document_without_a_root_matches(string $xml, int $bufferS
#[DataProvider('documentsWithMore')]
public function test_a_document_with_more_does_not_match(string $xml, int $bufferSize): void
{
- static::assertFalse((new RootlessDocument())->matches(
+ static::assertFalse(new RootlessDocument()->matches(
new StringSourceStream(path('memory://a.xml'), $xml),
$bufferSize,
));
diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/XMLFileBatchesTest.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/XMLFileBatchesTest.php
index 5c84394883..3a63ddd228 100644
--- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/XMLFileBatchesTest.php
+++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/XMLFileBatchesTest.php
@@ -28,7 +28,7 @@ public function test_matched_elements_land_in_the_node_column_and_no_offset_is_c
$filesystem = new CountingFilesystem(MemoryFiles::with([
'memory://a.xml' => '1
2
',
]));
- $file = (new XMLFileBatches('root/row', 8192))->batches(
+ $file = new XMLFileBatches('root/row', 8192)->batches(
FileReadMother::of(schema(str_schema('node')), null, 10, $filesystem),
new Criteria(),
new SourceFile(path('memory://a.xml')),
@@ -51,7 +51,7 @@ public function test_a_column_the_body_declares_beside_node_is_padded_with_nulls
array_map(
static fn(Rows $rows): array => $rows->toArray(),
iterator_to_array(
- (new XMLFileBatches('root/row', 8192))->batches(
+ new XMLFileBatches('root/row', 8192)->batches(
FileReadMother::of(
schema(str_schema('node'), str_schema('note', nullable: true)),
null,
diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/XMLNodeBatchesTest.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/XMLNodeBatchesTest.php
index edda2aeb14..3a0964e22f 100644
--- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/XMLNodeBatchesTest.php
+++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/XMLNodeBatchesTest.php
@@ -27,7 +27,7 @@ final class XMLNodeBatchesTest extends FlowTestCase
public function test_documents_are_rows_of_utf8_node_documents_in_batches(): void
{
$batches = iterator_to_array(
- (new XMLNodeBatches(new XMLNodes('rows/row'), 2, 8192))->documents(
+ new XMLNodeBatches(new XMLNodes('rows/row'), 2, 8192)->documents(
new StringSourceStream(path('memory://a.xml'), 'ż
2
3
'),
schema(xml_schema('node'), str_schema('other', nullable: true)),
new PhpBackend(),
@@ -50,7 +50,7 @@ public function test_physicals_are_an_xml_column_of_node_document_bytes_in_batch
static::assertInstanceOf(XMLDefinition::class, $node);
$batches = iterator_to_array(
- (new XMLNodeBatches(new XMLNodes('rows/row'), 2, 8192))->physicals(
+ new XMLNodeBatches(new XMLNodes('rows/row'), 2, 8192)->physicals(
new StringSourceStream(path('memory://a.xml'), '|
2
3
'),
$node,
schema($node),
@@ -76,7 +76,7 @@ public function test_strings_are_rows_of_node_texts_in_batches(): void
array_map(
static fn(Rows $rows): array => $rows->toArray(),
iterator_to_array(
- (new XMLNodeBatches(new XMLNodes('rows/row'), 2, 8192))->strings(
+ new XMLNodeBatches(new XMLNodes('rows/row'), 2, 8192)->strings(
new StringSourceStream(
path('memory://a.xml'),
'ż
2
3
',
diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/XMLNodeCursorTest.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/XMLNodeCursorTest.php
index a7de18824d..cdc3e695fd 100644
--- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/XMLNodeCursorTest.php
+++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/XMLNodeCursorTest.php
@@ -30,7 +30,7 @@ public function test_stops_on_every_element_on_the_path(string $path, int $buffe
{
$seen = [];
- foreach ((new XMLNodeCursor($path))->of(
+ foreach (new XMLNodeCursor($path)->of(
new StringSourceStream(
path('memory://a.xml'),
' ',
@@ -50,7 +50,7 @@ public function test_a_document_without_a_root_has_no_stops(string $xml): void
{
static::assertSame(
[],
- iterator_to_array((new XMLNodeCursor('root/item'))->of(
+ iterator_to_array(new XMLNodeCursor('root/item')->of(
new StringSourceStream(path('memory://a.xml'), $xml),
8192,
)),
@@ -62,7 +62,7 @@ public function test_a_malformed_document_is_refused_at_its_end(): void
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('XML Error: Extra content at the end of the document at line 1');
- iterator_to_array((new XMLNodeCursor('root/item'))->of(
+ iterator_to_array(new XMLNodeCursor('root/item')->of(
new StringSourceStream(path('memory://a.xml'), ' junk'),
8192,
));
@@ -73,7 +73,7 @@ public function test_libxml_reports_internally_at_every_stop_and_the_callers_mod
$previous = libxml_use_internal_errors(false);
try {
- $cursor = (new XMLNodeCursor('root/item'))->of(
+ $cursor = new XMLNodeCursor('root/item')->of(
new StringSourceStream(path('memory://a.xml'), ' '),
8192,
);
@@ -94,7 +94,7 @@ public function test_an_abandoned_walk_restores_the_callers_libxml_error_mode():
$previous = libxml_use_internal_errors(false);
try {
- $cursor = (new XMLNodeCursor('root/item'))->of(
+ $cursor = new XMLNodeCursor('root/item')->of(
new StringSourceStream(path('memory://a.xml'), ' '),
8192,
);
@@ -112,11 +112,11 @@ public function test_failure_names_the_last_libxml_error(): void
$previous = libxml_use_internal_errors(true);
try {
- (new DOMDocument())->loadXML('');
+ new DOMDocument()->loadXML('');
static::assertMatchesRegularExpression(
'/^XML Error: .+ at line 1$/',
- (new XMLNodeCursor('a'))->failure()->getMessage(),
+ new XMLNodeCursor('a')->failure()->getMessage(),
);
} finally {
libxml_clear_errors();
diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/XMLNodesTest.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/XMLNodesTest.php
index bed7182119..320b6d229a 100644
--- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/XMLNodesTest.php
+++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/XMLNodesTest.php
@@ -125,7 +125,7 @@ public function test_an_error_libxml_holds_from_before_does_not_fail_the_read():
$previous = libxml_use_internal_errors(true);
try {
- (new DOMDocument())->loadXML('');
+ new DOMDocument()->loadXML('');
static::assertSame(['- 1
'], SerializedNodes::of('root/item', '- 1
'));
} finally {
@@ -140,7 +140,7 @@ public function test_the_callers_libxml_error_mode_holds_at_every_yield_and_afte
$previous = libxml_use_internal_errors($internalErrors);
try {
- $nodes = (new XMLNodes('root/item'))->documents(
+ $nodes = new XMLNodes('root/item')->documents(
new StringSourceStream(path('memory://a.xml'), '- 1
- 2
'),
8192,
);
@@ -160,7 +160,7 @@ public function test_an_abandoned_read_restores_the_callers_libxml_error_mode():
$previous = libxml_use_internal_errors(false);
try {
- $nodes = (new XMLNodes('root/item'))->documents(
+ $nodes = new XMLNodes('root/item')->documents(
new StringSourceStream(path('memory://a.xml'), '- 1
- 2
'),
8192,
);
@@ -201,7 +201,7 @@ public function test_texts_keep_the_callers_libxml_error_mode_at_every_yield():
$previous = libxml_use_internal_errors(false);
try {
- $texts = (new XMLNodes('root/item'))->texts(
+ $texts = new XMLNodes('root/item')->texts(
new StringSourceStream(path('memory://a.xml'), '- 1
- 2
'),
8192,
);
@@ -223,7 +223,7 @@ public function test_texts_refuse_a_malformed_document(): void
'/^XML Error: Opening and ending tag mismatch: item line 1 and wrong at line 1$/',
);
- iterator_to_array((new XMLNodes('root/item'))->texts(
+ iterator_to_array(new XMLNodes('root/item')->texts(
new StringSourceStream(path('memory://a.xml'), '- 1
- 2
'),
8192,
));
diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLEncoderTest.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLEncoderTest.php
index 8387903a71..ee68ed042c 100644
--- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLEncoderTest.php
+++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLEncoderTest.php
@@ -140,15 +140,15 @@ public function test_both_writers_encode_a_batch_to_the_same_bytes(
): void {
$batch = array_to_rows($rows, schema(...$definitions));
- static::assertSame($expected, (new XMLEncoder(new StringXMLWriter()))->encode($batch));
- static::assertSame($expected, (new XMLEncoder(new DOMDocumentWriter()))->encode($batch));
+ static::assertSame($expected, new XMLEncoder(new StringXMLWriter())->encode($batch));
+ static::assertSame($expected, new XMLEncoder(new DOMDocumentWriter())->encode($batch));
}
public function test_encodes_datetime_and_date_with_the_configured_formats(): void
{
static::assertSame(
"2024-08-0101/08/2024
\n",
- (new XMLEncoder(new StringXMLWriter(), dateTimeFormat: 'Y-m-d', dateFormat: 'd/m/Y'))->encode(array_to_rows(
+ new XMLEncoder(new StringXMLWriter(), dateTimeFormat: 'Y-m-d', dateFormat: 'd/m/Y')->encode(array_to_rows(
[['at' => new DateTimeImmutable('2024-08-01 10:00:00'), 'on' => new DateTimeImmutable('2024-08-01')]],
schema(datetime_schema('at'), date_schema('on')),
)),
@@ -159,7 +159,7 @@ public function test_uses_the_configured_element_names_and_attribute_prefix(): v
{
static::assertSame(
'- a
x1' . "\n",
- (new XMLEncoder(
+ new XMLEncoder(
new StringXMLWriter(),
attributePrefix: '@',
listElementName: 'item',
@@ -167,7 +167,7 @@ public function test_uses_the_configured_element_names_and_attribute_prefix(): v
mapElementKeyName: 'k',
mapElementValueName: 'v',
rowElementName: 'record',
- ))->encode(array_to_rows(
+ )->encode(array_to_rows(
[['@id' => 1, 'l' => ['a'], 'm' => ['x' => 1]]],
schema(
int_schema('@id'),
@@ -182,7 +182,7 @@ public function test_a_null_in_an_attribute_column_is_refused(): void
{
$this->expectException(CastingException::class);
- (new XMLEncoder(new StringXMLWriter()))->encode(array_to_rows([[
+ new XMLEncoder(new StringXMLWriter())->encode(array_to_rows([[
'_id' => null,
]], schema(int_schema('_id', nullable: true))));
}
@@ -194,7 +194,7 @@ public function test_a_row_element_name_dom_refuses_is_refused_by_either_writer(
foreach ([new StringXMLWriter(), new DOMDocumentWriter()] as $writer) {
try {
- (new XMLEncoder($writer, rowElementName: '1 row'))->encode($rows);
+ new XMLEncoder($writer, rowElementName: '1 row')->encode($rows);
} catch (DOMException) {
$refused++;
}
diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLFileWriterTest.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLFileWriterTest.php
index 24995ac238..18bdaf4e89 100644
--- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLFileWriterTest.php
+++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLFileWriterTest.php
@@ -39,7 +39,7 @@ public function test_a_sink_that_wrote_nothing_closes_without_a_root_end(): void
$filesystem = memory_filesystem();
$stream = $filesystem->writeTo(path('memory://out.xml'));
- (new XMLFileWriter($stream, new XMLEncoder(new StringXMLWriter()), "\n\n", 'root'))->close();
+ new XMLFileWriter($stream, new XMLEncoder(new StringXMLWriter()), "\n\n", 'root')->close();
$stream->close();
static::assertSame('', $filesystem->readFrom(path('memory://out.xml'))->content());
diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLLoaderTest.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLLoaderTest.php
index 3348aa6167..6767294aa1 100644
--- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLLoaderTest.php
+++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLLoaderTest.php
@@ -43,7 +43,7 @@ final class XMLLoaderTest extends FlowTestCase
public function test_setting_content_type_on_path(): void
{
static::assertEquals(
- (new XMLLoader(path(__DIR__ . '/file.csv'), new DOMDocumentWriter()))
+ new XMLLoader(path(__DIR__ . '/file.csv'), new DOMDocumentWriter())
->destination()
->getOption(Option::CONTENT_TYPE),
ContentType::XML,
@@ -170,25 +170,23 @@ public function test_a_live_filesystem_does_not_describe(): void
public function test_a_custom_xml_writer_does_not_describe(): void
{
static::assertNull(
- (new XMLLoader(
- ($scratch = ReaderRoundTrip::scratch('xml-custom'))->suffix('/rows.xml'),
- new class implements XMLWriter {
- public function attributes(string $name, array $values): array
- {
- return [];
- }
-
- public function elements(string $name, array $values): array
- {
- return [];
- }
-
- public function write(XMLNode $node): string
- {
- return '';
- }
- },
- ))->describe(),
+ new XMLLoader(($scratch = ReaderRoundTrip::scratch('xml-custom'))->suffix('/rows.xml'), new class implements
+ XMLWriter {
+ public function attributes(string $name, array $values): array
+ {
+ return [];
+ }
+
+ public function elements(string $name, array $values): array
+ {
+ return [];
+ }
+
+ public function write(XMLNode $node): string
+ {
+ return '';
+ }
+ })->describe(),
);
native_local_filesystem()->rm($scratch);
diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLValueNodesTest.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLValueNodesTest.php
index 08eebc75f0..f641cdb877 100644
--- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLValueNodesTest.php
+++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLValueNodesTest.php
@@ -98,7 +98,7 @@ public static function nodes(): Generator
#[DataProvider('nodes')]
public function test_of(Type $type, mixed $physical, XMLNode $expected): void
{
- static::assertEquals($expected, (new XMLValueNodes(new TextValues()))->of('v', $type, $physical));
+ static::assertEquals($expected, new XMLValueNodes(new TextValues())->of('v', $type, $physical));
}
public function test_of_uses_the_configured_names_and_prefix(): void
@@ -119,7 +119,7 @@ public function test_a_member_without_the_prefix_is_a_node(): void
{
static::assertEquals(
XMLNode::flatNode('id', '7'),
- (new XMLValueNodes(new TextValues()))->member('id', type_integer(), 7),
+ new XMLValueNodes(new TextValues())->member('id', type_integer(), 7),
);
}
@@ -127,7 +127,7 @@ public function test_a_null_member_that_is_an_attribute_is_refused(): void
{
$this->expectException(CastingException::class);
- (new XMLValueNodes(new TextValues()))->member('_id', type_optional(type_integer()), null);
+ new XMLValueNodes(new TextValues())->member('_id', type_optional(type_integer()), null);
}
public function test_a_structure_with_an_optional_element_is_refused_at_any_depth(): void
@@ -160,7 +160,7 @@ public function test_types_without_optional_elements_are_accepted(): void
{
$this->expectNotToPerformAssertions();
- (new XMLValueNodes(new TextValues()))->refuseOptionalElements(type_list(type_structure([
+ new XMLValueNodes(new TextValues())->refuseOptionalElements(type_list(type_structure([
'a' => type_optional(type_integer()),
'm' => type_map(type_string(), type_date()),
])));
diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLWriter/DOMDocumentWriterTest.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLWriter/DOMDocumentWriterTest.php
index 9b57dbcce0..fc4162b527 100644
--- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLWriter/DOMDocumentWriterTest.php
+++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLWriter/DOMDocumentWriterTest.php
@@ -22,25 +22,25 @@ public function test_writing_empty_child_node(): void
{
static::assertEquals(
'',
- (new DOMDocumentWriter())->write(XMLNode::nestedNode('root')->append(XMLNode::nestedNode('child'))),
+ new DOMDocumentWriter()->write(XMLNode::nestedNode('root')->append(XMLNode::nestedNode('child'))),
);
}
public function test_writing_empty_node(): void
{
- static::assertEquals('', (new DOMDocumentWriter())->write(XMLNode::nestedNode('root')));
+ static::assertEquals('', new DOMDocumentWriter()->write(XMLNode::nestedNode('root')));
}
public function test_writing_node_with_empty_string_value(): void
{
- static::assertEquals('', (new DOMDocumentWriter())->write(XMLNode::flatNode('root', '')));
+ static::assertEquals('', new DOMDocumentWriter()->write(XMLNode::flatNode('root', '')));
}
public function test_writing_xml(): void
{
static::assertEquals(
'valuevaluevalue',
- (new DOMDocumentWriter())->write(
+ new DOMDocumentWriter()->write(
XMLNode::nestedNode('root')
->append(XMLNode::flatNode('child', 'value'))
->append(
@@ -56,7 +56,7 @@ public function test_writing_xml_with_attribute(): void
{
static::assertEquals(
'value',
- (new DOMDocumentWriter())->write(XMLNode::flatNode('root', 'value')->appendAttribute(new XMLAttribute(
+ new DOMDocumentWriter()->write(XMLNode::flatNode('root', 'value')->appendAttribute(new XMLAttribute(
'attribute',
'value',
))),
@@ -67,7 +67,7 @@ public function test_writing_xml_with_empty_attribute(): void
{
static::assertEquals(
'value',
- (new DOMDocumentWriter())->write(XMLNode::flatNode('root', 'value')->appendAttribute(new XMLAttribute(
+ new DOMDocumentWriter()->write(XMLNode::flatNode('root', 'value')->appendAttribute(new XMLAttribute(
'attribute',
'',
))),
@@ -101,37 +101,34 @@ public function test_attributes_are_what_write_renders_for_an_attribute(string $
public function test_a_null_element_is_an_empty_element(): void
{
- static::assertSame(
- ['', 'x', ''],
- (new DOMDocumentWriter())->elements('v', [null, 'x', '']),
- );
+ static::assertSame(['', 'x', ''], new DOMDocumentWriter()->elements('v', [null, 'x', '']));
}
public function test_a_null_attribute_is_refused(): void
{
$this->expectException(CastingException::class);
- (new DOMDocumentWriter())->attributes('a', ['x', null]);
+ new DOMDocumentWriter()->attributes('a', ['x', null]);
}
public function test_no_values_give_no_elements_and_no_attributes(): void
{
- static::assertSame([], (new DOMDocumentWriter())->elements('v', []));
- static::assertSame([], (new DOMDocumentWriter())->attributes('a', []));
+ static::assertSame([], new DOMDocumentWriter()->elements('v', []));
+ static::assertSame([], new DOMDocumentWriter()->attributes('a', []));
}
public function test_elements_of_a_name_dom_refuses_are_refused_with_its_exception(): void
{
$this->expectException(DOMException::class);
- (new DOMDocumentWriter())->elements('1 bad', ['x']);
+ new DOMDocumentWriter()->elements('1 bad', ['x']);
}
public function test_attributes_of_a_name_dom_refuses_are_refused_with_its_exception(): void
{
$this->expectException(DOMException::class);
- (new DOMDocumentWriter())->attributes('1 bad', ['x']);
+ new DOMDocumentWriter()->attributes('1 bad', ['x']);
}
public function test_describe_round_trips(): void
@@ -151,7 +148,7 @@ public function test_the_writer_declares_the_xml_extensions(): void
{
static::assertSame(
['dom', 'xml', 'xmlreader', 'xmlwriter'],
- (new DOMDocumentWriter())->describe()?->extensions(),
+ new DOMDocumentWriter()->describe()?->extensions(),
);
}
}
diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLWriter/StringXMLWriterTest.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLWriter/StringXMLWriterTest.php
index 5c693725b6..b8c7a41fae 100644
--- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLWriter/StringXMLWriterTest.php
+++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLWriter/StringXMLWriterTest.php
@@ -99,7 +99,7 @@ public function test_an_attribute_name_dom_refuses_is_refused_with_its_exception
$this->expectException(DOMException::class);
$this->expectExceptionMessage('Invalid Character Error');
- (new StringXMLWriter())->write(XMLNode::nested('row', new XMLAttribute($name, '1')));
+ new StringXMLWriter()->write(XMLNode::nested('row', new XMLAttribute($name, '1')));
}
#[TestWith(['order id'])]
@@ -110,7 +110,7 @@ public function test_an_element_name_dom_refuses_is_refused_with_its_exception(s
$this->expectException(DOMException::class);
$this->expectExceptionMessage('Invalid Character Error');
- (new StringXMLWriter())->write(XMLNode::flatNode($name, '1'));
+ new StringXMLWriter()->write(XMLNode::flatNode($name, '1'));
}
public function test_a_refused_name_stays_refused(): void
@@ -130,7 +130,7 @@ public function test_a_refused_name_stays_refused(): void
#[DataProvider('nodes')]
public function test_writes_what_dom_document_writer_writes(XMLNode $node): void
{
- static::assertSame((new DOMDocumentWriter())->write($node), (new StringXMLWriter())->write($node));
+ static::assertSame(new DOMDocumentWriter()->write($node), new StringXMLWriter()->write($node));
}
#[DataProvider('nodesOlderLibxmlWritesDifferently')]
@@ -138,7 +138,7 @@ public function test_writes_what_dom_document_writer_writes_on_libxml_2_14_and_l
XMLNode $node,
string $xml,
): void {
- static::assertSame($xml, (new StringXMLWriter())->write($node));
+ static::assertSame($xml, new StringXMLWriter()->write($node));
}
#[DataProviderExternal(XMLWriterValues::class, 'values')]
@@ -168,34 +168,34 @@ public function test_attributes_are_what_write_renders_for_an_attribute(string $
public function test_a_null_element_is_an_empty_element(): void
{
- static::assertSame(['', 'x', ''], (new StringXMLWriter())->elements('v', [null, 'x', '']));
+ static::assertSame(['', 'x', ''], new StringXMLWriter()->elements('v', [null, 'x', '']));
}
public function test_a_null_attribute_is_refused(): void
{
$this->expectException(CastingException::class);
- (new StringXMLWriter())->attributes('a', ['x', null]);
+ new StringXMLWriter()->attributes('a', ['x', null]);
}
public function test_no_values_give_no_elements_and_no_attributes(): void
{
- static::assertSame([], (new StringXMLWriter())->elements('v', []));
- static::assertSame([], (new StringXMLWriter())->attributes('a', []));
+ static::assertSame([], new StringXMLWriter()->elements('v', []));
+ static::assertSame([], new StringXMLWriter()->attributes('a', []));
}
public function test_elements_of_a_name_dom_refuses_are_refused_with_its_exception(): void
{
$this->expectException(DOMException::class);
- (new StringXMLWriter())->elements('1 bad', ['x']);
+ new StringXMLWriter()->elements('1 bad', ['x']);
}
public function test_attributes_of_a_name_dom_refuses_are_refused_with_its_exception(): void
{
$this->expectException(DOMException::class);
- (new StringXMLWriter())->attributes('1 bad', ['x']);
+ new StringXMLWriter()->attributes('1 bad', ['x']);
}
public function test_describe_round_trips(): void
@@ -213,9 +213,6 @@ public function test_describe_round_trips(): void
public function test_the_writer_declares_the_xml_extensions(): void
{
- static::assertSame(
- ['dom', 'xml', 'xmlreader', 'xmlwriter'],
- (new StringXMLWriter())->describe()?->extensions(),
- );
+ static::assertSame(['dom', 'xml', 'xmlreader', 'xmlwriter'], new StringXMLWriter()->describe()?->extensions());
}
}
diff --git a/src/bridge/filesystem/async-aws/composer.json b/src/bridge/filesystem/async-aws/composer.json
index 9f233d50c4..7bf1db390e 100644
--- a/src/bridge/filesystem/async-aws/composer.json
+++ b/src/bridge/filesystem/async-aws/composer.json
@@ -14,11 +14,11 @@
"cloud"
],
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/filesystem": "self.version",
"flow-php/types": "self.version",
"async-aws/s3": "^2.6 || ^3.0",
- "symfony/http-client": "^6.4 || ^7.4 || ^8.0"
+ "symfony/http-client": "^7.4 || ^8.0"
},
"config": {
"optimize-autoloader": true,
diff --git a/src/bridge/filesystem/async-aws/src/Flow/Filesystem/Bridge/AsyncAWS/AsyncAWSS3DestinationStream.php b/src/bridge/filesystem/async-aws/src/Flow/Filesystem/Bridge/AsyncAWS/AsyncAWSS3DestinationStream.php
index 2e4412cd80..17258748d5 100644
--- a/src/bridge/filesystem/async-aws/src/Flow/Filesystem/Bridge/AsyncAWS/AsyncAWSS3DestinationStream.php
+++ b/src/bridge/filesystem/async-aws/src/Flow/Filesystem/Bridge/AsyncAWS/AsyncAWSS3DestinationStream.php
@@ -98,7 +98,7 @@ public static function openBlank(
$s3Client,
$bucket,
$path,
- ['ContentType' => (new ContentTypeDetector())->from($path)],
+ ['ContentType' => new ContentTypeDetector()->from($path)],
$blockFactory,
$blockSize,
);
@@ -132,7 +132,7 @@ public static function openCopy(
$bucket,
$target,
[
- 'ContentType' => $sourceHead->getContentType() ?? (new ContentTypeDetector())->from($target),
+ 'ContentType' => $sourceHead->getContentType() ?? new ContentTypeDetector()->from($target),
'ContentEncoding' => $sourceHead->getContentEncoding(),
'CacheControl' => $sourceHead->getCacheControl(),
'ContentDisposition' => $sourceHead->getContentDisposition(),
diff --git a/src/bridge/filesystem/async-aws/src/Flow/Filesystem/Bridge/AsyncAWS/AsyncAWSS3SourceStream.php b/src/bridge/filesystem/async-aws/src/Flow/Filesystem/Bridge/AsyncAWS/AsyncAWSS3SourceStream.php
index 2deedf31b3..4557858895 100644
--- a/src/bridge/filesystem/async-aws/src/Flow/Filesystem/Bridge/AsyncAWS/AsyncAWSS3SourceStream.php
+++ b/src/bridge/filesystem/async-aws/src/Flow/Filesystem/Bridge/AsyncAWS/AsyncAWSS3SourceStream.php
@@ -78,7 +78,7 @@ public function read(int $length, int $offset): string
$response = $this->s3Client->getObject([
'Bucket' => $this->bucket,
'Key' => ltrim($this->path->path(), '/'),
- 'Range' => (new Range($offset, $length))->toString(),
+ 'Range' => new Range($offset, $length)->toString(),
]);
return $response->getBody()->getContentAsString();
@@ -136,7 +136,7 @@ private function chunks(int $rangeLength): Generator
->getObject([
'Bucket' => $this->bucket,
'Key' => ltrim($this->path->path(), '/'),
- 'Range' => (new Range($offset, $rangeLength))->toString(),
+ 'Range' => new Range($offset, $rangeLength)->toString(),
])
->getBody()
->getChunks() as $chunk) {
diff --git a/src/bridge/filesystem/async-aws/src/Flow/Filesystem/Bridge/AsyncAWS/Options.php b/src/bridge/filesystem/async-aws/src/Flow/Filesystem/Bridge/AsyncAWS/Options.php
index f07cc75466..ec42b86379 100644
--- a/src/bridge/filesystem/async-aws/src/Flow/Filesystem/Bridge/AsyncAWS/Options.php
+++ b/src/bridge/filesystem/async-aws/src/Flow/Filesystem/Bridge/AsyncAWS/Options.php
@@ -92,7 +92,7 @@ public static function fromArray(array $data): self
);
}
- return (new self())
+ return new self()
->withBlockFactory(
new NativeLocalFileBlocksFactory(
$data['block_location'],
diff --git a/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Integration/AsyncAWSS3DestinationStreamTest.php b/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Integration/AsyncAWSS3DestinationStreamTest.php
index 16cd33e74e..f221f9ff50 100644
--- a/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Integration/AsyncAWSS3DestinationStreamTest.php
+++ b/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Integration/AsyncAWSS3DestinationStreamTest.php
@@ -30,7 +30,7 @@ public function test_closing_streams_leaves_no_blocks_behind(): void
$fs = aws_s3_filesystem(
$this->bucket(),
$this->s3Client(),
- (new Options())->withBlockFactory(new NativeLocalFileBlocksFactory($blockLocation)),
+ new Options()->withBlockFactory(new NativeLocalFileBlocksFactory($blockLocation)),
);
$fs->writeTo(path('aws-s3://never_written.txt'))->close();
diff --git a/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Integration/AsyncAWSS3FilesystemFileFastPathTest.php b/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Integration/AsyncAWSS3FilesystemFileFastPathTest.php
index 63063c2d07..6f928ae85b 100644
--- a/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Integration/AsyncAWSS3FilesystemFileFastPathTest.php
+++ b/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Integration/AsyncAWSS3FilesystemFileFastPathTest.php
@@ -20,7 +20,7 @@ final class AsyncAWSS3FilesystemFileFastPathTest extends AsyncAWSS3TestCase
public function test_list_disabled_fast_path_falls_back_to_listing_for_single_file(): void
{
$client = $this->recordingClient();
- $fs = aws_s3_filesystem($this->bucket(), $client, (new Options())->withFileFastPath(false));
+ $fs = aws_s3_filesystem($this->bucket(), $client, new Options()->withFileFastPath(false));
$fs->writeTo(path('aws-s3://var/orders/orders.csv'))->append('a,b')->close();
diff --git a/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/AsyncAWSS3FilesystemTest.php b/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/AsyncAWSS3FilesystemTest.php
index 149a807270..2065064f5c 100644
--- a/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/AsyncAWSS3FilesystemTest.php
+++ b/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/AsyncAWSS3FilesystemTest.php
@@ -130,7 +130,7 @@ public function test_a_filesystem_with_a_custom_block_factory_has_no_configurati
aws_s3_filesystem(
'bucket',
['region' => 'eu-west-1'],
- (new Options())->withBlockFactory($this->createStub(BlockFactory::class)),
+ new Options()->withBlockFactory($this->createStub(BlockFactory::class)),
)->normalize(),
);
}
diff --git a/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/AsyncAWSS3SourceStreamTest.php b/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/AsyncAWSS3SourceStreamTest.php
index 9d45a55d44..23b4f1b2b0 100644
--- a/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/AsyncAWSS3SourceStreamTest.php
+++ b/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/AsyncAWSS3SourceStreamTest.php
@@ -20,11 +20,11 @@ public function test_iterate_reads_many_chunks_from_one_ranged_request(): void
$calls = [];
iterator_to_array(
- (new AsyncAWSS3SourceStream(
+ new AsyncAWSS3SourceStream(
path('aws-s3://f.bin'),
'bucket',
S3ClientMother::copying(20_000, $calls),
- ))->iterate(8192),
+ )->iterate(8192),
false,
);
@@ -36,11 +36,11 @@ public function test_iterate_requests_one_range_per_chunk_above_the_default_rang
$calls = [];
iterator_to_array(
- (new AsyncAWSS3SourceStream(
+ new AsyncAWSS3SourceStream(
path('aws-s3://f.bin'),
'bucket',
S3ClientMother::copying(25_000_000, $calls),
- ))->iterate(10_000_000),
+ )->iterate(10_000_000),
false,
);
@@ -60,11 +60,11 @@ public function test_iterate_yields_the_content_in_pieces_of_the_requested_lengt
static::assertSame(
['abc', 'def', 'gh'],
iterator_to_array(
- (new AsyncAWSS3SourceStream(
+ new AsyncAWSS3SourceStream(
path('aws-s3://f.txt'),
'bucket',
S3ClientMother::serving('abcdefgh'),
- ))->iterate(3),
+ )->iterate(3),
false,
),
);
@@ -84,11 +84,11 @@ public function test_read_lines_conforms_to_the_source_stream_contract(
): void {
static::assertSame(
$expected,
- iterator_to_array((new AsyncAWSS3SourceStream(
+ iterator_to_array(new AsyncAWSS3SourceStream(
path('aws-s3://f.txt'),
'bucket',
S3ClientMother::serving($content),
- ))->readLines($separator, $length)),
+ )->readLines($separator, $length)),
);
}
@@ -97,11 +97,7 @@ public function test_read_lines_stops_when_a_read_returns_no_bytes(): void
static::assertSame(
[],
iterator_to_array(
- (new AsyncAWSS3SourceStream(
- path('aws-s3://f.txt'),
- 'bucket',
- S3ClientMother::shortRead(5),
- ))->readLines(),
+ new AsyncAWSS3SourceStream(path('aws-s3://f.txt'), 'bucket', S3ClientMother::shortRead(5))->readLines(),
),
);
}
diff --git a/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/ConfiguredS3ClientTest.php b/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/ConfiguredS3ClientTest.php
index 2380b08829..a08aab833a 100644
--- a/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/ConfiguredS3ClientTest.php
+++ b/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/ConfiguredS3ClientTest.php
@@ -32,7 +32,7 @@ public function test_the_configuration_is_kept_verbatim(): void
'endpoint' => 'http://s3.test',
];
- static::assertSame($configuration, (new ConfiguredS3Client($configuration))->normalize());
+ static::assertSame($configuration, new ConfiguredS3Client($configuration)->normalize());
}
public function test_the_client_is_built_once(): void
@@ -56,14 +56,14 @@ public function test_timeout_ends_a_call_to_a_silent_server(): void
{
$server = stream_socket_server('tcp://127.0.0.1:0');
static::assertNotFalse($server);
- $client = (new ConfiguredS3Client([
+ $client = new ConfiguredS3Client([
'region' => 'eu-west-1',
'accessKeyId' => 'k',
'accessKeySecret' => 's',
'pathStyleEndpoint' => 'true',
'endpoint' => 'http://' . type_string()->assert(stream_socket_get_name($server, false)),
'http' => ['timeout' => 0.2, 'max_duration' => 0, 'max_retries' => 0],
- ]))->client();
+ ])->client();
$start = microtime(true);
try {
@@ -79,14 +79,14 @@ public function test_max_duration_bounds_a_call_with_its_retries(): void
{
$server = stream_socket_server('tcp://127.0.0.1:0');
static::assertNotFalse($server);
- $client = (new ConfiguredS3Client([
+ $client = new ConfiguredS3Client([
'region' => 'eu-west-1',
'accessKeyId' => 'k',
'accessKeySecret' => 's',
'pathStyleEndpoint' => 'true',
'endpoint' => 'http://' . type_string()->assert(stream_socket_get_name($server, false)),
'http' => ['timeout' => 0.2, 'max_duration' => 0.5, 'max_retries' => 3],
- ]))->client();
+ ])->client();
$start = microtime(true);
try {
@@ -117,7 +117,7 @@ public function test_an_unknown_client_option_is_reported_by_async_aws(): void
'protocol' => 'aws-s3',
'bucket' => 'bucket',
'client' => ['regions' => ['eu-west-1'], 'http' => ['timeout' => 1]],
- 'options' => (new Options())->normalize(),
+ 'options' => new Options()->normalize(),
])->readFrom(path('aws-s3://a.txt'));
}
diff --git a/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/OptionsTest.php b/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/OptionsTest.php
index 14fb7c33a6..e0df33c426 100644
--- a/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/OptionsTest.php
+++ b/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/OptionsTest.php
@@ -22,7 +22,7 @@ public function test_block_factory_can_be_replaced(): void
static::assertSame(
$blockFactory,
- (new Options())
+ new Options()
->withBlockFactory($blockFactory)
->blockFactory(),
);
@@ -30,7 +30,7 @@ public function test_block_factory_can_be_replaced(): void
public function test_normalize_round_trips(): void
{
- $options = (new Options())
+ $options = new Options()
->withFileFastPath(false)
->withBulkDelete(false)
->withBlockSize(6 * 1024 * 1024)
@@ -63,7 +63,7 @@ public function test_the_default_part_size_round_trips(): void
public function test_block_permissions_round_trip(): void
{
- $options = (new Options())->withBlockFactory(
+ $options = new Options()->withBlockFactory(
new NativeLocalFileBlocksFactory(sys_get_temp_dir(), Permissions::private()),
);
$normalized = $options->normalize();
@@ -76,7 +76,7 @@ public function test_block_permissions_round_trip(): void
public function test_a_custom_block_factory_does_not_normalize(): void
{
static::assertNull(
- (new Options())
+ new Options()
->withBlockFactory($this->createStub(BlockFactory::class))
->normalize(),
);
@@ -96,7 +96,7 @@ public function test_copy_part_size_outside_5_mib_and_5_gb_is_rejected(int $byte
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage("Copy part size must be between 5 MiB and 5 GB, got {$bytes} bytes");
- (new Options())->withCopyPartSize($bytes);
+ new Options()->withCopyPartSize($bytes);
}
#[TestWith([5242880])]
@@ -105,7 +105,7 @@ public function test_copy_part_size_at_5_mib_and_5_gb_is_accepted(int $bytes): v
{
static::assertSame(
$bytes,
- (new Options())
+ new Options()
->withCopyPartSize($bytes)
->copyPartSize(),
);
@@ -113,6 +113,6 @@ public function test_copy_part_size_at_5_mib_and_5_gb_is_accepted(int $bytes): v
public function test_copy_part_size_defaults_to_256_mib(): void
{
- static::assertSame(268435456, (new Options())->normalize()['copy_part_size'] ?? null);
+ static::assertSame(268435456, new Options()->normalize()['copy_part_size'] ?? null);
}
}
diff --git a/src/bridge/filesystem/azure/composer.json b/src/bridge/filesystem/azure/composer.json
index 66bb9e2b2b..004b66dd1e 100644
--- a/src/bridge/filesystem/azure/composer.json
+++ b/src/bridge/filesystem/azure/composer.json
@@ -14,10 +14,10 @@
"cloud"
],
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/filesystem": "self.version",
"flow-php/azure-sdk": "self.version",
- "symfony/http-client": "^6.4 || ^7.4 || ^8.0"
+ "symfony/http-client": "^7.4 || ^8.0"
},
"config": {
"optimize-autoloader": true,
diff --git a/src/bridge/filesystem/azure/src/Flow/Filesystem/Bridge/Azure/AzureBlobFilesystem.php b/src/bridge/filesystem/azure/src/Flow/Filesystem/Bridge/Azure/AzureBlobFilesystem.php
index f7f252f73c..87f8445ac2 100644
--- a/src/bridge/filesystem/azure/src/Flow/Filesystem/Bridge/Azure/AzureBlobFilesystem.php
+++ b/src/bridge/filesystem/azure/src/Flow/Filesystem/Bridge/Azure/AzureBlobFilesystem.php
@@ -224,7 +224,7 @@ public function mv(Path $from, Path $to): bool
$service->putBlockBlobBlockList(
$target,
new BlockList(...$blocks),
- (new PutBlockBlobBlockListOptions())
+ new PutBlockBlobBlockListOptions()
->withContentType($properties->contentType())
->withContentEncoding($properties->contentEncoding())
->withContentLanguage($properties->contentLanguage())
diff --git a/src/bridge/filesystem/azure/src/Flow/Filesystem/Bridge/Azure/AzureBlobSourceStream.php b/src/bridge/filesystem/azure/src/Flow/Filesystem/Bridge/Azure/AzureBlobSourceStream.php
index 27532b9382..9d41917f43 100644
--- a/src/bridge/filesystem/azure/src/Flow/Filesystem/Bridge/Azure/AzureBlobSourceStream.php
+++ b/src/bridge/filesystem/azure/src/Flow/Filesystem/Bridge/Azure/AzureBlobSourceStream.php
@@ -75,7 +75,7 @@ public function read(int $length, int $offset): string
$offset = $offset < 0 ? ($this->size() ?? 0) + $offset : $offset;
return $this->blobService
- ->getBlob($this->path->path(), (new GetBlobOptions())->withRange(new Range($offset, $offset + $length - 1)))
+ ->getBlob($this->path->path(), new GetBlobOptions()->withRange(new Range($offset, $offset + $length - 1)))
->content();
}
@@ -125,7 +125,7 @@ private function chunks(int $rangeLength): Generator
$body = $this->blobService
->getBlob(
$this->path->path(),
- (new GetBlobOptions())->withRange(new Range($offset, $offset + $rangeLength - 1)),
+ new GetBlobOptions()->withRange(new Range($offset, $offset + $rangeLength - 1)),
)
->stream();
$received = 0;
diff --git a/src/bridge/filesystem/azure/src/Flow/Filesystem/Bridge/Azure/Options.php b/src/bridge/filesystem/azure/src/Flow/Filesystem/Bridge/Azure/Options.php
index 55de9bc978..4cb53a546c 100644
--- a/src/bridge/filesystem/azure/src/Flow/Filesystem/Bridge/Azure/Options.php
+++ b/src/bridge/filesystem/azure/src/Flow/Filesystem/Bridge/Azure/Options.php
@@ -135,7 +135,7 @@ public static function fromArray(array $data): self
);
}
- $options = (new self())
+ $options = new self()
->withBlockFactory(
new NativeLocalFileBlocksFactory(
$data['block_location'],
diff --git a/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Integration/AzureBlobDestinationStreamTest.php b/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Integration/AzureBlobDestinationStreamTest.php
index af216321e1..d87b4105ce 100644
--- a/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Integration/AzureBlobDestinationStreamTest.php
+++ b/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Integration/AzureBlobDestinationStreamTest.php
@@ -27,7 +27,7 @@ public function test_closing_empty_stream(): void
public function test_writing_content_bigger_than_block_size_to_azure(): void
{
- $fs = azure_filesystem($this->blobService('flow-php'), (new Options())->withBlockSize(100));
+ $fs = azure_filesystem($this->blobService('flow-php'), new Options()->withBlockSize(100));
$stream = $fs->writeTo(path('azure-blob://file.txt'));
$stream->append($content = str_repeat('a', 200));
@@ -45,7 +45,7 @@ public function test_writing_content_bigger_than_block_size_to_azure(): void
public function test_writing_content_bigger_than_block_size_is_invisible_until_close(): void
{
$blocks = path('azure-blob://blocks-' . bin2hex(random_bytes(4)) . '.txt');
- $fs = azure_filesystem($this->blobService('flow-php'), (new Options())->withBlockSize(100));
+ $fs = azure_filesystem($this->blobService('flow-php'), new Options()->withBlockSize(100));
$stream = $fs->writeTo($blocks);
$stream->append($content = str_repeat('a', 250));
diff --git a/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Integration/AzureBlobFilesystemFileFastPathTest.php b/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Integration/AzureBlobFilesystemFileFastPathTest.php
index 78f4f936ce..0ff87b116c 100644
--- a/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Integration/AzureBlobFilesystemFileFastPathTest.php
+++ b/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Integration/AzureBlobFilesystemFileFastPathTest.php
@@ -18,7 +18,7 @@ final class AzureBlobFilesystemFileFastPathTest extends AzureBlobServiceTestCase
public function test_list_disabled_fast_path_falls_back_to_listing_for_single_file(): void
{
$blobService = new RecordingBlobService($this->blobService('flow-php-list-opt-disabled'));
- $fs = azure_filesystem($blobService, (new Options())->withFileFastPath(false));
+ $fs = azure_filesystem($blobService, new Options()->withFileFastPath(false));
$fs->writeTo(path('azure-blob://orders/orders.csv'))->append('a,b')->close();
diff --git a/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Integration/AzureBlobFilesystemTest.php b/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Integration/AzureBlobFilesystemTest.php
index 0776ac60c7..aaf635b951 100644
--- a/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Integration/AzureBlobFilesystemTest.php
+++ b/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Integration/AzureBlobFilesystemTest.php
@@ -112,7 +112,7 @@ public function test_appending_to_existing_blob(): void
public function test_appending_to_existing_block_blob_new_blocks(): void
{
- $fs = azure_filesystem($this->blobService('flow-php'), (new Options())->withBlockSize(1024));
+ $fs = azure_filesystem($this->blobService('flow-php'), new Options()->withBlockSize(1024));
$stream = $fs->writeTo(path('azure-blob://file.txt'));
$output = '';
@@ -142,7 +142,7 @@ public function test_appending_to_existing_block_blob_new_blocks(): void
public function test_appending_to_existing_non_block_blob_new_blocks(): void
{
- $fs = azure_filesystem($this->blobService('flow-php'), (new Options())->withBlockSize(1024));
+ $fs = azure_filesystem($this->blobService('flow-php'), new Options()->withBlockSize(1024));
$stream = $fs->writeTo(path('azure-blob://file.txt'));
$stream->append("This is first line\n");
@@ -311,7 +311,7 @@ public function test_mv_keeps_content_type_and_metadata(int $size): void
$service->putBlockBlobBlockList(
'mv_properties_source.csv',
new BlockList(new Block($blockId, BlockState::UNCOMMITTED)),
- (new PutBlockBlobBlockListOptions())
+ new PutBlockBlobBlockListOptions()
->withContentType('text/csv')
->withMetadata(['origin' => 'probe']),
);
@@ -516,7 +516,7 @@ public function test_writing_to_to_azure_from_resources(): void
public function test_writing_to_to_azure_using_blocks(): void
{
- $fs = azure_filesystem($this->blobService('flow-php'), (new Options())->withBlockSize(1024));
+ $fs = azure_filesystem($this->blobService('flow-php'), new Options()->withBlockSize(1024));
$stream = $fs->writeTo(path('azure-blob://block_blob.csv'));
diff --git a/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/AzureBlobSourceStreamTest.php b/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/AzureBlobSourceStreamTest.php
index 8f9767ca52..dba26f65bb 100644
--- a/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/AzureBlobSourceStreamTest.php
+++ b/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/AzureBlobSourceStreamTest.php
@@ -25,10 +25,10 @@ public function test_iterate_reads_many_chunks_from_one_ranged_request(): void
array_map(
strlen(...),
iterator_to_array(
- (new AzureBlobSourceStream(
+ new AzureBlobSourceStream(
path('azure-blob://f.bin'),
new InMemoryBlobService(str_repeat('x', 20_000), maxReads: 1),
- ))->iterate(8192),
+ )->iterate(8192),
false,
),
),
@@ -40,9 +40,7 @@ public function test_iterate_yields_the_content_in_pieces_of_the_requested_lengt
static::assertSame(
['abc', 'def', 'gh'],
iterator_to_array(
- (new AzureBlobSourceStream(path('azure-blob://f.txt'), new InMemoryBlobService('abcdefgh')))->iterate(
- 3,
- ),
+ new AzureBlobSourceStream(path('azure-blob://f.txt'), new InMemoryBlobService('abcdefgh'))->iterate(3),
false,
),
);
@@ -62,10 +60,10 @@ public function test_read_lines_conforms_to_the_source_stream_contract(
): void {
static::assertSame(
$expected,
- iterator_to_array((new AzureBlobSourceStream(
+ iterator_to_array(new AzureBlobSourceStream(
path('azure-blob://f.txt'),
new InMemoryBlobService($content),
- ))->readLines($separator, $length)),
+ )->readLines($separator, $length)),
);
}
@@ -74,7 +72,7 @@ public function test_read_lines_stops_when_a_read_returns_no_bytes(): void
static::assertSame(
[],
iterator_to_array(
- (new AzureBlobSourceStream(path('azure-blob://f.txt'), new InMemoryBlobService('', 5, 3)))->readLines(),
+ new AzureBlobSourceStream(path('azure-blob://f.txt'), new InMemoryBlobService('', 5, 3))->readLines(),
),
);
}
diff --git a/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/ConfiguredBlobServiceTest.php b/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/ConfiguredBlobServiceTest.php
index 6de153bbd7..5ca0a8ee70 100644
--- a/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/ConfiguredBlobServiceTest.php
+++ b/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/ConfiguredBlobServiceTest.php
@@ -67,11 +67,11 @@ public function test_an_azurite_service_is_built(): void
{
static::assertInstanceOf(
BlobServiceInterface::class,
- (new ConfiguredBlobService('account', 'container', 'c2VjcmV0', ['azurite' => [
+ new ConfiguredBlobService('account', 'container', 'c2VjcmV0', ['azurite' => [
'host' => '127.0.0.1',
'port' => '10000',
'https' => false,
- ]]))->blobService(),
+ ]])->blobService(),
);
}
diff --git a/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/OptionsTest.php b/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/OptionsTest.php
index b95c3d9707..49a6df038f 100644
--- a/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/OptionsTest.php
+++ b/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/OptionsTest.php
@@ -22,7 +22,7 @@ final class OptionsTest extends TestCase
{
public function test_normalize_round_trips_every_option(): void
{
- $options = (new Options())
+ $options = new Options()
->withBlockSize(1024)
->withBulkDelete(false)
->withFileFastPath(false)
@@ -51,7 +51,7 @@ public function test_the_defaults_round_trip(): void
public function test_block_permissions_round_trip(): void
{
- $options = (new Options())->withBlockFactory(
+ $options = new Options()->withBlockFactory(
new NativeLocalFileBlocksFactory(sys_get_temp_dir(), Permissions::private()),
);
$normalized = $options->normalize();
@@ -64,7 +64,7 @@ public function test_block_permissions_round_trip(): void
public function test_a_custom_block_factory_does_not_normalize(): void
{
static::assertNull(
- (new Options())
+ new Options()
->withBlockFactory($this->createStub(BlockFactory::class))
->normalize(),
);
@@ -79,7 +79,7 @@ public function test_from_array_refuses_a_missing_key(): void
public function test_copy_part_size_defaults_to_256_mib(): void
{
- static::assertSame(268435456, (new Options())->copyPartSize());
+ static::assertSame(268435456, new Options()->copyPartSize());
}
#[TestWith([0])]
@@ -92,12 +92,12 @@ public function test_copy_part_size_outside_1_byte_to_256_mib_is_refused(int $by
$bytes,
));
- (new Options())->withCopyPartSize($bytes);
+ new Options()->withCopyPartSize($bytes);
}
public function test_copy_part_size_round_trips(): void
{
- $options = (new Options())->withCopyPartSize(5 * 1024 * 1024);
+ $options = new Options()->withCopyPartSize(5 * 1024 * 1024);
$normalized = $options->normalize();
static::assertNotNull($normalized);
@@ -107,7 +107,7 @@ public function test_copy_part_size_round_trips(): void
public function test_from_array_refuses_a_configuration_without_copy_part_size(): void
{
- $normalized = (new Options())->normalize();
+ $normalized = new Options()->normalize();
static::assertNotNull($normalized);
unset($normalized['copy_part_size']);
diff --git a/src/bridge/filesystem/sftp/composer.json b/src/bridge/filesystem/sftp/composer.json
index 32a65dab59..4055712328 100644
--- a/src/bridge/filesystem/sftp/composer.json
+++ b/src/bridge/filesystem/sftp/composer.json
@@ -13,7 +13,7 @@
"storage"
],
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/filesystem": "self.version",
"flow-php/types": "self.version",
"phpseclib/phpseclib": "^4.0.4"
diff --git a/src/bridge/filesystem/sftp/src/Flow/Filesystem/Bridge/SFTP/Options.php b/src/bridge/filesystem/sftp/src/Flow/Filesystem/Bridge/SFTP/Options.php
index 320d486cb5..e75f991a00 100644
--- a/src/bridge/filesystem/sftp/src/Flow/Filesystem/Bridge/SFTP/Options.php
+++ b/src/bridge/filesystem/sftp/src/Flow/Filesystem/Bridge/SFTP/Options.php
@@ -87,7 +87,7 @@ public static function fromArray(array $data): self
);
}
- return (new self())
+ return new self()
->withBlockFactory(
new NativeLocalFileBlocksFactory(
$data['block_location'],
diff --git a/src/bridge/filesystem/sftp/src/Flow/Filesystem/Bridge/SFTP/SFTPFilesystem.php b/src/bridge/filesystem/sftp/src/Flow/Filesystem/Bridge/SFTP/SFTPFilesystem.php
index 34e52419f5..a8053dfa19 100644
--- a/src/bridge/filesystem/sftp/src/Flow/Filesystem/Bridge/SFTP/SFTPFilesystem.php
+++ b/src/bridge/filesystem/sftp/src/Flow/Filesystem/Bridge/SFTP/SFTPFilesystem.php
@@ -119,7 +119,7 @@ public function list(Path $path, Filter $pathFilter = new KeepAll()): Generator
$root = rtrim(($path->isPattern() ? $path->staticPart() : $path)->path(), '/') ?: '/';
- foreach ((new DirectoryListing($this->client->client()))->read($root) as $entry) {
+ foreach (new DirectoryListing($this->client->client())->read($root) as $entry) {
$entryPath = path($path->protocol() . '://' . $entry->path, $path->options());
if ($path->isPattern() && !$path->matches($entryPath)) {
diff --git a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/OptionsTest.php b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/OptionsTest.php
index 75be00a1d3..8650c6933a 100644
--- a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/OptionsTest.php
+++ b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/OptionsTest.php
@@ -50,7 +50,7 @@ public function test_normalize_round_trips(): void
public function test_block_permissions_round_trip(): void
{
- $options = (new Options())->withBlockFactory(
+ $options = new Options()->withBlockFactory(
new NativeLocalFileBlocksFactory(sys_get_temp_dir(), Permissions::private()),
);
$normalized = $options->normalize();
diff --git a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPBlockLifecycleTest.php b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPBlockLifecycleTest.php
index 6fc9fe1fb7..b2c1f0bbf0 100644
--- a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPBlockLifecycleTest.php
+++ b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPBlockLifecycleTest.php
@@ -25,7 +25,7 @@ public function test_uploading_a_block_over_an_unusable_session_is_reported_as_a
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('SFTP session is no longer usable, cannot upload a block of /upload/orders.csv');
- (new SFTPBlockLifecycle(new SFTP('localhost'), path('sftp:///upload/orders.csv'), new WriteOffset()))->filled(
+ new SFTPBlockLifecycle(new SFTP('localhost'), path('sftp:///upload/orders.csv'), new WriteOffset())->filled(
$block,
);
}
diff --git a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPPasswordTest.php b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPPasswordTest.php
index 2aec70cacc..0936c36107 100644
--- a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPPasswordTest.php
+++ b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPPasswordTest.php
@@ -11,6 +11,6 @@ final class SFTPPasswordTest extends FlowTestCase
{
public function test_normalize_carries_the_password(): void
{
- static::assertSame(['password' => 'secret'], (new SFTPPassword('secret'))->normalize());
+ static::assertSame(['password' => 'secret'], new SFTPPassword('secret')->normalize());
}
}
diff --git a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPPrivateKeyTest.php b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPPrivateKeyTest.php
index 17fd956612..51916f2e66 100644
--- a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPPrivateKeyTest.php
+++ b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPPrivateKeyTest.php
@@ -14,11 +14,8 @@ final class SFTPPrivateKeyTest extends FlowTestCase
{
public function test_normalize_carries_the_pem_and_the_passphrase(): void
{
- static::assertSame(['private_key' => 'pem', 'passphrase' => null], (new SFTPPrivateKey('pem'))->normalize());
- static::assertSame(
- ['private_key' => 'pem', 'passphrase' => 'p'],
- (new SFTPPrivateKey('pem', 'p'))->normalize(),
- );
+ static::assertSame(['private_key' => 'pem', 'passphrase' => null], new SFTPPrivateKey('pem')->normalize());
+ static::assertSame(['private_key' => 'pem', 'passphrase' => 'p'], new SFTPPrivateKey('pem', 'p')->normalize());
}
public function test_a_pem_holding_a_public_key_is_refused_at_login(): void
@@ -26,7 +23,7 @@ public function test_a_pem_holding_a_public_key_is_refused_at_login(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('SFTP private key PEM does not hold a private key');
- (new SFTPPrivateKey(RSA::createKey(1024)->getPublicKey()->toString('PKCS8')))->login(
+ new SFTPPrivateKey(RSA::createKey(1024)->getPublicKey()->toString('PKCS8'))->login(
new SFTP('localhost'),
'bob',
);
diff --git a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/WriteOffsetTest.php b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/WriteOffsetTest.php
index e2653e9924..6dbbe14821 100644
--- a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/WriteOffsetTest.php
+++ b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/WriteOffsetTest.php
@@ -25,7 +25,7 @@ public function test_advancing_by_a_negative_value_is_rejected(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Cannot advance write offset by a negative value, got: -1');
- (new WriteOffset())->advance(-1);
+ new WriteOffset()->advance(-1);
}
public function test_negative_starting_offset_is_rejected(): void
diff --git a/src/bridge/mago/types/bin/worker.php b/src/bridge/mago/types/bin/worker.php
index a86b276c31..6b0307b3e4 100644
--- a/src/bridge/mago/types/bin/worker.php
+++ b/src/bridge/mago/types/bin/worker.php
@@ -14,9 +14,9 @@
}
}
-(new Worker(new Extension(
+new Worker(new Extension(
identifier: 'flow-php/mago-types-bridge',
name: 'Flow PHP Types',
version: '1.0.0',
analyzerPlugins: [new FlowTypesPlugin()],
-)))->run();
+))->run();
diff --git a/src/bridge/mago/types/composer.json b/src/bridge/mago/types/composer.json
index 14bb84947b..2172ffc5c2 100644
--- a/src/bridge/mago/types/composer.json
+++ b/src/bridge/mago/types/composer.json
@@ -11,7 +11,7 @@
"homepage": "https://github.com/flow-php/flow",
"license": "MIT",
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0"
+ "php": "~8.5.0 || ~8.6.0"
},
"require-dev": {
"carthage-software/mago": "^1.47.4"
diff --git a/src/bridge/mago/types/src/Flow/Bridge/Mago/Types/TypeStructureReturnTypeProvider.php b/src/bridge/mago/types/src/Flow/Bridge/Mago/Types/TypeStructureReturnTypeProvider.php
index 9570e6e0c6..fe05a9b2ec 100644
--- a/src/bridge/mago/types/src/Flow/Bridge/Mago/Types/TypeStructureReturnTypeProvider.php
+++ b/src/bridge/mago/types/src/Flow/Bridge/Mago/Types/TypeStructureReturnTypeProvider.php
@@ -18,6 +18,6 @@ public function getTargets(): array
public function getReturnType(ReturnTypeProviderContext $context): ?Type
{
- return (new TypeStructureShape())->derive($context->invocation);
+ return new TypeStructureShape()->derive($context->invocation);
}
}
diff --git a/src/bridge/mago/types/tests/Flow/Bridge/Mago/Types/Tests/Unit/ElementShapeTest.php b/src/bridge/mago/types/tests/Flow/Bridge/Mago/Types/Tests/Unit/ElementShapeTest.php
index c053937a74..de6617e950 100644
--- a/src/bridge/mago/types/tests/Flow/Bridge/Mago/Types/Tests/Unit/ElementShapeTest.php
+++ b/src/bridge/mago/types/tests/Flow/Bridge/Mago/Types/Tests/Unit/ElementShapeTest.php
@@ -17,7 +17,7 @@ public function test_a_plain_flow_type_derives_a_required_member_resolved_from_i
{
$flowType = InvocationMother::flowType('Flow\Types\Type\Logical\DateTimeType');
- $derived = (new ElementShape())->derive(InvocationMother::item('created_at', $flowType));
+ $derived = new ElementShape()->derive(InvocationMother::item('created_at', $flowType));
static::assertNotNull($derived);
static::assertFalse($derived->optional);
@@ -28,7 +28,7 @@ public function test_a_marker_with_literal_true_derives_an_optional_member(): vo
{
$member = Type::string();
- $derived = (new ElementShape())->derive(InvocationMother::item('nick', InvocationMother::marker(
+ $derived = new ElementShape()->derive(InvocationMother::item('nick', InvocationMother::marker(
$member,
Type::true(),
)));
@@ -57,7 +57,7 @@ public function test_an_already_optional_item_stays_optional(): void
{
$item = InvocationMother::item('a', InvocationMother::flowType());
- $derived = (new ElementShape())->derive(new ArrayItem($item->key, true, $item->type));
+ $derived = new ElementShape()->derive(new ArrayItem($item->key, true, $item->type));
static::assertNotNull($derived);
static::assertTrue($derived->optional);
@@ -65,6 +65,6 @@ public function test_an_already_optional_item_stays_optional(): void
public function test_a_value_that_is_not_a_named_object_refuses_to_derive(): void
{
- static::assertNull((new ElementShape())->derive(InvocationMother::item('id', Type::string())));
+ static::assertNull(new ElementShape()->derive(InvocationMother::item('id', Type::string())));
}
}
diff --git a/src/bridge/mago/types/tests/Flow/Bridge/Mago/Types/Tests/Unit/TypeStructureShapeTest.php b/src/bridge/mago/types/tests/Flow/Bridge/Mago/Types/Tests/Unit/TypeStructureShapeTest.php
index 98bba11ed1..6f1435902a 100644
--- a/src/bridge/mago/types/tests/Flow/Bridge/Mago/Types/Tests/Unit/TypeStructureShapeTest.php
+++ b/src/bridge/mago/types/tests/Flow/Bridge/Mago/Types/Tests/Unit/TypeStructureShapeTest.php
@@ -17,7 +17,7 @@ public function test_plain_map_derives_required_keys(): void
$id = InvocationMother::flowType();
$name = InvocationMother::flowType('Flow\Types\Type\Native\StringType');
- $shape = DerivedShapeContext::shape((new TypeStructureShape())->derive(InvocationMother::typeStructure(InvocationMother::sealedMap(
+ $shape = DerivedShapeContext::shape(new TypeStructureShape()->derive(InvocationMother::typeStructure(InvocationMother::sealedMap(
InvocationMother::item('id', $id),
InvocationMother::item('name', $name),
))));
@@ -33,7 +33,7 @@ public function test_marker_with_literal_true_derives_an_optional_key(): void
{
$nick = Type::string();
- $shape = DerivedShapeContext::shape((new TypeStructureShape())->derive(InvocationMother::typeStructure(InvocationMother::sealedMap(
+ $shape = DerivedShapeContext::shape(new TypeStructureShape()->derive(InvocationMother::typeStructure(InvocationMother::sealedMap(
InvocationMother::item('id', InvocationMother::flowType()),
InvocationMother::item('nick', InvocationMother::marker($nick, Type::true())),
))));
@@ -44,7 +44,7 @@ public function test_marker_with_literal_true_derives_an_optional_key(): void
public function test_marker_without_flag_or_with_false_stays_required(): void
{
- $shape = DerivedShapeContext::shape((new TypeStructureShape())->derive(InvocationMother::typeStructure(InvocationMother::sealedMap(
+ $shape = DerivedShapeContext::shape(new TypeStructureShape()->derive(InvocationMother::typeStructure(InvocationMother::sealedMap(
InvocationMother::item('a', InvocationMother::marker(Type::string(), null)),
InvocationMother::item('b', InvocationMother::marker(Type::string(), Type::false())),
InvocationMother::item('c', InvocationMother::marker(Type::string(), Type::bool())),
@@ -55,7 +55,7 @@ public function test_marker_without_flag_or_with_false_stays_required(): void
public function test_derived_shape_is_sealed(): void
{
- $keyedArray = DerivedShapeContext::keyedArray((new TypeStructureShape())->derive(InvocationMother::typeStructure(InvocationMother::sealedMap(InvocationMother::item(
+ $keyedArray = DerivedShapeContext::keyedArray(new TypeStructureShape()->derive(InvocationMother::typeStructure(InvocationMother::sealedMap(InvocationMother::item(
'id',
InvocationMother::flowType(),
)))));
@@ -66,7 +66,7 @@ public function test_derived_shape_is_sealed(): void
public function test_unsealed_elements_refuse_to_derive(): void
{
- static::assertNull((new TypeStructureShape())->derive(InvocationMother::typeStructure(Type::array(
+ static::assertNull(new TypeStructureShape()->derive(InvocationMother::typeStructure(Type::array(
Type::string(),
Type::mixed(),
))));
@@ -74,7 +74,7 @@ public function test_unsealed_elements_refuse_to_derive(): void
public function test_a_value_that_is_not_a_named_object_refuses_to_derive(): void
{
- static::assertNull((new TypeStructureShape())->derive(InvocationMother::typeStructure(InvocationMother::sealedMap(InvocationMother::item(
+ static::assertNull(new TypeStructureShape()->derive(InvocationMother::typeStructure(InvocationMother::sealedMap(InvocationMother::item(
'id',
Type::string(),
)))));
diff --git a/src/bridge/monolog/http/composer.json b/src/bridge/monolog/http/composer.json
index 6c555db8e4..44d07c2025 100644
--- a/src/bridge/monolog/http/composer.json
+++ b/src/bridge/monolog/http/composer.json
@@ -9,7 +9,7 @@
"bridge"
],
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"monolog/monolog": "^3.0",
"psr/http-message": "^1.0 || ^2.0"
},
diff --git a/src/bridge/monolog/telemetry/composer.json b/src/bridge/monolog/telemetry/composer.json
index 9ce1a86c79..5acfee56f8 100644
--- a/src/bridge/monolog/telemetry/composer.json
+++ b/src/bridge/monolog/telemetry/composer.json
@@ -11,7 +11,7 @@
"homepage": "https://github.com/flow-php/flow",
"license": "MIT",
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/etl": "self.version",
"flow-php/telemetry": "self.version",
"monolog/monolog": "^3.0"
diff --git a/src/bridge/openapi/specification/composer.json b/src/bridge/openapi/specification/composer.json
index e309472f4e..cad98d026d 100644
--- a/src/bridge/openapi/specification/composer.json
+++ b/src/bridge/openapi/specification/composer.json
@@ -10,7 +10,7 @@
"schema"
],
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0"
+ "php": "~8.5.0 || ~8.6.0"
},
"config": {
"optimize-autoloader": true,
diff --git a/src/bridge/openapi/specification/src/Flow/Bridge/OpenAPI/Specification/DSL/functions.php b/src/bridge/openapi/specification/src/Flow/Bridge/OpenAPI/Specification/DSL/functions.php
index cb3949b785..e51f3ca2c6 100644
--- a/src/bridge/openapi/specification/src/Flow/Bridge/OpenAPI/Specification/DSL/functions.php
+++ b/src/bridge/openapi/specification/src/Flow/Bridge/OpenAPI/Specification/DSL/functions.php
@@ -14,7 +14,7 @@
*/
function schema_to_openapi_specification(Schema $schema): array
{
- return (new OpenAPIConverter())->toOpenAPI($schema);
+ return new OpenAPIConverter()->toOpenAPI($schema);
}
/**
@@ -24,5 +24,5 @@ function schema_to_openapi_specification(Schema $schema): array
*/
function schema_from_openapi_specification(array $openApiSpec): Schema
{
- return (new OpenAPIConverter())->fromOpenAPI($openApiSpec);
+ return new OpenAPIConverter()->fromOpenAPI($openApiSpec);
}
diff --git a/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/FlowToOpenAPIConverterTest.php b/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/FlowToOpenAPIConverterTest.php
index 1f6802a260..0ad4c7508f 100644
--- a/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/FlowToOpenAPIConverterTest.php
+++ b/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/FlowToOpenAPIConverterTest.php
@@ -170,7 +170,7 @@ public function test_to_open_api_enum_edge_cases(): void
],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(enum_schema('single_enum', FlowTestSingleEnum::class, false))),
+ new OpenAPIConverter()->toOpenAPI(schema(enum_schema('single_enum', FlowTestSingleEnum::class, false))),
);
}
@@ -179,7 +179,7 @@ public function test_to_open_api_preserves_definition_order(): void
static::assertSame(
['c', 'a', 'b'],
array_keys(type_array()->assert(
- (new OpenAPIConverter())->toOpenAPI(schema(
+ new OpenAPIConverter()->toOpenAPI(schema(
str_schema('c'),
str_schema('a'),
str_schema('b'),
@@ -201,7 +201,7 @@ public function test_to_open_api_with_array_type(): void
],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(definition_from_type('items', type_array(), false))),
+ new OpenAPIConverter()->toOpenAPI(schema(definition_from_type('items', type_array(), false))),
);
}
@@ -218,7 +218,7 @@ public function test_to_open_api_with_backed_enum(): void
],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(enum_schema('priority', FlowTestBackedEnum::class, false))),
+ new OpenAPIConverter()->toOpenAPI(schema(enum_schema('priority', FlowTestBackedEnum::class, false))),
);
}
@@ -235,7 +235,7 @@ public function test_to_open_api_with_backed_enum_different_types(): void
],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(enum_schema('int_enum', FlowTestIntBackedEnum::class, false))),
+ new OpenAPIConverter()->toOpenAPI(schema(enum_schema('int_enum', FlowTestIntBackedEnum::class, false))),
);
}
@@ -246,7 +246,7 @@ public function test_to_open_api_with_backed_enum_different_types(): void
#[DataProvider('basic_types_provider')]
public function test_to_open_api_with_basic_types(Definition $definition, array $expected): void
{
- $result = (new OpenAPIConverter())->toOpenAPI(schema($definition));
+ $result = new OpenAPIConverter()->toOpenAPI(schema($definition));
static::assertSame(
[
@@ -280,7 +280,7 @@ public function test_to_open_api_with_complex_schema(): void
],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(
+ new OpenAPIConverter()->toOpenAPI(schema(
int_schema('id', false),
str_schema('name', true, Metadata::empty()->add('description', 'User name')),
bool_schema('active', false, Metadata::empty()->add('example', true)),
@@ -315,7 +315,7 @@ public function test_to_open_api_interleaved_structure_preserves_declaration_ord
],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(structure_schema('s', type_structure([
+ new OpenAPIConverter()->toOpenAPI(schema(structure_schema('s', type_structure([
'z' => type_integer(),
'a' => structure_element('a', type_string(), optional: true),
'b' => type_string(),
@@ -350,7 +350,7 @@ public function test_to_open_api_with_deeply_nested_structures(): void
],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(structure_schema(
+ new OpenAPIConverter()->toOpenAPI(schema(structure_schema(
'nested',
type_structure([
'level1' => type_structure([
@@ -371,7 +371,7 @@ public function test_to_open_api_with_empty_schema(): void
'type' => 'object',
'properties' => [],
],
- (new OpenAPIConverter())->toOpenAPI(schema()),
+ new OpenAPIConverter()->toOpenAPI(schema()),
);
}
@@ -388,7 +388,7 @@ public function test_to_open_api_with_list_type(): void
],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(list_schema('tags', type_list(type_string()), false))),
+ new OpenAPIConverter()->toOpenAPI(schema(list_schema('tags', type_list(type_string()), false))),
);
}
@@ -405,7 +405,7 @@ public function test_to_open_api_with_map_type(): void
],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(map_schema(
+ new OpenAPIConverter()->toOpenAPI(schema(map_schema(
'metadata',
type_map(type_string(), type_integer()),
false,
@@ -427,7 +427,7 @@ public function test_to_open_api_with_metadata(): void
],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(str_schema(
+ new OpenAPIConverter()->toOpenAPI(schema(str_schema(
'name',
false,
Metadata::empty()->add('description', 'User full name')->add('example', 'John Doe'),
@@ -448,7 +448,7 @@ public function test_to_open_api_with_metadata_description_only(): void
],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(str_schema(
+ new OpenAPIConverter()->toOpenAPI(schema(str_schema(
'name',
false,
Metadata::empty()->add('description', 'User name'),
@@ -469,11 +469,7 @@ public function test_to_open_api_with_metadata_example_only(): void
],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(int_schema(
- 'age',
- false,
- Metadata::empty()->add('example', 25),
- ))),
+ new OpenAPIConverter()->toOpenAPI(schema(int_schema('age', false, Metadata::empty()->add('example', 25)))),
);
}
@@ -489,7 +485,7 @@ public function test_to_open_api_with_metadata_other_keys(): void
],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(str_schema(
+ new OpenAPIConverter()->toOpenAPI(schema(str_schema(
'name',
false,
Metadata::empty()->add('custom_key', 'custom_value'),
@@ -511,7 +507,7 @@ public function test_to_open_api_with_mixed_metadata_values(): void
],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(str_schema(
+ new OpenAPIConverter()->toOpenAPI(schema(str_schema(
'mixed_meta',
false,
Metadata::empty()
@@ -535,7 +531,7 @@ public function test_to_open_api_with_multiple_definitions(): void
'price' => ['type' => 'number', 'nullable' => true],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(
+ new OpenAPIConverter()->toOpenAPI(schema(
int_schema('id', false),
str_schema('name', true),
bool_schema('active', false),
@@ -560,7 +556,7 @@ public function test_to_open_api_with_nested_list_type(): void
],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(list_schema(
+ new OpenAPIConverter()->toOpenAPI(schema(list_schema(
'nested_tags',
type_list(type_list(type_integer())),
false,
@@ -571,7 +567,7 @@ public function test_to_open_api_with_nested_list_type(): void
public function test_to_open_api_with_special_field_names(): void
{
$properties = type_array()->assert(
- (new OpenAPIConverter())->toOpenAPI(schema(
+ new OpenAPIConverter()->toOpenAPI(schema(
str_schema('field-with-dashes', false),
str_schema('field_with_underscores', false),
str_schema('fieldWithCamelCase', false),
@@ -595,7 +591,7 @@ public function test_to_open_api_with_special_field_names(): void
#[DataProvider('special_types_provider')]
public function test_to_open_api_with_special_types(Definition $definition, array $expected): void
{
- $result = (new OpenAPIConverter())->toOpenAPI(schema($definition));
+ $result = new OpenAPIConverter()->toOpenAPI(schema($definition));
static::assertSame(
[
@@ -623,7 +619,7 @@ public function test_to_open_api_with_structure_only_optional_elements(): void
],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(structure_schema(
+ new OpenAPIConverter()->toOpenAPI(schema(structure_schema(
'optional_only',
type_structure(['optional_field' => structure_element(
'optional_field',
@@ -652,7 +648,7 @@ public function test_to_open_api_with_structure_type(): void
],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(structure_schema(
+ new OpenAPIConverter()->toOpenAPI(schema(structure_schema(
'address',
type_structure([
'street' => type_string(),
@@ -675,7 +671,7 @@ public function test_to_open_api_with_task_example_schema(): void
'active' => ['type' => 'boolean', 'nullable' => false],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(
+ new OpenAPIConverter()->toOpenAPI(schema(
int_schema('id', false),
str_schema('name', true),
bool_schema('active', false, Metadata::empty()->add('key', 'value')),
@@ -696,7 +692,7 @@ public function test_to_open_api_with_unit_enum(): void
],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(enum_schema('status', FlowTestUnitEnum::class, false))),
+ new OpenAPIConverter()->toOpenAPI(schema(enum_schema('status', FlowTestUnitEnum::class, false))),
);
}
diff --git a/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/OpenAPIMetadataIntegrationTest.php b/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/OpenAPIMetadataIntegrationTest.php
index fbf6bc5285..a8e64bb2e0 100644
--- a/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/OpenAPIMetadataIntegrationTest.php
+++ b/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/OpenAPIMetadataIntegrationTest.php
@@ -65,7 +65,7 @@ public function test_complex_example_with_all_metadata_types(): void
],
],
],
- (new OpenAPIConverter())->toOpenAPI(schema(
+ new OpenAPIConverter()->toOpenAPI(schema(
int_schema(
'id',
false,
@@ -112,7 +112,7 @@ public function test_complex_example_with_all_metadata_types(): void
public function test_converter_falls_back_to_legacy_metadata_when_openapi_not_present(): void
{
/** @var array $properties */
- $properties = (new OpenAPIConverter())->toOpenAPI(schema(str_schema(
+ $properties = new OpenAPIConverter()->toOpenAPI(schema(str_schema(
'name',
false,
Metadata::with('description', 'Legacy description')->merge(Metadata::with('example', 'Legacy example')),
@@ -127,7 +127,7 @@ public function test_converter_falls_back_to_legacy_metadata_when_openapi_not_pr
public function test_converter_handles_mixed_legacy_and_openapi_metadata(): void
{
/** @var array $properties */
- $properties = (new OpenAPIConverter())->toOpenAPI(schema(str_schema(
+ $properties = new OpenAPIConverter()->toOpenAPI(schema(str_schema(
'mixed',
false,
Metadata::with('description', 'Legacy description')
@@ -145,7 +145,7 @@ public function test_converter_handles_mixed_legacy_and_openapi_metadata(): void
public function test_converter_handles_multiple_openapi_metadata(): void
{
/** @var array $properties */
- $properties = (new OpenAPIConverter())->toOpenAPI(schema(str_schema(
+ $properties = new OpenAPIConverter()->toOpenAPI(schema(str_schema(
'email',
false,
OpenAPIMetadata::description('User email address')
@@ -165,7 +165,7 @@ public function test_converter_handles_multiple_openapi_metadata(): void
public function test_converter_handles_openapi_default_metadata(): void
{
/** @var array $properties */
- $properties = (new OpenAPIConverter())->toOpenAPI(schema(str_schema(
+ $properties = new OpenAPIConverter()->toOpenAPI(schema(str_schema(
'status',
false,
OpenAPIMetadata::default('active'),
@@ -178,7 +178,7 @@ public function test_converter_handles_openapi_default_metadata(): void
public function test_converter_handles_openapi_deprecated_metadata(): void
{
/** @var array $properties */
- $properties = (new OpenAPIConverter())->toOpenAPI(schema(str_schema(
+ $properties = new OpenAPIConverter()->toOpenAPI(schema(str_schema(
'old_field',
false,
OpenAPIMetadata::deprecated(),
@@ -191,7 +191,7 @@ public function test_converter_handles_openapi_deprecated_metadata(): void
public function test_converter_handles_openapi_description_metadata(): void
{
/** @var array $properties */
- $properties = (new OpenAPIConverter())->toOpenAPI(schema(str_schema(
+ $properties = new OpenAPIConverter()->toOpenAPI(schema(str_schema(
'name',
false,
OpenAPIMetadata::description('User full name'),
@@ -204,7 +204,7 @@ public function test_converter_handles_openapi_description_metadata(): void
public function test_converter_handles_openapi_example_metadata(): void
{
/** @var array $properties */
- $properties = (new OpenAPIConverter())->toOpenAPI(schema(str_schema(
+ $properties = new OpenAPIConverter()->toOpenAPI(schema(str_schema(
'email',
false,
OpenAPIMetadata::example('user@example.com'),
@@ -237,7 +237,7 @@ public function test_converter_handles_openapi_examples_metadata(): void
public function test_converter_handles_openapi_format_metadata(): void
{
/** @var array $properties */
- $properties = (new OpenAPIConverter())->toOpenAPI(schema(str_schema(
+ $properties = new OpenAPIConverter()->toOpenAPI(schema(str_schema(
'email',
false,
OpenAPIMetadata::format('email'),
@@ -251,7 +251,7 @@ public function test_converter_handles_openapi_nullable_metadata_override(): voi
{
// non-nullable schema definition but nullable in OpenAPI
- $result = (new OpenAPIConverter())->toOpenAPI(schema(str_schema(
+ $result = new OpenAPIConverter()->toOpenAPI(schema(str_schema(
'optional_field',
false,
OpenAPIMetadata::nullable(true),
@@ -267,7 +267,7 @@ public function test_converter_handles_openapi_nullable_metadata_override(): voi
public function test_converter_handles_openapi_read_only_metadata(): void
{
/** @var array $properties */
- $properties = (new OpenAPIConverter())->toOpenAPI(schema(str_schema(
+ $properties = new OpenAPIConverter()->toOpenAPI(schema(str_schema(
'created_at',
false,
OpenAPIMetadata::readOnly(),
@@ -280,7 +280,7 @@ public function test_converter_handles_openapi_read_only_metadata(): void
public function test_converter_handles_openapi_title_metadata(): void
{
/** @var array $properties */
- $properties = (new OpenAPIConverter())->toOpenAPI(schema(int_schema(
+ $properties = new OpenAPIConverter()->toOpenAPI(schema(int_schema(
'id',
false,
OpenAPIMetadata::title('User ID'),
@@ -293,7 +293,7 @@ public function test_converter_handles_openapi_title_metadata(): void
public function test_converter_handles_openapi_write_only_metadata(): void
{
/** @var array $properties */
- $properties = (new OpenAPIConverter())->toOpenAPI(schema(str_schema(
+ $properties = new OpenAPIConverter()->toOpenAPI(schema(str_schema(
'password',
false,
OpenAPIMetadata::writeOnly(),
@@ -306,7 +306,7 @@ public function test_converter_handles_openapi_write_only_metadata(): void
public function test_converter_prioritizes_openapi_metadata_over_legacy(): void
{
/** @var array $properties */
- $properties = (new OpenAPIConverter())->toOpenAPI(schema(str_schema(
+ $properties = new OpenAPIConverter()->toOpenAPI(schema(str_schema(
'name',
false,
Metadata::with('description', 'Legacy description') // Legacy metadata
@@ -324,7 +324,7 @@ public function test_converter_prioritizes_openapi_metadata_over_legacy(): void
public function test_openapi_metadata_usage_with_converter(): void
{
/** @var array $properties */
- $properties = (new OpenAPIConverter())->toOpenAPI(schema(
+ $properties = new OpenAPIConverter()->toOpenAPI(schema(
str_schema(
'user_email',
false,
diff --git a/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/OpenAPIToFlowConverterTest.php b/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/OpenAPIToFlowConverterTest.php
index 549bf59d97..13d7ded395 100644
--- a/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/OpenAPIToFlowConverterTest.php
+++ b/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/OpenAPIToFlowConverterTest.php
@@ -149,7 +149,7 @@ public function test_from_openapi_throws_exception_for_unsupported_type(): void
public function test_from_openapi_with_array_type(): void
{
- $schema = (new OpenAPIConverter())->fromOpenAPI([
+ $schema = new OpenAPIConverter()->fromOpenAPI([
'type' => 'object',
'properties' => [
'tags' => [
@@ -169,7 +169,7 @@ public function test_from_openapi_with_array_type(): void
public function test_from_openapi_with_basic_types(): void
{
- $schema = (new OpenAPIConverter())->fromOpenAPI([
+ $schema = new OpenAPIConverter()->fromOpenAPI([
'type' => 'object',
'properties' => [
'id' => ['type' => 'integer', 'nullable' => false],
@@ -242,7 +242,7 @@ public function test_from_openapi_with_empty_properties(): void
{
static::assertCount(
0,
- (new OpenAPIConverter())->fromOpenAPI([
+ new OpenAPIConverter()->fromOpenAPI([
'type' => 'object',
'properties' => [],
])->definitions(),
@@ -251,7 +251,7 @@ public function test_from_openapi_with_empty_properties(): void
public function test_from_openapi_with_metadata(): void
{
- $schema = (new OpenAPIConverter())->fromOpenAPI([
+ $schema = new OpenAPIConverter()->fromOpenAPI([
'type' => 'object',
'properties' => [
'name' => [
@@ -274,7 +274,7 @@ public function test_from_openapi_with_metadata(): void
public function test_from_openapi_with_nested_structure(): void
{
- $schema = (new OpenAPIConverter())->fromOpenAPI([
+ $schema = new OpenAPIConverter()->fromOpenAPI([
'type' => 'object',
'properties' => [
'address' => [
@@ -297,7 +297,7 @@ public function test_from_openapi_with_nested_structure(): void
public function test_from_openapi_with_object_with_additional_properties(): void
{
- $schema = (new OpenAPIConverter())->fromOpenAPI([
+ $schema = new OpenAPIConverter()->fromOpenAPI([
'type' => 'object',
'properties' => [
'metadata' => [
@@ -317,7 +317,7 @@ public function test_from_openapi_with_object_with_additional_properties(): void
public function test_from_openapi_with_special_string_formats(): void
{
- $schema = (new OpenAPIConverter())->fromOpenAPI([
+ $schema = new OpenAPIConverter()->fromOpenAPI([
'type' => 'object',
'properties' => [
'birth_date' => ['type' => 'string', 'format' => 'date', 'nullable' => false],
diff --git a/src/bridge/phpstan/types/composer.json b/src/bridge/phpstan/types/composer.json
index d44492c700..df8a4ab830 100644
--- a/src/bridge/phpstan/types/composer.json
+++ b/src/bridge/phpstan/types/composer.json
@@ -11,7 +11,7 @@
"homepage": "https://github.com/flow-php/flow",
"license": "MIT",
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/types": "self.version"
},
"require-dev": {
diff --git a/src/bridge/phpstan/types/src/Flow/Bridge/PHPStan/Types/StructureTypeReturnTypeExtension.php b/src/bridge/phpstan/types/src/Flow/Bridge/PHPStan/Types/StructureTypeReturnTypeExtension.php
index f843419279..5aacd00e47 100644
--- a/src/bridge/phpstan/types/src/Flow/Bridge/PHPStan/Types/StructureTypeReturnTypeExtension.php
+++ b/src/bridge/phpstan/types/src/Flow/Bridge/PHPStan/Types/StructureTypeReturnTypeExtension.php
@@ -80,7 +80,7 @@ private function createResult(ConstantArrayType $requiredArrayType, array $marke
// a structure_element() marker value: the member type is the element's template, the
// optional flag comes from the call expression (the type alone cannot carry it)
- if ((new ObjectType(StructureElement::class))->isSuperTypeOf($valueType)->yes()) {
+ if (new ObjectType(StructureElement::class)->isSuperTypeOf($valueType)->yes()) {
$builder->setOffsetValueType(
$key,
$valueType->getTemplateType(StructureElement::class, 'T'),
diff --git a/src/bridge/phpunit/postgresql/composer.json b/src/bridge/phpunit/postgresql/composer.json
index 1ef6fceb96..2a549de211 100644
--- a/src/bridge/phpunit/postgresql/composer.json
+++ b/src/bridge/phpunit/postgresql/composer.json
@@ -13,7 +13,7 @@
"homepage": "https://github.com/flow-php/flow",
"license": "MIT",
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/postgresql": "self.version",
"phpunit/phpunit": "^11 || ^12 || ^13"
},
diff --git a/src/bridge/phpunit/postgresql/tests/Flow/Bridge/PHPUnit/PostgreSQL/Tests/Unit/SkipTransactionRollbackTest.php b/src/bridge/phpunit/postgresql/tests/Flow/Bridge/PHPUnit/PostgreSQL/Tests/Unit/SkipTransactionRollbackTest.php
index 3936d02e9c..a45eefe460 100644
--- a/src/bridge/phpunit/postgresql/tests/Flow/Bridge/PHPUnit/PostgreSQL/Tests/Unit/SkipTransactionRollbackTest.php
+++ b/src/bridge/phpunit/postgresql/tests/Flow/Bridge/PHPUnit/PostgreSQL/Tests/Unit/SkipTransactionRollbackTest.php
@@ -17,7 +17,7 @@ final class SkipTransactionRollbackTest extends TestCase
{
public function test_attribute_can_target_class(): void
{
- $attribute = (new ReflectionClass(SkipTransactionRollback::class))->getAttributes(
+ $attribute = new ReflectionClass(SkipTransactionRollback::class)->getAttributes(
Attribute::class,
)[0]->newInstance();
@@ -26,7 +26,7 @@ public function test_attribute_can_target_class(): void
public function test_attribute_can_target_method(): void
{
- $attribute = (new ReflectionClass(SkipTransactionRollback::class))->getAttributes(
+ $attribute = new ReflectionClass(SkipTransactionRollback::class)->getAttributes(
Attribute::class,
)[0]->newInstance();
@@ -35,7 +35,7 @@ public function test_attribute_can_target_method(): void
public function test_attribute_detected_on_class(): void
{
- static::assertNotEmpty((new ReflectionClass(SkippedTestCase::class))->getAttributes(
+ static::assertNotEmpty(new ReflectionClass(SkippedTestCase::class)->getAttributes(
SkipTransactionRollback::class,
));
}
@@ -43,7 +43,7 @@ public function test_attribute_detected_on_class(): void
public function test_attribute_detected_on_method(): void
{
static::assertNotEmpty(
- (new ReflectionClass(SkippedMethodTestCase::class))
+ new ReflectionClass(SkippedMethodTestCase::class)
->getMethod('test_something')
->getAttributes(SkipTransactionRollback::class),
);
@@ -60,8 +60,6 @@ public function test_attribute_detected_on_parent_abstract_class(): void
public function test_attribute_not_present_on_normal_class(): void
{
- static::assertEmpty((new ReflectionClass(NormalTestCase::class))->getAttributes(
- SkipTransactionRollback::class,
- ));
+ static::assertEmpty(new ReflectionClass(NormalTestCase::class)->getAttributes(SkipTransactionRollback::class));
}
}
diff --git a/src/bridge/phpunit/telemetry/composer.json b/src/bridge/phpunit/telemetry/composer.json
index 5bbe2cf154..b402dd7c9e 100644
--- a/src/bridge/phpunit/telemetry/composer.json
+++ b/src/bridge/phpunit/telemetry/composer.json
@@ -14,7 +14,7 @@
"homepage": "https://github.com/flow-php/flow",
"license": "MIT",
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/telemetry": "self.version",
"flow-php/telemetry-otlp-bridge": "self.version",
"phpunit/phpunit": "^11 || ^12 || ^13"
diff --git a/src/bridge/phpunit/telemetry/tests/Flow/Bridge/PHPUnit/Telemetry/Tests/Mother/TestEventMother.php b/src/bridge/phpunit/telemetry/tests/Flow/Bridge/PHPUnit/Telemetry/Tests/Mother/TestEventMother.php
index 7f863b0a83..2d1478ba3e 100644
--- a/src/bridge/phpunit/telemetry/tests/Flow/Bridge/PHPUnit/Telemetry/Tests/Mother/TestEventMother.php
+++ b/src/bridge/phpunit/telemetry/tests/Flow/Bridge/PHPUnit/Telemetry/Tests/Mother/TestEventMother.php
@@ -83,7 +83,7 @@ private static function createInfo(): Info
MemoryUsage::fromBytes(0),
];
- $constructor = (new ReflectionClass(Info::class))->getConstructor();
+ $constructor = new ReflectionClass(Info::class)->getConstructor();
if ($constructor !== null) {
$parameters = $constructor->getParameters();
@@ -110,7 +110,7 @@ private static function createSnapshot(): Snapshot
new GarbageCollectorStatus(0, 0, 0, 0, 0.0, 0.0, 0.0, 0.0, false, false, false, 0),
];
- $constructor = (new ReflectionClass(Snapshot::class))->getConstructor();
+ $constructor = new ReflectionClass(Snapshot::class)->getConstructor();
if ($constructor !== null) {
$parameters = $constructor->getParameters();
diff --git a/src/bridge/phpunit/telemetry/tests/Flow/Bridge/PHPUnit/Telemetry/Tests/Unit/PHPUnitTelemetryAttributesTest.php b/src/bridge/phpunit/telemetry/tests/Flow/Bridge/PHPUnit/Telemetry/Tests/Unit/PHPUnitTelemetryAttributesTest.php
index 8abe4ba53e..ab8b5d1b83 100644
--- a/src/bridge/phpunit/telemetry/tests/Flow/Bridge/PHPUnit/Telemetry/Tests/Unit/PHPUnitTelemetryAttributesTest.php
+++ b/src/bridge/phpunit/telemetry/tests/Flow/Bridge/PHPUnit/Telemetry/Tests/Unit/PHPUnitTelemetryAttributesTest.php
@@ -13,7 +13,7 @@ final class PHPUnitTelemetryAttributesTest extends TestCase
public function test_all_custom_keys_use_the_flow_phpunit_prefix(): void
{
// @mago-expect analysis:mixed-assignment
- foreach ((new ReflectionClass(PHPUnitTelemetryAttributes::class))->getConstants() as $name => $value) {
+ foreach (new ReflectionClass(PHPUnitTelemetryAttributes::class)->getConstants() as $name => $value) {
static::assertIsString($value);
static::assertStringStartsWith(
'flow.phpunit.',
diff --git a/src/bridge/phpunit/telemetry/tests/Flow/Bridge/PHPUnit/Telemetry/Tests/Unit/SuiteOutcomeStackTest.php b/src/bridge/phpunit/telemetry/tests/Flow/Bridge/PHPUnit/Telemetry/Tests/Unit/SuiteOutcomeStackTest.php
index 34eac2e74f..15a76481ee 100644
--- a/src/bridge/phpunit/telemetry/tests/Flow/Bridge/PHPUnit/Telemetry/Tests/Unit/SuiteOutcomeStackTest.php
+++ b/src/bridge/phpunit/telemetry/tests/Flow/Bridge/PHPUnit/Telemetry/Tests/Unit/SuiteOutcomeStackTest.php
@@ -71,7 +71,7 @@ public function test_only_skipped_tests_make_suite_skipped(): void
public function test_pop_without_open_frame_returns_null(): void
{
- static::assertNull((new SuiteOutcomeStack())->pop());
+ static::assertNull(new SuiteOutcomeStack()->pop());
}
public function test_size_reflects_open_frames(): void
diff --git a/src/bridge/postgresql/valinor/composer.json b/src/bridge/postgresql/valinor/composer.json
index 5eac741633..6408ca997e 100644
--- a/src/bridge/postgresql/valinor/composer.json
+++ b/src/bridge/postgresql/valinor/composer.json
@@ -11,7 +11,7 @@
"homepage": "https://github.com/flow-php/flow",
"license": "MIT",
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"cuyz/valinor": "^2.4",
"flow-php/postgresql": "self.version"
},
diff --git a/src/bridge/postgresql/valinor/tests/Flow/PostgreSql/Bridge/Valinor/Tests/Unit/DSLTest.php b/src/bridge/postgresql/valinor/tests/Flow/PostgreSql/Bridge/Valinor/Tests/Unit/DSLTest.php
index 681e83c433..261259f18d 100644
--- a/src/bridge/postgresql/valinor/tests/Flow/PostgreSql/Bridge/Valinor/Tests/Unit/DSLTest.php
+++ b/src/bridge/postgresql/valinor/tests/Flow/PostgreSql/Bridge/Valinor/Tests/Unit/DSLTest.php
@@ -29,7 +29,7 @@ public function test_valinor_builder_mapper_delegates_to_class(): void
public function test_valinor_tree_mapper_delegates_to_class(): void
{
- $mapper = valinor_tree_mapper((new MapperBuilder())->mapper(), SimpleDto::class);
+ $mapper = valinor_tree_mapper(new MapperBuilder()->mapper(), SimpleDto::class);
static::assertInstanceOf(ValinorTreeMapper::class, $mapper);
static::assertSame(
diff --git a/src/bridge/postgresql/valinor/tests/Flow/PostgreSql/Bridge/Valinor/Tests/Unit/ValinorTreeMapperTest.php b/src/bridge/postgresql/valinor/tests/Flow/PostgreSql/Bridge/Valinor/Tests/Unit/ValinorTreeMapperTest.php
index 81cbccbe30..3a2f5a7f12 100644
--- a/src/bridge/postgresql/valinor/tests/Flow/PostgreSql/Bridge/Valinor/Tests/Unit/ValinorTreeMapperTest.php
+++ b/src/bridge/postgresql/valinor/tests/Flow/PostgreSql/Bridge/Valinor/Tests/Unit/ValinorTreeMapperTest.php
@@ -29,7 +29,7 @@ final class ValinorTreeMapperTest extends TestCase
{
public function test_allows_extra_columns_when_superfluous_keys_enabled(): void
{
- $mapper = new ValinorTreeMapper((new MapperBuilder())->allowSuperfluousKeys()->mapper(), SimpleDto::class);
+ $mapper = new ValinorTreeMapper(new MapperBuilder()->allowSuperfluousKeys()->mapper(), SimpleDto::class);
$result = $mapper->map([
'id' => 1,
@@ -50,7 +50,7 @@ public function test_composes_with_type_mapper_for_datetime_columns(): void
'id' => type_integer(),
'createdAt' => type_datetime(),
]),
- new ValinorTreeMapper((new MapperBuilder())->mapper(), WithDateTime::class),
+ new ValinorTreeMapper(new MapperBuilder()->mapper(), WithDateTime::class),
);
$result = type_instance_of(WithDateTime::class)->assert($mapper->map([
@@ -73,7 +73,7 @@ public function test_composes_with_type_mapper_to_decode_jsonb_into_nested_objec
'city' => type_string(),
]),
]),
- new ValinorTreeMapper((new MapperBuilder())->mapper(), UserWithAddress::class),
+ new ValinorTreeMapper(new MapperBuilder()->mapper(), UserWithAddress::class),
);
$result = type_instance_of(UserWithAddress::class)->assert($mapper->map([
@@ -88,7 +88,7 @@ public function test_composes_with_type_mapper_to_decode_jsonb_into_nested_objec
public function test_exception_message_includes_target_class(): void
{
- $mapper = new ValinorTreeMapper((new MapperBuilder())->mapper(), SimpleDto::class);
+ $mapper = new ValinorTreeMapper(new MapperBuilder()->mapper(), SimpleDto::class);
try {
$mapper->map(['id' => 1], MapperContextMother::any());
@@ -100,7 +100,7 @@ public function test_exception_message_includes_target_class(): void
public function test_maps_list_of_strings(): void
{
- $mapper = new ValinorTreeMapper((new MapperBuilder())->mapper(), WithTags::class);
+ $mapper = new ValinorTreeMapper(new MapperBuilder()->mapper(), WithTags::class);
$result = $mapper->map([
'id' => 1,
@@ -112,7 +112,7 @@ public function test_maps_list_of_strings(): void
public function test_maps_nested_object_from_array(): void
{
- $mapper = new ValinorTreeMapper((new MapperBuilder())->mapper(), UserWithAddress::class);
+ $mapper = new ValinorTreeMapper(new MapperBuilder()->mapper(), UserWithAddress::class);
$result = $mapper->map([
'id' => 1,
@@ -131,7 +131,7 @@ public function test_maps_nested_object_from_array(): void
public function test_maps_nullable_property_when_value_is_null(): void
{
- $mapper = new ValinorTreeMapper((new MapperBuilder())->mapper(), NullableDto::class);
+ $mapper = new ValinorTreeMapper(new MapperBuilder()->mapper(), NullableDto::class);
$result = $mapper->map([
'id' => 1,
@@ -146,7 +146,7 @@ public function test_maps_nullable_property_when_value_is_null(): void
public function test_maps_row_to_simple_dto(): void
{
- $mapper = new ValinorTreeMapper((new MapperBuilder())->mapper(), SimpleDto::class);
+ $mapper = new ValinorTreeMapper(new MapperBuilder()->mapper(), SimpleDto::class);
$result = $mapper->map([
'id' => 1,
@@ -162,7 +162,7 @@ public function test_maps_row_to_simple_dto(): void
public function test_rejects_extra_columns_by_default(): void
{
- $mapper = new ValinorTreeMapper((new MapperBuilder())->mapper(), SimpleDto::class);
+ $mapper = new ValinorTreeMapper(new MapperBuilder()->mapper(), SimpleDto::class);
$this->expectException(MappingException::class);
@@ -176,7 +176,7 @@ public function test_rejects_extra_columns_by_default(): void
public function test_wraps_mapping_error_as_mapping_exception_with_previous(): void
{
- $mapper = new ValinorTreeMapper((new MapperBuilder())->mapper(), SimpleDto::class);
+ $mapper = new ValinorTreeMapper(new MapperBuilder()->mapper(), SimpleDto::class);
try {
$mapper->map(['id' => 'not-an-int'], MapperContextMother::any());
diff --git a/src/bridge/psr18/telemetry/composer.json b/src/bridge/psr18/telemetry/composer.json
index a941451b7f..8447c7b828 100644
--- a/src/bridge/psr18/telemetry/composer.json
+++ b/src/bridge/psr18/telemetry/composer.json
@@ -11,7 +11,7 @@
"homepage": "https://github.com/flow-php/flow",
"license": "MIT",
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/telemetry": "self.version",
"psr/http-client": "^1.0",
"psr/http-message": "^1.0 || ^2.0"
diff --git a/src/bridge/psr3/telemetry/composer.json b/src/bridge/psr3/telemetry/composer.json
index f4471c738f..2a04d3a7eb 100644
--- a/src/bridge/psr3/telemetry/composer.json
+++ b/src/bridge/psr3/telemetry/composer.json
@@ -11,7 +11,7 @@
"homepage": "https://github.com/flow-php/flow",
"license": "MIT",
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/telemetry": "self.version",
"psr/log": "^2.0 || ^3.0"
},
diff --git a/src/bridge/psr3/telemetry/tests/Flow/Bridge/Psr3/Telemetry/Tests/Integration/TelemetryTestContext.php b/src/bridge/psr3/telemetry/tests/Flow/Bridge/Psr3/Telemetry/Tests/Integration/TelemetryTestContext.php
index b01929d738..2352fb55ba 100644
--- a/src/bridge/psr3/telemetry/tests/Flow/Bridge/Psr3/Telemetry/Tests/Integration/TelemetryTestContext.php
+++ b/src/bridge/psr3/telemetry/tests/Flow/Bridge/Psr3/Telemetry/Tests/Integration/TelemetryTestContext.php
@@ -26,7 +26,7 @@ public static function create(
): self {
$processor = new MemoryLogProcessor(new VoidExporter());
- $logger = (new LoggerProvider($processor, new SystemClock(), new MemoryContextStorage()))->logger(
+ $logger = new LoggerProvider($processor, new SystemClock(), new MemoryContextStorage())->logger(
$resource ?? Resource::create(['service.name' => 'psr3-test-service']),
$scope,
$version,
diff --git a/src/bridge/psr3/telemetry/tests/Flow/Bridge/Psr3/Telemetry/Tests/Unit/AttributeValueNormalizerTest.php b/src/bridge/psr3/telemetry/tests/Flow/Bridge/Psr3/Telemetry/Tests/Unit/AttributeValueNormalizerTest.php
index ecfa89eec7..f98f128050 100644
--- a/src/bridge/psr3/telemetry/tests/Flow/Bridge/Psr3/Telemetry/Tests/Unit/AttributeValueNormalizerTest.php
+++ b/src/bridge/psr3/telemetry/tests/Flow/Bridge/Psr3/Telemetry/Tests/Unit/AttributeValueNormalizerTest.php
@@ -33,7 +33,7 @@ public function test_normalizes_datetime_passthrough(): void
public function test_normalizes_null_to_string(): void
{
- static::assertSame('null', (new AttributeValueNormalizer())->normalize(null));
+ static::assertSame('null', new AttributeValueNormalizer()->normalize(null));
}
public function test_normalizes_object_with_to_string_to_string(): void
@@ -45,12 +45,12 @@ public function __toString(): string
}
};
- static::assertSame('rendered', (new AttributeValueNormalizer())->normalize($object));
+ static::assertSame('rendered', new AttributeValueNormalizer()->normalize($object));
}
public function test_normalizes_object_without_to_string_to_class_name(): void
{
- static::assertSame(stdClass::class, (new AttributeValueNormalizer())->normalize(new stdClass()));
+ static::assertSame(stdClass::class, new AttributeValueNormalizer()->normalize(new stdClass()));
}
public function test_normalizes_resource_to_debug_type(): void
@@ -59,7 +59,7 @@ public function test_normalizes_resource_to_debug_type(): void
static::assertNotFalse($resource);
try {
- static::assertSame('resource (stream)', (new AttributeValueNormalizer())->normalize($resource));
+ static::assertSame('resource (stream)', new AttributeValueNormalizer()->normalize($resource));
} finally {
fclose($resource);
}
@@ -79,6 +79,6 @@ public function test_normalizes_throwable_passthrough(): void
{
$exception = new RuntimeException('boom');
- static::assertSame($exception, (new AttributeValueNormalizer())->normalize($exception));
+ static::assertSame($exception, new AttributeValueNormalizer()->normalize($exception));
}
}
diff --git a/src/bridge/psr3/telemetry/tests/Flow/Bridge/Psr3/Telemetry/Tests/Unit/LogRecordConverterTest.php b/src/bridge/psr3/telemetry/tests/Flow/Bridge/Psr3/Telemetry/Tests/Unit/LogRecordConverterTest.php
index 44af575ce3..693958e054 100644
--- a/src/bridge/psr3/telemetry/tests/Flow/Bridge/Psr3/Telemetry/Tests/Unit/LogRecordConverterTest.php
+++ b/src/bridge/psr3/telemetry/tests/Flow/Bridge/Psr3/Telemetry/Tests/Unit/LogRecordConverterTest.php
@@ -30,14 +30,14 @@ public function __toString(): string
}
};
- $record = (new LogRecordConverter())->convert(LogLevel::INFO, $message);
+ $record = new LogRecordConverter()->convert(LogLevel::INFO, $message);
static::assertSame('rendered body', $record->body);
}
public function test_context_entries_become_attributes_with_raw_keys(): void
{
- $record = (new LogRecordConverter())->convert(LogLevel::INFO, 'msg', [
+ $record = new LogRecordConverter()->convert(LogLevel::INFO, 'msg', [
'user_id' => 123,
'role' => 'admin',
]);
@@ -48,7 +48,7 @@ public function test_context_entries_become_attributes_with_raw_keys(): void
public function test_default_normalizer_handles_null_in_attributes(): void
{
- $record = (new LogRecordConverter(valueNormalizer: new AttributeValueNormalizer()))->convert(
+ $record = new LogRecordConverter(valueNormalizer: new AttributeValueNormalizer())->convert(
LogLevel::INFO,
'msg',
[
@@ -63,7 +63,7 @@ public function test_exception_in_context_is_routed_via_set_exception(): void
{
$exception = new RuntimeException('boom');
- $record = (new LogRecordConverter())->convert(LogLevel::ERROR, 'failure', [
+ $record = new LogRecordConverter()->convert(LogLevel::ERROR, 'failure', [
'exception' => $exception,
]);
@@ -75,7 +75,7 @@ public function test_exception_in_context_is_routed_via_set_exception(): void
public function test_interpolates_message_placeholders_from_context(): void
{
- $record = (new LogRecordConverter())->convert(LogLevel::INFO, 'User {user_id} performed {action}', [
+ $record = new LogRecordConverter()->convert(LogLevel::INFO, 'User {user_id} performed {action}', [
'user_id' => 123,
'action' => 'login',
]);
@@ -87,7 +87,7 @@ public function test_interpolates_message_placeholders_from_context(): void
public function test_interpolation_renders_arrays_and_plain_objects(): void
{
- $record = (new LogRecordConverter())->convert(LogLevel::INFO, 'Tags {tags} obj {obj}', [
+ $record = new LogRecordConverter()->convert(LogLevel::INFO, 'Tags {tags} obj {obj}', [
'tags' => ['a', 'b'],
'obj' => new stdClass(),
]);
@@ -97,7 +97,7 @@ public function test_interpolation_renders_arrays_and_plain_objects(): void
public function test_interpolation_leaves_absent_placeholders_intact(): void
{
- $record = (new LogRecordConverter())->convert(LogLevel::INFO, 'User {user_id} did {missing}', [
+ $record = new LogRecordConverter()->convert(LogLevel::INFO, 'User {user_id} did {missing}', [
'user_id' => 7,
]);
@@ -106,7 +106,7 @@ public function test_interpolation_leaves_absent_placeholders_intact(): void
public function test_interpolation_renders_datetime(): void
{
- $record = (new LogRecordConverter())->convert(LogLevel::INFO, 'At {when}', [
+ $record = new LogRecordConverter()->convert(LogLevel::INFO, 'At {when}', [
'when' => new DateTimeImmutable('2024-06-15 14:30:00', new DateTimeZone('UTC')),
]);
@@ -115,7 +115,7 @@ public function test_interpolation_renders_datetime(): void
public function test_interpolation_renders_enums(): void
{
- $record = (new LogRecordConverter())->convert(LogLevel::INFO, 'backed {backed} pure {pure}', [
+ $record = new LogRecordConverter()->convert(LogLevel::INFO, 'backed {backed} pure {pure}', [
'backed' => InterpolationBackedEnumFixture::Active,
'pure' => InterpolationUnitEnumFixture::First,
]);
@@ -125,7 +125,7 @@ public function test_interpolation_renders_enums(): void
public function test_interpolation_renders_null_as_empty_string(): void
{
- $record = (new LogRecordConverter())->convert(LogLevel::INFO, 'val={item}', [
+ $record = new LogRecordConverter()->convert(LogLevel::INFO, 'val={item}', [
'item' => null,
]);
@@ -137,7 +137,7 @@ public function test_interpolation_renders_resource_with_type_fallback(): void
$resource = fopen('php://memory', 'rb');
static::assertIsResource($resource);
- $record = (new LogRecordConverter())->convert(LogLevel::INFO, 'res={res}', [
+ $record = new LogRecordConverter()->convert(LogLevel::INFO, 'res={res}', [
'res' => $resource,
]);
@@ -155,7 +155,7 @@ public function __toString(): string
}
};
- $record = (new LogRecordConverter())->convert(LogLevel::INFO, 'value={item}', [
+ $record = new LogRecordConverter()->convert(LogLevel::INFO, 'value={item}', [
'item' => $stringable,
]);
@@ -164,7 +164,7 @@ public function __toString(): string
public function test_message_without_braces_is_returned_verbatim(): void
{
- $record = (new LogRecordConverter())->convert(LogLevel::INFO, 'no placeholders here', [
+ $record = new LogRecordConverter()->convert(LogLevel::INFO, 'no placeholders here', [
'user_id' => 5,
]);
@@ -173,7 +173,7 @@ public function test_message_without_braces_is_returned_verbatim(): void
public function test_non_throwable_under_exception_key_is_stored_as_attribute(): void
{
- $record = (new LogRecordConverter())->convert(LogLevel::ERROR, 'msg', [
+ $record = new LogRecordConverter()->convert(LogLevel::ERROR, 'msg', [
'exception' => 'not-a-throwable',
]);
@@ -183,7 +183,7 @@ public function test_non_throwable_under_exception_key_is_stored_as_attribute():
public function test_normalizes_arbitrary_php_values_in_context(): void
{
- $record = (new LogRecordConverter())->convert(LogLevel::INFO, 'msg', [
+ $record = new LogRecordConverter()->convert(LogLevel::INFO, 'msg', [
'nullable' => null,
'object' => new stdClass(),
]);
@@ -205,7 +205,7 @@ public function test_severity_mapping_uses_provided_mapper(): void
LogLevel::EMERGENCY => Severity::FATAL,
]);
- $record = (new LogRecordConverter($mapper))->convert(LogLevel::DEBUG, 'msg');
+ $record = new LogRecordConverter($mapper)->convert(LogLevel::DEBUG, 'msg');
static::assertSame(Severity::TRACE, $record->severity);
}
@@ -214,6 +214,6 @@ public function test_throws_on_unknown_level(): void
{
$this->expectException(InvalidArgumentException::class);
- (new LogRecordConverter())->convert('verbose', 'msg');
+ new LogRecordConverter()->convert('verbose', 'msg');
}
}
diff --git a/src/bridge/psr3/telemetry/tests/Flow/Bridge/Psr3/Telemetry/Tests/Unit/TelemetryLoggerTest.php b/src/bridge/psr3/telemetry/tests/Flow/Bridge/Psr3/Telemetry/Tests/Unit/TelemetryLoggerTest.php
index f69be34c80..b99c86127a 100644
--- a/src/bridge/psr3/telemetry/tests/Flow/Bridge/Psr3/Telemetry/Tests/Unit/TelemetryLoggerTest.php
+++ b/src/bridge/psr3/telemetry/tests/Flow/Bridge/Psr3/Telemetry/Tests/Unit/TelemetryLoggerTest.php
@@ -47,7 +47,7 @@ protected function setUp(): void
{
$this->processor = new MemoryLogProcessor(new VoidExporter());
- $logger = (new LoggerProvider($this->processor, new SystemClock(), new MemoryContextStorage()))->logger(
+ $logger = new LoggerProvider($this->processor, new SystemClock(), new MemoryContextStorage())->logger(
Resource::empty(),
'psr3-test-scope',
);
@@ -72,7 +72,7 @@ public function test_critical_emits_fatal_severity(): void
public function test_custom_converter_is_used(): void
{
$processor = new MemoryLogProcessor(new VoidExporter());
- $logger = (new LoggerProvider($processor, new SystemClock(), new MemoryContextStorage()))->logger(
+ $logger = new LoggerProvider($processor, new SystemClock(), new MemoryContextStorage())->logger(
Resource::empty(),
'psr3-custom-scope',
);
diff --git a/src/bridge/psr7/telemetry/composer.json b/src/bridge/psr7/telemetry/composer.json
index 5b5702f722..292fd32d3a 100644
--- a/src/bridge/psr7/telemetry/composer.json
+++ b/src/bridge/psr7/telemetry/composer.json
@@ -11,7 +11,7 @@
"homepage": "https://github.com/flow-php/flow",
"license": "MIT",
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/telemetry": "self.version",
"psr/http-message": "^1.0 || ^2.0"
},
diff --git a/src/bridge/psr7/telemetry/tests/Flow/Bridge/Psr7/Telemetry/Tests/Unit/ResponseCarrierTest.php b/src/bridge/psr7/telemetry/tests/Flow/Bridge/Psr7/Telemetry/Tests/Unit/ResponseCarrierTest.php
index 9575306966..32d660575b 100644
--- a/src/bridge/psr7/telemetry/tests/Flow/Bridge/Psr7/Telemetry/Tests/Unit/ResponseCarrierTest.php
+++ b/src/bridge/psr7/telemetry/tests/Flow/Bridge/Psr7/Telemetry/Tests/Unit/ResponseCarrierTest.php
@@ -14,7 +14,7 @@ public function test_fluent_chaining(): void
{
$response = new Response();
- $modifiedResponse = (new ResponseCarrier($response))
+ $modifiedResponse = new ResponseCarrier($response)
->set('X-Header-1', 'value1')
->set('X-Header-2', 'value2')
->unwrap();
diff --git a/src/bridge/symfony/console/composer.json b/src/bridge/symfony/console/composer.json
index 584e4ce20e..d835ea20c6 100644
--- a/src/bridge/symfony/console/composer.json
+++ b/src/bridge/symfony/console/composer.json
@@ -10,8 +10,8 @@
"bridge"
],
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
- "symfony/console": "^6.4.34 || ^7.4.6 || ^8.0.6",
+ "php": "~8.5.0 || ~8.6.0",
+ "symfony/console": "^7.4.6 || ^8.0.6",
"flow-php/etl": "self.version"
},
"config": {
diff --git a/src/bridge/symfony/console/src/Flow/Bridge/Symfony/Console/DSL/functions.php b/src/bridge/symfony/console/src/Flow/Bridge/Symfony/Console/DSL/functions.php
index 95d81e5800..b4ba2ca3e8 100644
--- a/src/bridge/symfony/console/src/Flow/Bridge/Symfony/Console/DSL/functions.php
+++ b/src/bridge/symfony/console/src/Flow/Bridge/Symfony/Console/DSL/functions.php
@@ -15,5 +15,5 @@
#[DocumentationDSL(module: Module::SYMFONY_CONSOLE_BRIDGE, type: DSLType::HELPER)]
function console_heartbeat(OutputInterface $output, ConsoleStyle $style = ConsoleStyle::tasks): ConsoleHeartbeat
{
- return (new ConsoleHeartbeatFactory())->create($output, $style);
+ return new ConsoleHeartbeatFactory()->create($output, $style);
}
diff --git a/src/bridge/symfony/console/src/Flow/Bridge/Symfony/Console/StatusLineHeartbeat.php b/src/bridge/symfony/console/src/Flow/Bridge/Symfony/Console/StatusLineHeartbeat.php
index d68dabc31d..13d8f2e092 100644
--- a/src/bridge/symfony/console/src/Flow/Bridge/Symfony/Console/StatusLineHeartbeat.php
+++ b/src/bridge/symfony/console/src/Flow/Bridge/Symfony/Console/StatusLineHeartbeat.php
@@ -75,7 +75,7 @@ public function finish(): void
if ($this->output instanceof ConsoleSectionOutput) {
$summary === null ? $this->output->clear() : $this->output->overwrite($summary);
} else {
- (new Cursor($this->output))
+ new Cursor($this->output)
->moveToColumn(1)
->clearLine();
@@ -149,7 +149,7 @@ private function message(Pulse $pulse): string
[implode('', $latest)],
],
);
- $width = max(1, min(self::MAX_WIDTH, (new Terminal())->getWidth()) - self::INDICATOR_AND_LAST_COLUMN);
+ $width = max(1, min(self::MAX_WIDTH, new Terminal()->getWidth()) - self::INDICATOR_AND_LAST_COLUMN);
foreach ($candidates as $candidate) {
if ($this->visible($candidate) <= $width) {
diff --git a/src/bridge/symfony/console/src/Flow/Bridge/Symfony/Console/TaskListHeartbeat.php b/src/bridge/symfony/console/src/Flow/Bridge/Symfony/Console/TaskListHeartbeat.php
index 9873dff202..3f5b6d962d 100644
--- a/src/bridge/symfony/console/src/Flow/Bridge/Symfony/Console/TaskListHeartbeat.php
+++ b/src/bridge/symfony/console/src/Flow/Bridge/Symfony/Console/TaskListHeartbeat.php
@@ -74,7 +74,7 @@ public function beat(Pulse $pulse): void
$this->graph?->recorded($pulse);
$this->frame++;
$this->last = $pulse;
- $width = min(self::MAX_WIDTH, (new Terminal())->getWidth()) - 1;
+ $width = min(self::MAX_WIDTH, new Terminal()->getWidth()) - 1;
$exact = $this->lines($pulse, $width, false);
$this->short = $exact === null;
@@ -107,7 +107,7 @@ public function finish(): void
if (StageLine::readCompleted($last)) {
$this->output->writeln('');
- $this->output->writeln($this->summary($last, min(self::MAX_WIDTH, (new Terminal())->getWidth()) - 1));
+ $this->output->writeln($this->summary($last, min(self::MAX_WIDTH, new Terminal()->getWidth()) - 1));
$this->output->writeln('');
}
@@ -381,7 +381,7 @@ private function subjectRoom(string $label, string $count, array $columns, int $
private function redraw(array $lines, array $done): void
{
$from = $this->frozenLines;
- $reachable = max(1, (new Terminal())->getHeight() - 1);
+ $reachable = max(1, new Terminal()->getHeight() - 1);
while ((count($lines) - $this->frozenLines) > $reachable && ($done[$this->frozenLines] ?? false)) {
$this->frozenLines++;
diff --git a/src/bridge/symfony/console/tests/Flow/Bridge/Symfony/Console/Tests/Unit/ConsoleHeartbeatFactoryTest.php b/src/bridge/symfony/console/tests/Flow/Bridge/Symfony/Console/Tests/Unit/ConsoleHeartbeatFactoryTest.php
index de4a843402..f8e8d6f788 100644
--- a/src/bridge/symfony/console/tests/Flow/Bridge/Symfony/Console/Tests/Unit/ConsoleHeartbeatFactoryTest.php
+++ b/src/bridge/symfony/console/tests/Flow/Bridge/Symfony/Console/Tests/Unit/ConsoleHeartbeatFactoryTest.php
@@ -47,7 +47,7 @@ public function test_each_style_on_a_terminal(ConsoleStyle $style, string $class
#[TestWith([ConsoleStyle::line])]
public function test_a_non_terminal_gets_the_log(ConsoleStyle $style): void
{
- static::assertInstanceOf(LogHeartbeat::class, (new ConsoleHeartbeatFactory())->create(
+ static::assertInstanceOf(LogHeartbeat::class, new ConsoleHeartbeatFactory()->create(
new BufferedOutput(),
$style,
));
@@ -60,7 +60,7 @@ public function test_a_section_of_the_caller_gets_the_line(ConsoleStyle $style):
$terminal = new TerminalContext(100);
try {
- static::assertInstanceOf(StatusLineHeartbeat::class, (new ConsoleHeartbeatFactory())->create(
+ static::assertInstanceOf(StatusLineHeartbeat::class, new ConsoleHeartbeatFactory()->create(
$terminal->section(),
$style,
));
diff --git a/src/bridge/symfony/console/tests/Flow/Bridge/Symfony/Console/Tests/Unit/LogHeartbeatTest.php b/src/bridge/symfony/console/tests/Flow/Bridge/Symfony/Console/Tests/Unit/LogHeartbeatTest.php
index ec2cd5cdde..dac2c8f25f 100644
--- a/src/bridge/symfony/console/tests/Flow/Bridge/Symfony/Console/Tests/Unit/LogHeartbeatTest.php
+++ b/src/bridge/symfony/console/tests/Flow/Bridge/Symfony/Console/Tests/Unit/LogHeartbeatTest.php
@@ -26,9 +26,7 @@ public function test_no_progress_line_before_ten_seconds(): void
{
$output = new BufferedOutput();
- (new LogHeartbeat(
- $output,
- ))->beat(PulseMother::pulse(elapsedSeconds: 9.9, stages: [StageProgressMother::open()]));
+ new LogHeartbeat($output)->beat(PulseMother::pulse(elapsedSeconds: 9.9, stages: [StageProgressMother::open()]));
static::assertSame('', $output->fetch());
}
@@ -56,7 +54,7 @@ public function test_a_write_entry_prints_its_done_line(): void
{
$output = new BufferedOutput();
- (new LogHeartbeat($output))->beat(PulseMother::pulse(elapsedSeconds: 1.0, stages: [
+ new LogHeartbeat($output)->beat(PulseMother::pulse(elapsedSeconds: 1.0, stages: [
StageProgressMother::done(StageName::write, 20_000, 0.3, 0.5),
]));
@@ -67,7 +65,7 @@ public function test_a_write_line_shows_its_directory(): void
{
$output = new BufferedOutput();
- (new LogHeartbeat($output))->beat(PulseMother::pulse(elapsedSeconds: 1.0, stages: [
+ new LogHeartbeat($output)->beat(PulseMother::pulse(elapsedSeconds: 1.0, stages: [
StageProgressMother::done(StageName::write, 1_000, 0.3, 0.5, subject: 'file:///out/customer_totals/'),
]));
@@ -78,7 +76,7 @@ public function test_a_write_line_shows_its_collection(): void
{
$output = new BufferedOutput();
- (new LogHeartbeat($output))->beat(PulseMother::pulse(elapsedSeconds: 1.0, stages: [
+ new LogHeartbeat($output)->beat(PulseMother::pulse(elapsedSeconds: 1.0, stages: [
StageProgressMother::done(StageName::write, 1_000, 0.3, 0.5, subject: 'heartbeat_demo_customer_totals'),
]));
@@ -292,7 +290,7 @@ public function test_built_directly_it_draws_on_the_output_it_was_given(): void
try {
$console = $terminal->console();
- (new LogHeartbeat($console))->beat(PulseMother::pulse(elapsedSeconds: 3.0, stages: [
+ new LogHeartbeat($console)->beat(PulseMother::pulse(elapsedSeconds: 3.0, stages: [
StageProgressMother::done(StageName::read, 3, endedAtSeconds: 1.0),
]));
diff --git a/src/bridge/symfony/console/tests/Flow/Bridge/Symfony/Console/Tests/Unit/StageLineTest.php b/src/bridge/symfony/console/tests/Flow/Bridge/Symfony/Console/Tests/Unit/StageLineTest.php
index 00073ddcf0..d833b0efc6 100644
--- a/src/bridge/symfony/console/tests/Flow/Bridge/Symfony/Console/Tests/Unit/StageLineTest.php
+++ b/src/bridge/symfony/console/tests/Flow/Bridge/Symfony/Console/Tests/Unit/StageLineTest.php
@@ -24,10 +24,10 @@ public function test_location_keeps_the_last_segments(string $location, string $
{
static::assertSame(
$shown,
- (new StageLine(
+ new StageLine(
StageProgressMother::open(subject: $location),
PulseMother::pulse(elapsedSeconds: 2.0),
- ))->subject(24),
+ )->subject(24),
);
}
@@ -35,33 +35,32 @@ public function test_a_long_location_is_cut_from_the_left(): void
{
static::assertSame(
'…' . str_repeat('a', 15) . '.csv',
- (new StageLine(
+ new StageLine(
StageProgressMother::open(subject: 'memory://in/' . str_repeat('a', 36) . '.csv'),
PulseMother::pulse(elapsedSeconds: 2.0),
- ))->subject(20),
+ )->subject(20),
);
}
public function test_no_location_below_eight_columns_or_without_one(): void
{
- static::assertNull((new StageLine(
+ static::assertNull(new StageLine(
StageProgressMother::open(subject: 'memory://in/orders.csv'),
PulseMother::pulse(elapsedSeconds: 2.0),
- ))->subject(7));
- static::assertNull((new StageLine(
- StageProgressMother::open(),
- PulseMother::pulse(elapsedSeconds: 2.0),
- ))->subject(24));
+ )->subject(7));
+ static::assertNull(new StageLine(StageProgressMother::open(), PulseMother::pulse(elapsedSeconds: 2.0))->subject(
+ 24,
+ ));
}
public function test_the_label_reads_without_an_underscore(): void
{
static::assertSame(
'group by',
- (new StageLine(
+ new StageLine(
StageProgressMother::open(StageName::group_by),
PulseMother::pulse(elapsedSeconds: 2.0),
- ))->label(),
+ )->label(),
);
}
@@ -95,14 +94,14 @@ public function test_a_count_of_one_names_its_unit_in_the_singular(ProgressUnit
public function test_a_count_against_a_total_of_one_names_its_unit_in_the_singular(): void
{
static::assertSame(['0 / 1 row', '1 / 5 rows'], [
- (new StageLine(
+ new StageLine(
StageProgressMother::open(StageName::read, 0, 1),
PulseMother::pulse(elapsedSeconds: 2.0),
- ))->exactCount(),
- (new StageLine(
+ )->exactCount(),
+ new StageLine(
StageProgressMother::open(StageName::read, 1, 5),
PulseMother::pulse(elapsedSeconds: 2.0),
- ))->exactCount(),
+ )->exactCount(),
]);
}
@@ -127,27 +126,21 @@ public function test_rate_is_for_rows_only(): void
$pulse = PulseMother::pulse(elapsedSeconds: 2.0);
static::assertSame(['5.5M/s', null, null], [
- (new StageLine(StageProgressMother::open(count: 11_000_000), $pulse))->rate(),
- (new StageLine(
+ new StageLine(StageProgressMother::open(count: 11_000_000), $pulse)->rate(),
+ new StageLine(
StageProgressMother::open(StageName::group_by, 40, unit: ProgressUnit::groups),
$pulse,
- ))->rate(),
- (new StageLine(StageProgressMother::open(StageName::commit, 8, unit: ProgressUnit::files), $pulse))->rate(),
+ )->rate(),
+ new StageLine(StageProgressMother::open(StageName::commit, 8, unit: ProgressUnit::files), $pulse)->rate(),
]);
}
public function test_no_rate_for_a_stage_shorter_than_half_a_second(): void
{
static::assertSame([null, null, '1.0M/s'], [
- (new StageLine(StageProgressMother::done(count: 400, endedAtSeconds: 0.4), PulseMother::pulse()))->rate(),
- (new StageLine(
- StageProgressMother::open(count: 400),
- PulseMother::pulse(elapsedSeconds: 0.49),
- ))->perSecond(),
- (new StageLine(
- StageProgressMother::done(count: 500_000, endedAtSeconds: 0.5),
- PulseMother::pulse(),
- ))->rate(),
+ new StageLine(StageProgressMother::done(count: 400, endedAtSeconds: 0.4), PulseMother::pulse())->rate(),
+ new StageLine(StageProgressMother::open(count: 400), PulseMother::pulse(elapsedSeconds: 0.49))->perSecond(),
+ new StageLine(StageProgressMother::done(count: 500_000, endedAtSeconds: 0.5), PulseMother::pulse())->rate(),
]);
}
@@ -156,8 +149,8 @@ public function test_duration_runs_to_the_end_or_to_now(): void
$pulse = PulseMother::pulse(elapsedSeconds: 9.2);
static::assertSame(['6.6s', '8.0s'], [
- (new StageLine(StageProgressMother::done(startedAtSeconds: 0.2, endedAtSeconds: 6.8), $pulse))->duration(),
- (new StageLine(StageProgressMother::open(startedAtSeconds: 1.2), $pulse))->duration(),
+ new StageLine(StageProgressMother::done(startedAtSeconds: 0.2, endedAtSeconds: 6.8), $pulse)->duration(),
+ new StageLine(StageProgressMother::open(startedAtSeconds: 1.2), $pulse)->duration(),
]);
}
@@ -214,14 +207,14 @@ public function test_files_sum_every_commit_entry(): void
public function test_an_ended_entry_or_a_zero_total_shows_no_percentage(): void
{
static::assertSame([null, null], [
- (new StageLine(
+ new StageLine(
StageProgressMother::done(StageName::read, 30_000_000, total: 30_000_000),
PulseMother::pulse(elapsedSeconds: 7.0),
- ))->percent(),
- (new StageLine(
+ )->percent(),
+ new StageLine(
StageProgressMother::open(StageName::read, 0, 0),
PulseMother::pulse(elapsedSeconds: 2.0),
- ))->percent(),
+ )->percent(),
]);
}
}
diff --git a/src/bridge/symfony/console/tests/Flow/Bridge/Symfony/Console/Tests/Unit/StatusLineHeartbeatTest.php b/src/bridge/symfony/console/tests/Flow/Bridge/Symfony/Console/Tests/Unit/StatusLineHeartbeatTest.php
index dcc0c24794..37d01794ef 100644
--- a/src/bridge/symfony/console/tests/Flow/Bridge/Symfony/Console/Tests/Unit/StatusLineHeartbeatTest.php
+++ b/src/bridge/symfony/console/tests/Flow/Bridge/Symfony/Console/Tests/Unit/StatusLineHeartbeatTest.php
@@ -64,7 +64,7 @@ public function test_the_first_candidate_that_fits_is_drawn(int $columns, string
$this->terminal->columns($columns);
$output = $this->terminal->stream();
- (new StatusLineHeartbeat($output))->beat(PulseMother::pulse(elapsedSeconds: 6.0, stages: $this->stages));
+ new StatusLineHeartbeat($output)->beat(PulseMother::pulse(elapsedSeconds: 6.0, stages: $this->stages));
static::assertSame($line, str_replace("\r", '', $this->terminal->text($output)));
}
@@ -127,7 +127,7 @@ public function test_a_planned_entry_is_left_out_and_a_skipped_one_is_finished_w
{
$output = $this->terminal->stream();
- (new StatusLineHeartbeat($output))->beat(PulseMother::pulse(elapsedSeconds: 6.0, stages: [
+ new StatusLineHeartbeat($output)->beat(PulseMother::pulse(elapsedSeconds: 6.0, stages: [
StageProgressMother::skipped(StageName::sort, 5.0, id: 1),
StageProgressMother::open(StageName::read, 10, id: 2),
StageProgressMother::planned(StageName::commit, id: 3),
@@ -151,7 +151,7 @@ public function test_built_directly_it_draws_on_the_output_it_was_given(): void
{
$console = $this->terminal->console();
- (new StatusLineHeartbeat($console))->beat(PulseMother::pulse());
+ new StatusLineHeartbeat($console)->beat(PulseMother::pulse());
static::assertSame([true, ''], [
str_contains($this->terminal->text($console), ' sort 1.3M rows'),
@@ -174,7 +174,7 @@ public function test_memory_shows_at_verbose(): void
{
$output = $this->terminal->stream(OutputInterface::VERBOSITY_VERBOSE);
- (new StatusLineHeartbeat($output))->beat(PulseMother::pulse());
+ new StatusLineHeartbeat($output)->beat(PulseMother::pulse());
static::assertStringEndsWith(' sort 1.3M rows 15.1K/s 142 MiB · 1m 23s', $this->terminal->text($output));
}
@@ -210,7 +210,7 @@ public function test_a_subject_with_console_tags_prints_them_literally(): void
{
$output = $this->terminal->stream();
- (new StatusLineHeartbeat($output))->beat(PulseMother::pulse(stages: [
+ new StatusLineHeartbeat($output)->beat(PulseMother::pulse(stages: [
StageProgressMother::open(count: 1_250_000, subject: 'x'),
]));
@@ -236,7 +236,7 @@ public function test_finish_without_a_beat_does_nothing(): void
$output = $this->terminal->stream();
$output->write('command line');
- (new StatusLineHeartbeat($output))->finish();
+ new StatusLineHeartbeat($output)->finish();
static::assertSame('command line', $this->terminal->raw($output));
}
@@ -259,7 +259,7 @@ public function test_a_line_is_at_most_100_columns_on_a_wider_terminal(): void
$this->terminal->columns(150);
$output = $this->terminal->stream();
- (new StatusLineHeartbeat($output))->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [
+ new StatusLineHeartbeat($output)->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [
StageProgressMother::open(StageName::sort, 15_301_437, subject: 'memory://in/orders.floe'),
StageProgressMother::open(StageName::join, 11, id: 2),
StageProgressMother::open(StageName::group_by, 3, id: 3),
@@ -275,9 +275,9 @@ public function test_a_terminal_of_a_few_columns_still_gets_one_character(): voi
$this->terminal->columns(2);
$output = $this->terminal->stream();
- (new StatusLineHeartbeat(
+ new StatusLineHeartbeat(
$output,
- ))->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [StageProgressMother::open(
+ )->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [StageProgressMother::open(
StageName::sort,
15_301_437,
)]));
@@ -289,7 +289,7 @@ public function test_a_pulse_with_no_stage_shows_the_time_only(): void
{
$output = $this->terminal->stream();
- (new StatusLineHeartbeat($output))->beat(PulseMother::pulse(elapsedSeconds: 83.0, stages: []));
+ new StatusLineHeartbeat($output)->beat(PulseMother::pulse(elapsedSeconds: 83.0, stages: []));
static::assertSame("\r ⠋ 1m 23s", $this->terminal->text($output));
}
diff --git a/src/bridge/symfony/console/tests/Flow/Bridge/Symfony/Console/Tests/Unit/TaskListHeartbeatTest.php b/src/bridge/symfony/console/tests/Flow/Bridge/Symfony/Console/Tests/Unit/TaskListHeartbeatTest.php
index 322f75dbbf..860ba467f9 100644
--- a/src/bridge/symfony/console/tests/Flow/Bridge/Symfony/Console/Tests/Unit/TaskListHeartbeatTest.php
+++ b/src/bridge/symfony/console/tests/Flow/Bridge/Symfony/Console/Tests/Unit/TaskListHeartbeatTest.php
@@ -53,7 +53,7 @@ public function test_open_entries_at_100_columns(): void
{
$output = $this->terminal->stream();
- (new TaskListHeartbeat($output))->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [
+ new TaskListHeartbeat($output)->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [
StageProgressMother::open(StageName::read, 15_301_437, 30_000_000, subject: 'memory://in/orders.csv'),
StageProgressMother::open(StageName::sort, 11_300_000, id: 2, startedAtSeconds: 0.2),
]));
@@ -75,7 +75,7 @@ public function test_a_narrow_line_drops_the_rate_shortens_the_count_then_cuts_a
$this->terminal->columns($columns);
$output = $this->terminal->stream();
- (new TaskListHeartbeat($output))->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [
+ new TaskListHeartbeat($output)->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [
StageProgressMother::open(StageName::read, 15_301_437, 30_000_000, subject: 'memory://in/orders.csv'),
]));
@@ -214,7 +214,7 @@ public function test_memory_shows_at_verbose(): void
{
$output = $this->terminal->stream(OutputInterface::VERBOSITY_VERBOSE);
- (new TaskListHeartbeat($output))->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [
+ new TaskListHeartbeat($output)->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [
StageProgressMother::open(StageName::sort, 11_300_000),
]));
@@ -379,7 +379,7 @@ public function test_an_entry_without_a_location_has_no_location_column(): void
{
$output = $this->terminal->stream();
- (new TaskListHeartbeat($output))->beat(PulseMother::pulse(stages: [StageProgressMother::done(
+ new TaskListHeartbeat($output)->beat(PulseMother::pulse(stages: [StageProgressMother::done(
StageName::group_by,
40,
6.6,
@@ -574,7 +574,7 @@ public function test_the_graph_style_draws_a_sparkline_from_90_columns(int $colu
$this->terminal->columns($columns);
$output = $this->terminal->stream();
- (new ConsoleHeartbeatFactory())
+ new ConsoleHeartbeatFactory()
->create($output, ConsoleStyle::graph)
->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [StageProgressMother::open(count: 11_300_000)]));
@@ -584,7 +584,7 @@ public function test_the_graph_style_draws_a_sparkline_from_90_columns(int $colu
public function test_the_dot_leader_of_a_short_sparkline_runs_up_to_its_first_bar(): void
{
$output = $this->terminal->stream();
- $heartbeat = (new ConsoleHeartbeatFactory())->create($output, ConsoleStyle::graph);
+ $heartbeat = new ConsoleHeartbeatFactory()->create($output, ConsoleStyle::graph);
$heartbeat->beat(PulseMother::pulse(elapsedSeconds: 1.0, stages: [StageProgressMother::open(count: 10)]));
$heartbeat->beat(PulseMother::pulse(beat: 2, elapsedSeconds: 2.0, stages: [
@@ -680,7 +680,7 @@ public function test_a_line_is_at_most_100_columns_on_a_wider_terminal(): void
$this->terminal->columns(150);
$output = $this->terminal->stream();
- (new TaskListHeartbeat($output))->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [
+ new TaskListHeartbeat($output)->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [
StageProgressMother::open(
StageName::sort,
15_301_437,
@@ -697,7 +697,7 @@ public function test_a_subject_that_fits_is_not_cut(): void
$this->terminal->columns(96);
$output = $this->terminal->stream();
- (new TaskListHeartbeat($output))->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [
+ new TaskListHeartbeat($output)->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [
StageProgressMother::done(
StageName::read,
1_000_000,
@@ -716,7 +716,7 @@ public function test_a_long_subject_is_cut_to_the_room_of_the_line(): void
$this->terminal->columns(96);
$output = $this->terminal->stream();
- (new TaskListHeartbeat($output))->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [
+ new TaskListHeartbeat($output)->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [
StageProgressMother::done(
StageName::read,
1_000_000,
@@ -735,9 +735,7 @@ public function test_memory_drops_before_the_rate(): void
$this->terminal->columns(56);
$output = $this->terminal->stream(OutputInterface::VERBOSITY_VERBOSE);
- (new TaskListHeartbeat(
- $output,
- ))->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [StageProgressMother::open(
+ new TaskListHeartbeat($output)->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [StageProgressMother::open(
StageName::sort,
15_301_437,
)]));
@@ -750,7 +748,7 @@ public function test_a_terminal_too_narrow_for_any_dots_gets_the_label_the_count
$this->terminal->columns(30);
$output = $this->terminal->stream();
- (new TaskListHeartbeat($output))->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [
+ new TaskListHeartbeat($output)->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [
StageProgressMother::open(
StageName::sort,
15_301_437,
@@ -766,9 +764,9 @@ public function test_built_directly_it_draws_on_the_output_it_was_given(): void
{
$console = $this->terminal->console();
- (new TaskListHeartbeat(
+ new TaskListHeartbeat(
$console,
- ))->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [StageProgressMother::open()]));
+ )->beat(PulseMother::pulse(elapsedSeconds: 2.0, stages: [StageProgressMother::open()]));
static::assertSame([true, ''], [
str_contains($this->terminal->text($console), ' sort '),
diff --git a/src/bridge/symfony/filesystem-bundle/composer.json b/src/bridge/symfony/filesystem-bundle/composer.json
index 3733381aab..aa6b6687a7 100644
--- a/src/bridge/symfony/filesystem-bundle/composer.json
+++ b/src/bridge/symfony/filesystem-bundle/composer.json
@@ -11,19 +11,19 @@
"homepage": "https://github.com/flow-php/flow",
"license": "MIT",
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/filesystem": "self.version",
"flow-php/types": "self.version",
- "symfony/config": "^6.4 || ^7.4 || ^8.0",
- "symfony/dependency-injection": "^6.4 || ^7.4 || ^8.0",
- "symfony/http-kernel": "^6.4 || ^7.4 || ^8.0"
+ "symfony/config": "^7.4 || ^8.0",
+ "symfony/dependency-injection": "^7.4 || ^8.0",
+ "symfony/http-kernel": "^7.4 || ^8.0"
},
"require-dev": {
"flow-php/filesystem-async-aws-bridge": "self.version",
"flow-php/filesystem-azure-bridge": "self.version",
"flow-php/symfony-filesystem-cache-bridge": "self.version",
- "symfony/cache": "^6.4 || ^7.4 || ^8.0",
- "symfony/framework-bundle": "^6.4 || ^7.4 || ^8.0"
+ "symfony/cache": "^7.4 || ^8.0",
+ "symfony/framework-bundle": "^7.4 || ^8.0"
},
"suggest": {
"flow-php/filesystem-async-aws-bridge": "Required for the `aws_s3` filesystem type.",
diff --git a/src/bridge/symfony/filesystem-bundle/src/Flow/Bridge/Symfony/FilesystemBundle/DependencyInjection/Compiler/BuildFstabsPass.php b/src/bridge/symfony/filesystem-bundle/src/Flow/Bridge/Symfony/FilesystemBundle/DependencyInjection/Compiler/BuildFstabsPass.php
index fee0a6e1a1..dabc188332 100644
--- a/src/bridge/symfony/filesystem-bundle/src/Flow/Bridge/Symfony/FilesystemBundle/DependencyInjection/Compiler/BuildFstabsPass.php
+++ b/src/bridge/symfony/filesystem-bundle/src/Flow/Bridge/Symfony/FilesystemBundle/DependencyInjection/Compiler/BuildFstabsPass.php
@@ -107,7 +107,7 @@ public function process(ContainerBuilder $container): void
$mountServiceId = self::MOUNT_SERVICE_PREFIX . $fstabNameStr . '.' . $mountName;
$container->setDefinition(
$mountServiceId,
- (new Definition(Filesystem::class))
+ new Definition(Filesystem::class)
->setFactory([new Reference(RegisterFilesystemFactoriesPass::REGISTRY_SERVICE_ID), 'create'])
->setArguments([$fstabNameStr, $mountName, $resolvedEntry])
->setPublic(false),
diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Context/SymfonyContext.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Context/SymfonyContext.php
index 265cc8fd12..2ecc65e833 100644
--- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Context/SymfonyContext.php
+++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Context/SymfonyContext.php
@@ -68,7 +68,7 @@ public function bootTracedMemoryFstab(callable $configurator): TestKernel
): void {
$container->setDefinition(
'app.telemetry',
- (new Definition(Telemetry::class))->setFactory([TelemetryStubFactory::class, 'create']),
+ new Definition(Telemetry::class)->setFactory([TelemetryStubFactory::class, 'create']),
);
$container->setDefinition('app.clock', new Definition(SystemClock::class));
$configurator($container);
diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Fixtures/TestKernel.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Fixtures/TestKernel.php
index f17728c3f7..f3a8e966c7 100644
--- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Fixtures/TestKernel.php
+++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Fixtures/TestKernel.php
@@ -9,7 +9,7 @@
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\HttpKernel\Bundle\BundleInterface;
+use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\Kernel;
use function array_merge;
@@ -20,7 +20,7 @@
final class TestKernel extends Kernel
{
- /** @var array> */
+ /** @var array> */
private array $testBundles = [];
/** @var array */
@@ -42,7 +42,7 @@ public function __construct(string $environment = 'test', bool $debug = true)
}
/**
- * @param class-string $bundleClass
+ * @param class-string $bundleClass
*/
public function addTestBundle(string $bundleClass): void
{
diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Integration/CachePoolRegistrationTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Integration/CachePoolRegistrationTest.php
index cb90d5d1cd..b6a2d7aed0 100644
--- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Integration/CachePoolRegistrationTest.php
+++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Integration/CachePoolRegistrationTest.php
@@ -62,7 +62,7 @@ public function test_cache_pool_with_marshaller_service_id_injects_marshaller():
$kernel->addTestContainerConfigurator(static function (ContainerBuilder $container): void {
$container->setDefinition(
'test.marshaller',
- (new Definition(DefaultMarshaller::class))->setPublic(true),
+ new Definition(DefaultMarshaller::class)->setPublic(true),
);
});
},
@@ -74,7 +74,7 @@ public function test_cache_pool_with_marshaller_service_id_injects_marshaller():
static::assertSame(
$container->get('test.marshaller'),
- (new ReflectionObject($adapter))
+ new ReflectionObject($adapter)
->getProperty('marshaller')
->getValue($adapter),
);
diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Attribute/AsFilesystemFactoryTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Attribute/AsFilesystemFactoryTest.php
index 6e7ee703f6..a0fbcfae1b 100644
--- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Attribute/AsFilesystemFactoryTest.php
+++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Attribute/AsFilesystemFactoryTest.php
@@ -22,6 +22,6 @@ public function test_attribute_targets_class_only(): void
public function test_exposes_type_as_public_readonly(): void
{
- static::assertSame('file', (new AsFilesystemFactory(type: 'file'))->type);
+ static::assertSame('file', new AsFilesystemFactory(type: 'file')->type);
}
}
diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Attribute/AsFilesystemTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Attribute/AsFilesystemTest.php
index 2fa3737447..99355d7f42 100644
--- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Attribute/AsFilesystemTest.php
+++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Attribute/AsFilesystemTest.php
@@ -22,7 +22,7 @@ public function test_attribute_targets_parameter_only(): void
public function test_defaults_fstab_to_null(): void
{
- static::assertNull((new AsFilesystem(mount: 'memory'))->fstab);
+ static::assertNull(new AsFilesystem(mount: 'memory')->fstab);
}
public function test_exposes_mount_and_fstab_as_public_readonly(): void
diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/ConfigurationTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/ConfigurationTest.php
index 677598e7a5..14cfec411a 100644
--- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/ConfigurationTest.php
+++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/ConfigurationTest.php
@@ -430,7 +430,7 @@ public function test_valid_hyphenated_mount_names_are_preserved_without_normaliz
], static function (ContainerBuilder $container): void {
$container->setDefinition(
'x',
- (new Definition(S3Client::class))->setArguments([[
+ new Definition(S3Client::class)->setArguments([[
'accessKeyId' => 'k',
'accessKeySecret' => 's',
'region' => 'us-east-1',
@@ -438,7 +438,7 @@ public function test_valid_hyphenated_mount_names_are_preserved_without_normaliz
);
$container->setDefinition(
'y',
- (new Definition(BlobServiceInterface::class))
+ new Definition(BlobServiceInterface::class)
->setSynthetic(true)
->setPublic(false),
);
@@ -540,11 +540,9 @@ public function test_valid_telemetry_fully_configured(): void
], static function (ContainerBuilder $container): void {
$container->setDefinition(
'app.telemetry',
- (new Definition(Telemetry::class))->setFactory([TelemetryStubFactory::class, 'create'])->setPublic(
- true,
- ),
+ new Definition(Telemetry::class)->setFactory([TelemetryStubFactory::class, 'create'])->setPublic(true),
);
- $container->setDefinition('app.clock', (new Definition(SystemClock::class))->setPublic(true));
+ $container->setDefinition('app.clock', new Definition(SystemClock::class)->setPublic(true));
});
$fstabs = is_array($config['fstabs'] ?? null) ? $config['fstabs'] : [];
diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/BuildFstabsPassTelemetryTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/BuildFstabsPassTelemetryTest.php
index ed741b6c7f..cca8750f09 100644
--- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/BuildFstabsPassTelemetryTest.php
+++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/BuildFstabsPassTelemetryTest.php
@@ -41,7 +41,7 @@ public function test_creates_telemetry_config_definition_when_enabled(): void
],
]);
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
static::assertTrue($container->hasDefinition('.flow.filesystem.telemetry_config.default'));
$configDefinition = $container->getDefinition('.flow.filesystem.telemetry_config.default');
@@ -76,7 +76,7 @@ public function test_adds_no_with_telemetry_call_when_disabled(): void
],
]);
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
static::assertSame([], $container->getDefinition('.flow.filesystem.fstab.default')->getMethodCalls());
}
@@ -101,7 +101,7 @@ public function test_throws_when_telemetry_enabled_without_clock_service_id(): v
$this->expectException(LogicException::class);
$this->expectExceptionMessage('clock_service_id');
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
}
public function test_throws_when_telemetry_enabled_without_telemetry_service_id(): void
@@ -124,6 +124,6 @@ public function test_throws_when_telemetry_enabled_without_telemetry_service_id(
$this->expectException(LogicException::class);
$this->expectExceptionMessage('telemetry_service_id');
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
}
}
diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/BuildFstabsPassTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/BuildFstabsPassTest.php
index ab3d254dfe..84fd68f289 100644
--- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/BuildFstabsPassTest.php
+++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/BuildFstabsPassTest.php
@@ -37,7 +37,7 @@ public function test_camel_cases_snake_case_fstab_names_in_alias(): void
],
]);
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
static::assertTrue($container->hasAlias(FilesystemTable::class . ' $myWarehouseFstab'));
}
@@ -55,7 +55,7 @@ public function test_does_not_register_fqcn_alias_when_default_fstab_null(): voi
],
]);
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
static::assertFalse($container->hasAlias(FilesystemTable::class));
}
@@ -64,7 +64,7 @@ public function test_does_nothing_when_config_parameter_missing(): void
{
$container = new ContainerBuilder();
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
static::assertFalse($container->hasDefinition('.flow.filesystem.fstab.default'));
}
@@ -83,7 +83,7 @@ public function test_fstab_service_is_built_from_its_mount_services(): void
],
]);
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
$definition = $container->getDefinition('.flow.filesystem.fstab.default');
@@ -110,7 +110,7 @@ public function test_registers_private_mount_service_for_each_mount(): void
],
]);
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
$definition = $container->getDefinition('flow.filesystem.mount.default.memory');
@@ -138,7 +138,7 @@ public function test_registers_fqcn_alias_pointing_to_default_fstab(): void
],
]);
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
static::assertTrue($container->hasAlias(FilesystemTable::class));
$alias = $container->getAlias(FilesystemTable::class);
@@ -159,7 +159,7 @@ public function test_registers_named_argument_alias_for_each_fstab(): void
],
]);
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
$aliasId = FilesystemTable::class . ' $defaultFstab';
static::assertTrue($container->hasAlias($aliasId));
@@ -186,7 +186,7 @@ public function test_registers_private_fstab_service_for_each_configured_fstab()
],
]);
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
$defaultDef = $container->getDefinition('.flow.filesystem.fstab.default');
static::assertSame(FilesystemTable::class, $defaultDef->getClass());
@@ -212,7 +212,7 @@ public function test_throws_on_unknown_default_fstab(): void
$this->expectException(LogicException::class);
$this->expectExceptionMessage('flow_filesystem: default_fstab "nope"');
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
}
public function test_throws_on_unknown_type_at_compile_time(): void
@@ -233,7 +233,7 @@ public function test_throws_on_unknown_type_at_compile_time(): void
'Fstab "default" mount "ftp": no filesystem factory registered for type "aws_s3"',
);
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
}
public function test_registers_per_mount_filesystem_service_resolving_through_fstab(): void
@@ -249,7 +249,7 @@ public function test_registers_per_mount_filesystem_service_resolving_through_fs
],
]);
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
$definition = $container->getDefinition('.flow.filesystem.fs.default.memory');
@@ -272,7 +272,7 @@ public function test_registers_bare_and_prefixed_mount_aliases_for_default_fstab
],
]);
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
static::assertSame(
'.flow.filesystem.fs.default.memory',
@@ -302,7 +302,7 @@ public function test_registers_only_prefixed_mount_alias_for_non_default_fstab()
],
]);
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
static::assertTrue($container->hasAlias(Filesystem::class . ' $secondaryFile'));
static::assertFalse($container->hasAlias(Filesystem::class . ' $file'));
@@ -321,7 +321,7 @@ public function test_camel_cases_separator_protocols_in_mount_aliases(): void
],
]);
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
static::assertTrue($container->hasDefinition('.flow.filesystem.fs.default.aws-s3'));
static::assertTrue($container->hasAlias(Filesystem::class . ' $awsS3'));
@@ -353,7 +353,7 @@ public function test_resolves_aws_s3_client_service_ids_to_references(): void
AsyncAwsS3FilesystemFactory::class,
)->addTag('flow.filesystem.factory', ['type' => 'aws_s3']);
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
static::assertEquals(
[
@@ -400,7 +400,7 @@ public function test_resolves_azure_blob_client_service_ids_to_references(): voi
AzureBlobFilesystemFactory::class,
)->addTag('flow.filesystem.factory', ['type' => 'azure_blob']);
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
static::assertEquals(
[
@@ -427,7 +427,7 @@ public function test_skips_a_config_parameter_that_is_not_an_array(): void
$container = new ContainerBuilder();
$container->setParameter(BuildFstabsPass::CONFIG_PARAMETER, 'not an array');
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
static::assertFalse($container->hasAlias(FilesystemTable::class));
}
@@ -447,7 +447,7 @@ public function test_skips_fstabs_and_mounts_that_are_not_arrays(): void
],
]);
- (new BuildFstabsPass())->process($container);
+ new BuildFstabsPass()->process($container);
static::assertTrue($container->hasDefinition('flow.filesystem.mount.default.memory'));
static::assertFalse($container->hasDefinition('flow.filesystem.mount.default.broken'));
diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/RegisterFilesystemFactoriesPassTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/RegisterFilesystemFactoriesPassTest.php
index 5d2f40ba11..23356a2411 100644
--- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/RegisterFilesystemFactoriesPassTest.php
+++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/RegisterFilesystemFactoriesPassTest.php
@@ -23,7 +23,7 @@ public function test_does_nothing_when_registry_definition_absent(): void
{
$container = new ContainerBuilder();
- (new RegisterFilesystemFactoriesPass())->process($container);
+ new RegisterFilesystemFactoriesPass()->process($container);
static::assertFalse($container->hasDefinition('.flow.filesystem.factory_registry'));
}
@@ -31,9 +31,9 @@ public function test_does_nothing_when_registry_definition_absent(): void
public function test_injects_tagged_factories_as_references(): void
{
$container = new ContainerBuilder();
- $container->setDefinition('.flow.filesystem.factory_registry', (new Definition(
+ $container->setDefinition('.flow.filesystem.factory_registry', new Definition(
FilesystemFactoryRegistry::class,
- ))->setArgument(0, []));
+ )->setArgument(0, []));
$memory = new Definition(MemoryFilesystemFactory::class);
$memory->addTag('flow.filesystem.factory', ['type' => 'memory']);
@@ -43,7 +43,7 @@ public function test_injects_tagged_factories_as_references(): void
$native->addTag('flow.filesystem.factory', ['type' => 'file']);
$container->setDefinition('.flow.filesystem.factory.file', $native);
- (new RegisterFilesystemFactoriesPass())->process($container);
+ new RegisterFilesystemFactoriesPass()->process($container);
// @mago-expect analysis:mixed-assignment
$argument = $container->getDefinition('.flow.filesystem.factory_registry')->getArgument(0);
@@ -59,11 +59,11 @@ public function test_injects_tagged_factories_as_references(): void
public function test_leaves_registry_empty_when_no_tagged_services(): void
{
$container = new ContainerBuilder();
- $container->setDefinition('.flow.filesystem.factory_registry', (new Definition(
+ $container->setDefinition('.flow.filesystem.factory_registry', new Definition(
FilesystemFactoryRegistry::class,
- ))->setArgument(0, []));
+ )->setArgument(0, []));
- (new RegisterFilesystemFactoriesPass())->process($container);
+ new RegisterFilesystemFactoriesPass()->process($container);
static::assertSame([], $container->getDefinition('.flow.filesystem.factory_registry')->getArgument(0));
}
@@ -71,9 +71,9 @@ public function test_leaves_registry_empty_when_no_tagged_services(): void
public function test_throws_on_duplicate_type_across_services(): void
{
$container = new ContainerBuilder();
- $container->setDefinition('.flow.filesystem.factory_registry', (new Definition(
+ $container->setDefinition('.flow.filesystem.factory_registry', new Definition(
FilesystemFactoryRegistry::class,
- ))->setArgument(0, []));
+ )->setArgument(0, []));
$a = new Definition(MemoryFilesystemFactory::class);
$a->addTag('flow.filesystem.factory', ['type' => 'memory']);
@@ -86,15 +86,15 @@ public function test_throws_on_duplicate_type_across_services(): void
$this->expectException(LogicException::class);
$this->expectExceptionMessage('Duplicate filesystem factory for type "memory"');
- (new RegisterFilesystemFactoriesPass())->process($container);
+ new RegisterFilesystemFactoriesPass()->process($container);
}
public function test_throws_on_tag_without_type_attribute(): void
{
$container = new ContainerBuilder();
- $container->setDefinition('.flow.filesystem.factory_registry', (new Definition(
+ $container->setDefinition('.flow.filesystem.factory_registry', new Definition(
FilesystemFactoryRegistry::class,
- ))->setArgument(0, []));
+ )->setArgument(0, []));
$memory = new Definition(MemoryFilesystemFactory::class);
$memory->addTag('flow.filesystem.factory');
@@ -103,6 +103,6 @@ public function test_throws_on_tag_without_type_attribute(): void
$this->expectException(LogicException::class);
$this->expectExceptionMessage('missing a non-empty "type" attribute');
- (new RegisterFilesystemFactoriesPass())->process($container);
+ new RegisterFilesystemFactoriesPass()->process($container);
}
}
diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/RegisterFstabLocatorPassTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/RegisterFstabLocatorPassTest.php
index 7bea2db715..ef58d4bdd3 100644
--- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/RegisterFstabLocatorPassTest.php
+++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/RegisterFstabLocatorPassTest.php
@@ -23,7 +23,7 @@ public function test_default_fstab_parameter_is_empty_string_when_null(): void
'fstabs' => ['primary' => ['filesystems' => ['memory' => []]]],
]);
- (new RegisterFstabLocatorPass())->process($container);
+ new RegisterFstabLocatorPass()->process($container);
static::assertSame('', $container->getParameter(RegisterFstabLocatorPass::DEFAULT_FSTAB_PARAMETER));
}
@@ -32,7 +32,7 @@ public function test_does_nothing_when_config_parameter_missing(): void
{
$container = new ContainerBuilder();
- (new RegisterFstabLocatorPass())->process($container);
+ new RegisterFstabLocatorPass()->process($container);
static::assertFalse($container->hasDefinition(RegisterFstabLocatorPass::LOCATOR_SERVICE_ID));
static::assertFalse($container->hasParameter(RegisterFstabLocatorPass::DEFAULT_FSTAB_PARAMETER));
@@ -46,7 +46,7 @@ public function test_exposes_default_fstab_parameter(): void
'fstabs' => ['primary' => ['filesystems' => ['memory' => []]]],
]);
- (new RegisterFstabLocatorPass())->process($container);
+ new RegisterFstabLocatorPass()->process($container);
static::assertSame('primary', $container->getParameter(RegisterFstabLocatorPass::DEFAULT_FSTAB_PARAMETER));
}
@@ -62,7 +62,7 @@ public function test_registers_locator_with_reference_per_fstab(): void
],
]);
- (new RegisterFstabLocatorPass())->process($container);
+ new RegisterFstabLocatorPass()->process($container);
$definition = $container->getDefinition(RegisterFstabLocatorPass::LOCATOR_SERVICE_ID);
static::assertSame(ServiceLocator::class, $definition->getClass());
diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/ResolveFilesystemArgumentsPassTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/ResolveFilesystemArgumentsPassTest.php
index 3485769a31..7e89dde922 100644
--- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/ResolveFilesystemArgumentsPassTest.php
+++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/ResolveFilesystemArgumentsPassTest.php
@@ -34,7 +34,7 @@ public function test_binds_argument_to_default_fstab_mount_when_fstab_omitted():
'fstab' => '',
]);
- (new ResolveFilesystemArgumentsPass())->process($container);
+ new ResolveFilesystemArgumentsPass()->process($container);
static::assertEquals(
new Reference('.flow.filesystem.fs.primary.memory'),
@@ -57,7 +57,7 @@ public function test_binds_argument_to_explicit_fstab_mount(): void
'fstab' => 'archive',
]);
- (new ResolveFilesystemArgumentsPass())->process($container);
+ new ResolveFilesystemArgumentsPass()->process($container);
static::assertEquals(
new Reference('.flow.filesystem.fs.archive.file'),
@@ -69,7 +69,7 @@ public function test_does_nothing_when_config_parameter_missing(): void
{
$container = new ContainerBuilder();
- (new ResolveFilesystemArgumentsPass())->process($container);
+ new ResolveFilesystemArgumentsPass()->process($container);
static::assertFalse($container->hasDefinition('app.consumer'));
}
@@ -91,7 +91,7 @@ public function test_throws_when_no_default_fstab_and_fstab_omitted(): void
$this->expectException(LogicException::class);
$this->expectExceptionMessage('Service "app.consumer" uses #[AsFilesystem(\'memory\')] without an fstab');
- (new ResolveFilesystemArgumentsPass())->process($container);
+ new ResolveFilesystemArgumentsPass()->process($container);
}
public function test_throws_on_unknown_fstab(): void
@@ -111,7 +111,7 @@ public function test_throws_on_unknown_fstab(): void
$this->expectException(LogicException::class);
$this->expectExceptionMessage('references fstab "nope" which is not configured. Available fstabs: [primary]');
- (new ResolveFilesystemArgumentsPass())->process($container);
+ new ResolveFilesystemArgumentsPass()->process($container);
}
public function test_throws_on_unknown_mount(): void
@@ -133,6 +133,6 @@ public function test_throws_on_unknown_mount(): void
'references mount "warehouse" which is not mounted in fstab "primary". Available mounts: [memory]',
);
- (new ResolveFilesystemArgumentsPass())->process($container);
+ new ResolveFilesystemArgumentsPass()->process($container);
}
}
diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/AsyncAwsS3FilesystemFactoryTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/AsyncAwsS3FilesystemFactoryTest.php
index 2db9093707..1e155365fb 100644
--- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/AsyncAwsS3FilesystemFactoryTest.php
+++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/AsyncAwsS3FilesystemFactoryTest.php
@@ -18,7 +18,7 @@ final class AsyncAwsS3FilesystemFactoryTest extends TestCase
{
public function test_applies_block_size_option(): void
{
- $filesystem = (new AsyncAwsS3FilesystemFactory())->create('aws-s3', [
+ $filesystem = new AsyncAwsS3FilesystemFactory()->create('aws-s3', [
'bucket' => 'b',
'client' => ['region' => 'us-east-1', 'access_key_id' => 'k', 'access_key_secret' => 's'],
'options' => ['block_size' => 6 * 1024 * 1024],
@@ -29,7 +29,7 @@ public function test_applies_block_size_option(): void
public function test_mode_a_builds_filesystem_from_resolved_client(): void
{
- $filesystem = (new AsyncAwsS3FilesystemFactory())->create('aws-s3', [
+ $filesystem = new AsyncAwsS3FilesystemFactory()->create('aws-s3', [
'bucket' => 'my-bucket',
'client' => new S3Client(['accessKeyId' => 'k', 'accessKeySecret' => 's', 'region' => 'us-east-1']),
]);
@@ -40,7 +40,7 @@ public function test_mode_a_builds_filesystem_from_resolved_client(): void
public function test_mode_b_accepts_resolved_http_client_and_logger(): void
{
- $filesystem = (new AsyncAwsS3FilesystemFactory())->create('aws-s3', [
+ $filesystem = new AsyncAwsS3FilesystemFactory()->create('aws-s3', [
'bucket' => 'b',
'client' => [
'region' => 'us-east-1',
@@ -56,7 +56,7 @@ public function test_mode_b_accepts_resolved_http_client_and_logger(): void
public function test_mode_b_builds_client_from_inline_config(): void
{
- $filesystem = (new AsyncAwsS3FilesystemFactory())->create('aws-s3', [
+ $filesystem = new AsyncAwsS3FilesystemFactory()->create('aws-s3', [
'bucket' => 'my-bucket',
'client' => [
'region' => 'eu-west-1',
@@ -70,7 +70,7 @@ public function test_mode_b_builds_client_from_inline_config(): void
public function test_mount_protocol_is_propagated_to_filesystem(): void
{
- $filesystem = (new AsyncAwsS3FilesystemFactory())->create('warehouse', [
+ $filesystem = new AsyncAwsS3FilesystemFactory()->create('warehouse', [
'bucket' => 'b',
'client' => ['region' => 'us-east-1', 'access_key_id' => 'k', 'access_key_secret' => 's'],
]);
@@ -83,7 +83,7 @@ public function test_throws_on_invalid_block_size_type(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`options.block_size` must be an integer');
- (new AsyncAwsS3FilesystemFactory())->create('aws-s3', [
+ new AsyncAwsS3FilesystemFactory()->create('aws-s3', [
'bucket' => 'b',
'client' => ['region' => 'us-east-1'],
'options' => ['block_size' => 'not-an-int'],
@@ -95,7 +95,7 @@ public function test_throws_on_missing_bucket(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('non-empty `bucket`');
- (new AsyncAwsS3FilesystemFactory())->create('aws-s3', ['client' => []]);
+ new AsyncAwsS3FilesystemFactory()->create('aws-s3', ['client' => []]);
}
public function test_throws_on_unknown_client_keys(): void
@@ -103,7 +103,7 @@ public function test_throws_on_unknown_client_keys(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`client` contains unknown keys: [nope]');
- (new AsyncAwsS3FilesystemFactory())->create('aws-s3', [
+ new AsyncAwsS3FilesystemFactory()->create('aws-s3', [
'bucket' => 'b',
'client' => ['nope' => 'x'],
]);
@@ -114,7 +114,7 @@ public function test_throws_on_unknown_options_keys(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`options` contains unknown keys: [nope]');
- (new AsyncAwsS3FilesystemFactory())->create('aws-s3', [
+ new AsyncAwsS3FilesystemFactory()->create('aws-s3', [
'bucket' => 'b',
'client' => ['region' => 'us-east-1'],
'options' => ['nope' => 1],
@@ -126,7 +126,7 @@ public function test_throws_on_unknown_top_level_keys(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('received unknown keys: [container]');
- (new AsyncAwsS3FilesystemFactory())->create('aws-s3', [
+ new AsyncAwsS3FilesystemFactory()->create('aws-s3', [
'bucket' => 'b',
'client' => ['region' => 'us-east-1'],
'container' => 'nope',
@@ -138,7 +138,7 @@ public function test_throws_when_client_is_invalid_type(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`client` must be an array or AsyncAws\\S3\\S3Client instance');
- (new AsyncAwsS3FilesystemFactory())->create('aws-s3', [
+ new AsyncAwsS3FilesystemFactory()->create('aws-s3', [
'bucket' => 'b',
'client' => new stdClass(),
]);
@@ -149,7 +149,7 @@ public function test_throws_when_http_client_is_wrong_type(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`client.http_client_service_id` must reference a service implementing');
- (new AsyncAwsS3FilesystemFactory())->create('aws-s3', [
+ new AsyncAwsS3FilesystemFactory()->create('aws-s3', [
'bucket' => 'b',
'client' => [
'region' => 'us-east-1',
@@ -163,7 +163,7 @@ public function test_throws_when_logger_is_wrong_type(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`client.logger_service_id` must reference a service implementing');
- (new AsyncAwsS3FilesystemFactory())->create('aws-s3', [
+ new AsyncAwsS3FilesystemFactory()->create('aws-s3', [
'bucket' => 'b',
'client' => [
'region' => 'us-east-1',
@@ -177,7 +177,7 @@ public function test_throws_when_no_client_supplied(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('exactly one of');
- (new AsyncAwsS3FilesystemFactory())->create('aws-s3', ['bucket' => 'b']);
+ new AsyncAwsS3FilesystemFactory()->create('aws-s3', ['bucket' => 'b']);
}
public function test_throws_when_options_is_not_array(): void
@@ -185,7 +185,7 @@ public function test_throws_when_options_is_not_array(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`options` must be an array');
- (new AsyncAwsS3FilesystemFactory())->create('aws-s3', [
+ new AsyncAwsS3FilesystemFactory()->create('aws-s3', [
'bucket' => 'b',
'client' => ['region' => 'us-east-1'],
'options' => 'not-an-array',
@@ -194,12 +194,12 @@ public function test_throws_when_options_is_not_array(): void
public function test_type_returns_aws_s3(): void
{
- static::assertSame('aws_s3', (new AsyncAwsS3FilesystemFactory())->type());
+ static::assertSame('aws_s3', new AsyncAwsS3FilesystemFactory()->type());
}
public function test_an_inline_client_configuration_builds_a_describable_filesystem(): void
{
- $filesystem = (new AsyncAwsS3FilesystemFactory())->create('aws-s3', [
+ $filesystem = new AsyncAwsS3FilesystemFactory()->create('aws-s3', [
'bucket' => 'b',
'client' => ['region' => 'us-east-1', 'access_key_id' => 'k', 'access_key_secret' => 's'],
]);
@@ -216,7 +216,7 @@ public function test_an_inline_client_configuration_builds_a_describable_filesys
public function test_an_injected_client_builds_a_filesystem_without_configuration(): void
{
static::assertNull(
- (new AsyncAwsS3FilesystemFactory())
+ new AsyncAwsS3FilesystemFactory()
->create('aws-s3', [
'bucket' => 'b',
'client' => new S3Client(['region' => 'us-east-1', 'accessKeyId' => 'k', 'accessKeySecret' => 's']),
@@ -228,7 +228,7 @@ public function test_an_injected_client_builds_a_filesystem_without_configuratio
public function test_an_injected_http_client_builds_a_filesystem_without_configuration(): void
{
static::assertNull(
- (new AsyncAwsS3FilesystemFactory())
+ new AsyncAwsS3FilesystemFactory()
->create('aws-s3', [
'bucket' => 'b',
'client' => [
@@ -244,7 +244,7 @@ public function test_an_injected_http_client_builds_a_filesystem_without_configu
public function test_client_http_keeps_the_filesystem_describable(): void
{
- $configuration = (new AsyncAwsS3FilesystemFactory())
+ $configuration = new AsyncAwsS3FilesystemFactory()
->create('aws-s3', [
'bucket' => 'b',
'client' => [
@@ -268,7 +268,7 @@ public function test_client_http_with_an_injected_http_client_is_rejected(): voi
'Filesystem factory for backend "aws_s3": client.http cannot be used together with client.http_client_service_id or client.logger_service_id, because the limits apply only to the client the bundle builds.',
);
- (new AsyncAwsS3FilesystemFactory())->create('aws-s3', [
+ new AsyncAwsS3FilesystemFactory()->create('aws-s3', [
'bucket' => 'b',
'client' => ['region' => 'us-east-1', 'http' => ['timeout' => 1], 'http_client' => HttpClient::create()],
]);
@@ -281,7 +281,7 @@ public function test_client_http_with_an_injected_logger_is_rejected(): void
'Filesystem factory for backend "aws_s3": client.http cannot be used together with client.http_client_service_id or client.logger_service_id, because the limits apply only to the client the bundle builds.',
);
- (new AsyncAwsS3FilesystemFactory())->create('aws-s3', [
+ new AsyncAwsS3FilesystemFactory()->create('aws-s3', [
'bucket' => 'b',
'client' => ['region' => 'us-east-1', 'http' => ['timeout' => 1], 'logger' => new NullLogger()],
]);
@@ -292,7 +292,7 @@ public function test_client_http_must_be_an_array(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Filesystem factory for backend "aws_s3" `client.http` must be an array.');
- (new AsyncAwsS3FilesystemFactory())->create('aws-s3', [
+ new AsyncAwsS3FilesystemFactory()->create('aws-s3', [
'bucket' => 'b',
'client' => ['region' => 'us-east-1', 'http' => 30],
]);
@@ -300,7 +300,7 @@ public function test_client_http_must_be_an_array(): void
public function test_options_bulk_delete(): void
{
- $configuration = (new AsyncAwsS3FilesystemFactory())
+ $configuration = new AsyncAwsS3FilesystemFactory()
->create('aws-s3', [
'bucket' => 'b',
'client' => ['region' => 'us-east-1'],
@@ -317,7 +317,7 @@ public function test_options_bulk_delete_must_be_a_boolean(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`options.bulk_delete` must be a boolean.');
- (new AsyncAwsS3FilesystemFactory())->create('aws-s3', [
+ new AsyncAwsS3FilesystemFactory()->create('aws-s3', [
'bucket' => 'b',
'client' => ['region' => 'us-east-1'],
'options' => ['bulk_delete' => 'false'],
@@ -326,7 +326,7 @@ public function test_options_bulk_delete_must_be_a_boolean(): void
public function test_options_copy_part_size(): void
{
- $configuration = (new AsyncAwsS3FilesystemFactory())
+ $configuration = new AsyncAwsS3FilesystemFactory()
->create('aws-s3', [
'bucket' => 'b',
'client' => ['region' => 'us-east-1'],
@@ -343,7 +343,7 @@ public function test_options_copy_part_size_above_5_gb_is_rejected(): void
$this->expectException(FilesystemInvalidArgumentException::class);
$this->expectExceptionMessage('Copy part size must be between 5 MiB and 5 GB, got 5000000001 bytes');
- (new AsyncAwsS3FilesystemFactory())->create('aws-s3', [
+ new AsyncAwsS3FilesystemFactory()->create('aws-s3', [
'bucket' => 'b',
'client' => ['region' => 'us-east-1'],
'options' => ['copy_part_size' => 5_000_000_001],
@@ -355,7 +355,7 @@ public function test_options_copy_part_size_must_be_an_integer(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`options.copy_part_size` must be an integer.');
- (new AsyncAwsS3FilesystemFactory())->create('aws-s3', [
+ new AsyncAwsS3FilesystemFactory()->create('aws-s3', [
'bucket' => 'b',
'client' => ['region' => 'us-east-1'],
'options' => ['copy_part_size' => '5242880'],
diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/AzureBlobFilesystemFactoryTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/AzureBlobFilesystemFactoryTest.php
index 1ec0c31eb4..ed0b5aafa2 100644
--- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/AzureBlobFilesystemFactoryTest.php
+++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/AzureBlobFilesystemFactoryTest.php
@@ -22,7 +22,7 @@ final class AzureBlobFilesystemFactoryTest extends TestCase
{
public function test_applies_block_size_option(): void
{
- $filesystem = (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ $filesystem = new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'c',
'client' => ['account_name' => 'a', 'auth' => ['shared_key' => base64_encode('k')]],
'options' => ['block_size' => 8 * 1024 * 1024, 'list_blob_max_results' => 100],
@@ -33,7 +33,7 @@ public function test_applies_block_size_option(): void
public function test_applies_copy_part_size_option(): void
{
- $filesystem = (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ $filesystem = new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'c',
'client' => ['account_name' => 'a', 'auth' => ['shared_key' => base64_encode('k')]],
'options' => ['copy_part_size' => 5 * 1024 * 1024],
@@ -45,7 +45,7 @@ public function test_applies_copy_part_size_option(): void
public function test_applies_bulk_delete_option(): void
{
- $filesystem = (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ $filesystem = new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'c',
'client' => ['account_name' => 'a', 'auth' => ['shared_key' => base64_encode('k')]],
'options' => ['bulk_delete' => false],
@@ -59,7 +59,7 @@ public function test_throws_on_invalid_bulk_delete_type(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`options.bulk_delete` must be a boolean.');
- (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'c',
'client' => ['account_name' => 'a', 'auth' => ['shared_key' => 'k']],
'options' => ['bulk_delete' => 'false'],
@@ -71,7 +71,7 @@ public function test_throws_on_invalid_copy_part_size_type(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`options.copy_part_size` must be an integer.');
- (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'c',
'client' => ['account_name' => 'a', 'auth' => ['shared_key' => 'k']],
'options' => ['copy_part_size' => 'nope'],
@@ -80,7 +80,7 @@ public function test_throws_on_invalid_copy_part_size_type(): void
public function test_mode_a_builds_filesystem_from_resolved_client(): void
{
- $filesystem = (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ $filesystem = new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'my-container',
'client' => self::createStub(BlobServiceInterface::class),
]);
@@ -91,7 +91,7 @@ public function test_mode_a_builds_filesystem_from_resolved_client(): void
public function test_mode_b_accepts_resolved_http_and_factories(): void
{
- $filesystem = (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ $filesystem = new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'c',
'client' => [
'account_name' => 'a',
@@ -108,7 +108,7 @@ public function test_mode_b_accepts_resolved_http_and_factories(): void
public function test_mode_b_builds_blob_service_from_inline_shared_key(): void
{
- $filesystem = (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ $filesystem = new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'my-container',
'client' => [
'account_name' => 'myaccount',
@@ -121,7 +121,7 @@ public function test_mode_b_builds_blob_service_from_inline_shared_key(): void
public function test_mode_b_uses_azurite_url_factory_when_host_set(): void
{
- $filesystem = (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ $filesystem = new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'my-container',
'client' => [
'account_name' => 'devstoreaccount1',
@@ -138,7 +138,7 @@ public function test_throws_on_invalid_block_size_type(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('block_size');
- (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'c',
'client' => ['account_name' => 'a', 'auth' => ['shared_key' => 'k']],
'options' => ['block_size' => 'nope'],
@@ -150,7 +150,7 @@ public function test_throws_on_invalid_list_blob_max_results_type(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('list_blob_max_results');
- (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'c',
'client' => ['account_name' => 'a', 'auth' => ['shared_key' => 'k']],
'options' => ['list_blob_max_results' => 'nope'],
@@ -162,7 +162,7 @@ public function test_throws_on_missing_container(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('non-empty `container`');
- (new AzureBlobFilesystemFactory())->create('azure-blob', ['client' => []]);
+ new AzureBlobFilesystemFactory()->create('azure-blob', ['client' => []]);
}
public function test_throws_on_unknown_auth_keys(): void
@@ -170,7 +170,7 @@ public function test_throws_on_unknown_auth_keys(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`client.auth` contains unknown keys: [sas_token]');
- (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'c',
'client' => ['account_name' => 'a', 'auth' => ['shared_key' => base64_encode('k'), 'sas_token' => 'x']],
]);
@@ -181,7 +181,7 @@ public function test_throws_on_unknown_client_keys(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`client` contains unknown keys: [nope]');
- (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'c',
'client' => ['account_name' => 'a', 'auth' => ['shared_key' => base64_encode('k')], 'nope' => 1],
]);
@@ -192,7 +192,7 @@ public function test_throws_on_unknown_options_keys(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`options` contains unknown keys: [nope]');
- (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'c',
'client' => ['account_name' => 'a', 'auth' => ['shared_key' => base64_encode('k')]],
'options' => ['nope' => 1],
@@ -204,7 +204,7 @@ public function test_throws_on_unknown_top_level_keys(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('received unknown keys: [bucket]');
- (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'c',
'client' => ['account_name' => 'a', 'auth' => ['shared_key' => base64_encode('k')]],
'bucket' => 'no',
@@ -216,7 +216,7 @@ public function test_throws_when_client_is_invalid_type(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`client` must be an array or Flow\\Azure\\SDK\\BlobServiceInterface instance');
- (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'c',
'client' => new stdClass(),
]);
@@ -227,7 +227,7 @@ public function test_throws_when_http_client_is_wrong_type(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`client.http_client_service` must reference a service implementing');
- (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'c',
'client' => [
'account_name' => 'a',
@@ -242,7 +242,7 @@ public function test_throws_when_mode_b_missing_account_name(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`client.account_name`');
- (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'c',
'client' => ['auth' => ['shared_key' => 'k']],
]);
@@ -253,7 +253,7 @@ public function test_throws_when_mode_b_missing_shared_key(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`client.auth.shared_key`');
- (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'c',
'client' => ['account_name' => 'a'],
]);
@@ -264,7 +264,7 @@ public function test_throws_when_no_client_supplied(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('exactly one of');
- (new AzureBlobFilesystemFactory())->create('azure-blob', ['container' => 'c']);
+ new AzureBlobFilesystemFactory()->create('azure-blob', ['container' => 'c']);
}
public function test_throws_when_options_is_not_array(): void
@@ -272,7 +272,7 @@ public function test_throws_when_options_is_not_array(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('`options` must be an array');
- (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'c',
'client' => ['account_name' => 'a', 'auth' => ['shared_key' => 'k']],
'options' => 'nope',
@@ -281,12 +281,12 @@ public function test_throws_when_options_is_not_array(): void
public function test_type_returns_azure_blob(): void
{
- static::assertSame('azure_blob', (new AzureBlobFilesystemFactory())->type());
+ static::assertSame('azure_blob', new AzureBlobFilesystemFactory()->type());
}
public function test_an_inline_client_configuration_builds_a_describable_filesystem(): void
{
- $filesystem = (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ $filesystem = new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'c',
'client' => [
'account_name' => 'a',
@@ -313,7 +313,7 @@ public function test_an_inline_client_configuration_builds_a_describable_filesys
public function test_an_injected_service_builds_a_filesystem_without_configuration(): void
{
static::assertNull(
- (new AzureBlobFilesystemFactory())
+ new AzureBlobFilesystemFactory()
->create('azure-blob', [
'container' => 'c',
'client' => self::createStub(BlobServiceInterface::class),
@@ -325,7 +325,7 @@ public function test_an_injected_service_builds_a_filesystem_without_configurati
public function test_an_injected_logger_builds_a_filesystem_without_configuration(): void
{
static::assertNull(
- (new AzureBlobFilesystemFactory())
+ new AzureBlobFilesystemFactory()
->create('azure-blob', [
'container' => 'c',
'client' => [
@@ -348,7 +348,7 @@ public static function injected_services(): Generator
public function test_client_http_keeps_the_filesystem_describable(): void
{
- $configuration = (new AzureBlobFilesystemFactory())
+ $configuration = new AzureBlobFilesystemFactory()
->create('azure-blob', [
'container' => 'c',
'client' => [
@@ -371,7 +371,7 @@ public function test_client_http_must_be_an_array(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Filesystem factory for backend "azure_blob" `client.http` must be an array.');
- (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'c',
'client' => ['account_name' => 'a', 'auth' => ['shared_key' => base64_encode('k')], 'http' => 30],
]);
@@ -385,7 +385,7 @@ public function test_client_http_with_an_injected_service_is_rejected(string $se
'Filesystem factory for backend "azure_blob": client.http cannot be used together with client.http_client_service, client.request_factory_service, client.stream_factory_service or client.logger_service_id, because the limits apply only to the client the bundle builds.',
);
- (new AzureBlobFilesystemFactory())->create('azure-blob', [
+ new AzureBlobFilesystemFactory()->create('azure-blob', [
'container' => 'c',
'client' => [
'account_name' => 'a',
diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/MemoryFilesystemFactoryTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/MemoryFilesystemFactoryTest.php
index 7d82f0b70e..9fbde5ba6c 100644
--- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/MemoryFilesystemFactoryTest.php
+++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/MemoryFilesystemFactoryTest.php
@@ -12,7 +12,7 @@ final class MemoryFilesystemFactoryTest extends TestCase
{
public function test_creates_filesystem_with_given_mount_protocol(): void
{
- static::assertSame('memory', (new MemoryFilesystemFactory())->create('memory', [])->mount()->protocol);
+ static::assertSame('memory', new MemoryFilesystemFactory()->create('memory', [])->mount()->protocol);
}
public function test_throws_on_unknown_options(): void
@@ -22,11 +22,11 @@ public function test_throws_on_unknown_options(): void
'Filesystem factory for type "memory" does not accept any options. Unknown keys: [foo, bar].',
);
- (new MemoryFilesystemFactory())->create('memory', ['foo' => 1, 'bar' => 2]);
+ new MemoryFilesystemFactory()->create('memory', ['foo' => 1, 'bar' => 2]);
}
public function test_type_returns_memory(): void
{
- static::assertSame('memory', (new MemoryFilesystemFactory())->type());
+ static::assertSame('memory', new MemoryFilesystemFactory()->type());
}
}
diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/NativeLocalFilesystemFactoryTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/NativeLocalFilesystemFactoryTest.php
index 40c19ad6e1..fdf16ccb48 100644
--- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/NativeLocalFilesystemFactoryTest.php
+++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/NativeLocalFilesystemFactoryTest.php
@@ -12,14 +12,14 @@ final class NativeLocalFilesystemFactoryTest extends TestCase
{
public function test_creates_filesystem_with_given_mount_protocol(): void
{
- static::assertSame('file', (new NativeLocalFilesystemFactory())->create('file', [])->mount()->protocol);
+ static::assertSame('file', new NativeLocalFilesystemFactory()->create('file', [])->mount()->protocol);
}
public function test_creates_filesystem_with_non_canonical_mount_protocol(): void
{
static::assertSame(
'project-root',
- (new NativeLocalFilesystemFactory())->create('project-root', [])->mount()->protocol,
+ new NativeLocalFilesystemFactory()->create('project-root', [])->mount()->protocol,
);
}
@@ -30,11 +30,11 @@ public function test_throws_on_unknown_options(): void
'Filesystem factory for type "file" does not accept any options. Unknown keys: [foo, bar].',
);
- (new NativeLocalFilesystemFactory())->create('file', ['foo' => 1, 'bar' => 2]);
+ new NativeLocalFilesystemFactory()->create('file', ['foo' => 1, 'bar' => 2]);
}
public function test_type_returns_file(): void
{
- static::assertSame('file', (new NativeLocalFilesystemFactory())->type());
+ static::assertSame('file', new NativeLocalFilesystemFactory()->type());
}
}
diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/StdoutFilesystemFactoryTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/StdoutFilesystemFactoryTest.php
index 3ab66fa416..6a212e556c 100644
--- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/StdoutFilesystemFactoryTest.php
+++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/StdoutFilesystemFactoryTest.php
@@ -12,7 +12,7 @@ final class StdoutFilesystemFactoryTest extends TestCase
{
public function test_creates_filesystem_with_given_mount_protocol(): void
{
- static::assertSame('stdout', (new StdoutFilesystemFactory())->create('stdout', [])->mount()->protocol);
+ static::assertSame('stdout', new StdoutFilesystemFactory()->create('stdout', [])->mount()->protocol);
}
public function test_throws_on_unknown_options(): void
@@ -22,11 +22,11 @@ public function test_throws_on_unknown_options(): void
'Filesystem factory for type "stdout" does not accept any options. Unknown keys: [foo, bar].',
);
- (new StdoutFilesystemFactory())->create('stdout', ['foo' => 1, 'bar' => 2]);
+ new StdoutFilesystemFactory()->create('stdout', ['foo' => 1, 'bar' => 2]);
}
public function test_type_returns_stdout(): void
{
- static::assertSame('stdout', (new StdoutFilesystemFactory())->type());
+ static::assertSame('stdout', new StdoutFilesystemFactory()->type());
}
}
diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/FilesystemFactoryRegistryTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/FilesystemFactoryRegistryTest.php
index 979f072137..c590905cbd 100644
--- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/FilesystemFactoryRegistryTest.php
+++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/FilesystemFactoryRegistryTest.php
@@ -41,7 +41,7 @@ public function test_create_passes_entry_options_without_type_to_factory(): void
$filesystem = native_local_filesystem('my-fs');
$capturing = new CapturingFilesystemFactory('file', $filesystem);
- $created = (new FilesystemFactoryRegistry([$capturing]))->create('default', 'my-fs', [
+ $created = new FilesystemFactoryRegistry([$capturing])->create('default', 'my-fs', [
'type' => 'file',
'foo' => 'bar',
]);
@@ -57,7 +57,7 @@ public function test_create_throws_when_factory_missing_for_type(): void
'Fstab "primary" mount "memory": No filesystem factory registered for type "memory". Available types: [].',
);
- (new FilesystemFactoryRegistry([]))->create('primary', 'memory', ['type' => 'memory']);
+ new FilesystemFactoryRegistry([])->create('primary', 'memory', ['type' => 'memory']);
}
public function test_create_wraps_factory_error_with_fstab_and_mount(): void
@@ -67,7 +67,7 @@ public function test_create_wraps_factory_error_with_fstab_and_mount(): void
'Fstab "primary" mount "memory": Filesystem factory for type "memory" does not accept any options. Unknown keys: [foo].',
);
- (new FilesystemFactoryRegistry([new MemoryFilesystemFactory()]))->create('primary', 'memory', [
+ new FilesystemFactoryRegistry([new MemoryFilesystemFactory()])->create('primary', 'memory', [
'type' => 'memory',
'foo' => 'bar',
]);
@@ -85,12 +85,12 @@ public function test_get_throws_on_unknown_type(): void
public function test_has_returns_false_for_unknown_type(): void
{
- static::assertFalse((new FilesystemFactoryRegistry([new StubFilesystemFactory('memory')]))->has('file'));
+ static::assertFalse(new FilesystemFactoryRegistry([new StubFilesystemFactory('memory')])->has('file'));
}
public function test_has_returns_true_for_registered_type(): void
{
- static::assertTrue((new FilesystemFactoryRegistry([new StubFilesystemFactory('memory')]))->has('memory'));
+ static::assertTrue(new FilesystemFactoryRegistry([new StubFilesystemFactory('memory')])->has('memory'));
}
public function test_returns_factory_by_type(): void
diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/FlowFilesystemBundleTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/FlowFilesystemBundleTest.php
index df3efb13dd..eb55d87a31 100644
--- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/FlowFilesystemBundleTest.php
+++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/FlowFilesystemBundleTest.php
@@ -17,7 +17,7 @@ final class FlowFilesystemBundleTest extends TestCase
public function test_build_registers_as_filesystem_factory_attribute_for_autoconfiguration(): void
{
$container = new ContainerBuilder();
- (new FlowFilesystemBundle())->build($container);
+ new FlowFilesystemBundle()->build($container);
$container
->register(AutoconfiguredStubFilesystemFactory::class, AutoconfiguredStubFilesystemFactory::class)
->setAutoconfigured(true)
@@ -35,7 +35,7 @@ public function test_build_registers_as_filesystem_factory_attribute_for_autocon
public function test_bundle_alias_resolves_to_flow_filesystem(): void
{
- $extension = (new FlowFilesystemBundle())->getContainerExtension();
+ $extension = new FlowFilesystemBundle()->getContainerExtension();
static::assertNotNull($extension);
static::assertSame('flow_filesystem', $extension->getAlias());
diff --git a/src/bridge/symfony/filesystem-cache/composer.json b/src/bridge/symfony/filesystem-cache/composer.json
index c04389031c..1ea24aa2b7 100644
--- a/src/bridge/symfony/filesystem-cache/composer.json
+++ b/src/bridge/symfony/filesystem-cache/composer.json
@@ -9,13 +9,13 @@
"bridge"
],
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/filesystem": "self.version",
"psr/clock": "^1.0",
- "symfony/cache": "^6.4 || ^7.4 || ^8.0"
+ "symfony/cache": "^7.4 || ^8.0"
},
"require-dev": {
- "symfony/clock": "^6.4 || ^7.4 || ^8.0"
+ "symfony/clock": "^7.4 || ^8.0"
},
"config": {
"optimize-autoloader": true,
diff --git a/src/bridge/symfony/http-foundation-telemetry/composer.json b/src/bridge/symfony/http-foundation-telemetry/composer.json
index cc8eb2157e..6cc9e64b40 100644
--- a/src/bridge/symfony/http-foundation-telemetry/composer.json
+++ b/src/bridge/symfony/http-foundation-telemetry/composer.json
@@ -12,9 +12,9 @@
"homepage": "https://github.com/flow-php/flow",
"license": "MIT",
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/telemetry": "self.version",
- "symfony/http-foundation": "^6.4 || ^7.4 || ^8.0"
+ "symfony/http-foundation": "^7.4 || ^8.0"
},
"autoload": {
"psr-4": {
diff --git a/src/bridge/symfony/http-foundation-telemetry/tests/Flow/Bridge/Symfony/HttpFoundationTelemetry/Tests/Unit/ResponseCarrierTest.php b/src/bridge/symfony/http-foundation-telemetry/tests/Flow/Bridge/Symfony/HttpFoundationTelemetry/Tests/Unit/ResponseCarrierTest.php
index f8b6d272e1..167d368d60 100644
--- a/src/bridge/symfony/http-foundation-telemetry/tests/Flow/Bridge/Symfony/HttpFoundationTelemetry/Tests/Unit/ResponseCarrierTest.php
+++ b/src/bridge/symfony/http-foundation-telemetry/tests/Flow/Bridge/Symfony/HttpFoundationTelemetry/Tests/Unit/ResponseCarrierTest.php
@@ -16,7 +16,7 @@ public function test_fluent_chaining(): void
{
$response = new Response();
- $modifiedResponse = (new ResponseCarrier($response))
+ $modifiedResponse = new ResponseCarrier($response)
->set('X-Header-1', 'value1')
->set('X-Header-2', 'value2')
->unwrap();
diff --git a/src/bridge/symfony/http-foundation/composer.json b/src/bridge/symfony/http-foundation/composer.json
index 8a75e79938..cd9de861c3 100644
--- a/src/bridge/symfony/http-foundation/composer.json
+++ b/src/bridge/symfony/http-foundation/composer.json
@@ -11,8 +11,8 @@
"response"
],
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
- "symfony/http-foundation": "^6.4 || ^7.4 || ^8.0",
+ "php": "~8.5.0 || ~8.6.0",
+ "symfony/http-foundation": "^7.4 || ^8.0",
"flow-php/etl": "self.version",
"flow-php/filesystem": "self.version"
},
diff --git a/src/bridge/symfony/http-foundation/src/Flow/Bridge/Symfony/HttpFoundation/Response/FlowBufferedResponse.php b/src/bridge/symfony/http-foundation/src/Flow/Bridge/Symfony/HttpFoundation/Response/FlowBufferedResponse.php
index e4fd543373..5a6acd25e1 100644
--- a/src/bridge/symfony/http-foundation/src/Flow/Bridge/Symfony/HttpFoundation/Response/FlowBufferedResponse.php
+++ b/src/bridge/symfony/http-foundation/src/Flow/Bridge/Symfony/HttpFoundation/Response/FlowBufferedResponse.php
@@ -46,7 +46,7 @@ public function __construct(
throw new InvalidArgumentException('A DataFrame source carries its own config');
}
- $this->config = $config ?? (new ConfigBuilder())->build();
+ $this->config = $config ?? new ConfigBuilder()->build();
parent::__construct(null, $status, $headers);
}
diff --git a/src/bridge/symfony/http-foundation/src/Flow/Bridge/Symfony/HttpFoundation/Response/FlowStreamedResponse.php b/src/bridge/symfony/http-foundation/src/Flow/Bridge/Symfony/HttpFoundation/Response/FlowStreamedResponse.php
index 635b9c6fc7..3148752e50 100644
--- a/src/bridge/symfony/http-foundation/src/Flow/Bridge/Symfony/HttpFoundation/Response/FlowStreamedResponse.php
+++ b/src/bridge/symfony/http-foundation/src/Flow/Bridge/Symfony/HttpFoundation/Response/FlowStreamedResponse.php
@@ -45,7 +45,7 @@ public function __construct(
throw new InvalidArgumentException('A DataFrame source carries its own config');
}
- $this->config = $config ?? (new ConfigBuilder())->build();
+ $this->config = $config ?? new ConfigBuilder()->build();
parent::__construct($this->stream(...), $status, $headers);
diff --git a/src/bridge/symfony/postgresql-bundle/composer.json b/src/bridge/symfony/postgresql-bundle/composer.json
index 389de34f38..228b64eb64 100644
--- a/src/bridge/symfony/postgresql-bundle/composer.json
+++ b/src/bridge/symfony/postgresql-bundle/composer.json
@@ -11,13 +11,13 @@
"homepage": "https://github.com/flow-php/flow",
"license": "MIT",
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/filesystem": "self.version",
"flow-php/postgresql": "self.version",
- "symfony/config": "^6.4 || ^7.4 || ^8.0",
- "symfony/console": "^6.4.34 || ^7.4.6 || ^8.0.6",
- "symfony/dependency-injection": "^6.4 || ^7.4 || ^8.0",
- "symfony/http-kernel": "^6.4 || ^7.4 || ^8.0",
+ "symfony/config": "^7.4 || ^8.0",
+ "symfony/console": "^7.4.6 || ^8.0.6",
+ "symfony/dependency-injection": "^7.4 || ^8.0",
+ "symfony/http-kernel": "^7.4 || ^8.0",
"twig/twig": "^3.0"
},
"require-dev": {
@@ -27,12 +27,12 @@
"flow-php/symfony-postgresql-cache-bridge": "self.version",
"flow-php/symfony-postgresql-messenger-bridge": "self.version",
"flow-php/symfony-postgresql-session-bridge": "self.version",
- "symfony/cache": "^6.4 || ^7.4 || ^8.0",
- "symfony/framework-bundle": "^6.4 || ^7.4 || ^8.0",
- "symfony/lock": "^6.4 || ^7.4 || ^8.0",
- "symfony/messenger": "^6.4 || ^7.4 || ^8.0",
- "symfony/var-dumper": "^6.4 || ^7.4 || ^8.0",
- "symfony/web-profiler-bundle": "^6.4 || ^7.4 || ^8.0"
+ "symfony/cache": "^7.4 || ^8.0",
+ "symfony/framework-bundle": "^7.4 || ^8.0",
+ "symfony/lock": "^7.4 || ^8.0",
+ "symfony/messenger": "^7.4 || ^8.0",
+ "symfony/var-dumper": "^7.4 || ^8.0",
+ "symfony/web-profiler-bundle": "^7.4 || ^8.0"
},
"suggest": {
"flow-php/phpunit-postgresql-bridge": "For PHPUnit PostgreSQL transaction rollback support in tests",
diff --git a/src/bridge/symfony/postgresql-bundle/src/Flow/Bridge/Symfony/PostgreSqlBundle/Command/FormatSqlCommand.php b/src/bridge/symfony/postgresql-bundle/src/Flow/Bridge/Symfony/PostgreSqlBundle/Command/FormatSqlCommand.php
index 98396bcd66..d416cad883 100644
--- a/src/bridge/symfony/postgresql-bundle/src/Flow/Bridge/Symfony/PostgreSqlBundle/Command/FormatSqlCommand.php
+++ b/src/bridge/symfony/postgresql-bundle/src/Flow/Bridge/Symfony/PostgreSqlBundle/Command/FormatSqlCommand.php
@@ -144,7 +144,7 @@ private function formatPath(
OutputInterface $output,
DeparseOptions $options,
): int {
- $files = (new SqlFileFinder(native_local_filesystem()))->find(path($pathString));
+ $files = new SqlFileFinder(native_local_filesystem())->find(path($pathString));
if ($files === []) {
$output->writeln(sprintf('No .sql files found at: %s', $pathString));
diff --git a/src/bridge/symfony/postgresql-bundle/src/Flow/Bridge/Symfony/PostgreSqlBundle/FlowPostgreSqlBundle.php b/src/bridge/symfony/postgresql-bundle/src/Flow/Bridge/Symfony/PostgreSqlBundle/FlowPostgreSqlBundle.php
index 84464941e1..42c77e48b4 100644
--- a/src/bridge/symfony/postgresql-bundle/src/Flow/Bridge/Symfony/PostgreSqlBundle/FlowPostgreSqlBundle.php
+++ b/src/bridge/symfony/postgresql-bundle/src/Flow/Bridge/Symfony/PostgreSqlBundle/FlowPostgreSqlBundle.php
@@ -99,6 +99,7 @@ final class FlowPostgreSqlBundle extends AbstractBundle
private const string WEB_PROFILER_BUNDLE = 'Symfony\\Bundle\\WebProfilerBundle\\WebProfilerBundle';
+ #[Override]
protected string $extensionAlias = 'flow_postgresql';
/**
diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Context/ConfigurationContext.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Context/ConfigurationContext.php
index 57b622b839..ed097f571b 100644
--- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Context/ConfigurationContext.php
+++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Context/ConfigurationContext.php
@@ -19,7 +19,7 @@
*/
public function processConfig(array $config): array
{
- $extension = (new FlowPostgreSqlBundle())->getContainerExtension();
+ $extension = new FlowPostgreSqlBundle()->getContainerExtension();
if (!$extension instanceof ConfigurationExtensionInterface) {
throw new LogicException('FlowPostgreSqlBundle extension does not expose a configuration tree.');
@@ -31,6 +31,6 @@ public function processConfig(array $config): array
throw new LogicException('FlowPostgreSqlBundle extension exposes no configuration tree.');
}
- return (new Processor())->processConfiguration($configuration, [$config]);
+ return new Processor()->processConfiguration($configuration, [$config]);
}
}
diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Context/ExtensionContext.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Context/ExtensionContext.php
index e5c2fa4765..b77d6b0d57 100644
--- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Context/ExtensionContext.php
+++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Context/ExtensionContext.php
@@ -17,7 +17,7 @@
*/
public function load(array $config, bool $debug = false, array $bundles = []): ContainerBuilder
{
- $extension = (new FlowPostgreSqlBundle())->getContainerExtension();
+ $extension = new FlowPostgreSqlBundle()->getContainerExtension();
if (!$extension instanceof ExtensionInterface) {
throw new LogicException('FlowPostgreSqlBundle extension is not loadable.');
diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Context/SymfonyContext.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Context/SymfonyContext.php
index bc893131b0..d1921656e7 100644
--- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Context/SymfonyContext.php
+++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Context/SymfonyContext.php
@@ -74,7 +74,7 @@ public function getService(string $serviceId, string $typeClass): object
*/
public function readPrivateProperty(object $service, string $propertyName): mixed
{
- return (new ReflectionProperty($service, $propertyName))->getValue($service);
+ return new ReflectionProperty($service, $propertyName)->getValue($service);
}
public function shutdown(): void
diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Double/TemporaryDirectory.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Double/TemporaryDirectory.php
index ff1a4311fc..0cbb035779 100644
--- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Double/TemporaryDirectory.php
+++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Double/TemporaryDirectory.php
@@ -23,6 +23,6 @@ public function __construct()
public function cleanUp(): void
{
- (new NativeLocalFilesystem())->rm(path_real($this->path));
+ new NativeLocalFilesystem()->rm(path_real($this->path));
}
}
diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Fixtures/TestKernel.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Fixtures/TestKernel.php
index 5b60021fe1..20421c4f49 100644
--- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Fixtures/TestKernel.php
+++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Fixtures/TestKernel.php
@@ -11,7 +11,7 @@
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
-use Symfony\Component\HttpKernel\Bundle\BundleInterface;
+use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\Kernel;
use function array_merge;
@@ -22,7 +22,7 @@
final class TestKernel extends Kernel
{
- /** @var array> */
+ /** @var array> */
private array $testBundles = [];
/** @var array */
@@ -44,7 +44,7 @@ public function __construct(string $environment = 'test', bool $debug = true)
}
/**
- * @param class-string $bundleClass
+ * @param class-string $bundleClass
*/
public function addTestBundle(string $bundleClass): void
{
diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/Command/CommandTestContext.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/Command/CommandTestContext.php
index 1c6e58248b..d6767f84a0 100644
--- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/Command/CommandTestContext.php
+++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/Command/CommandTestContext.php
@@ -48,7 +48,7 @@ public function __construct()
$this->migrationsDir = dirname(__DIR__, 8) . '/var/tests/flow_test_migrations_' . bin2hex(random_bytes(4));
mkdir($this->migrationsDir, 0755, true);
- $client = PgSqlClient::connect((new DsnParser())->parse($this->testDsn));
+ $client = PgSqlClient::connect(new DsnParser()->parse($this->testDsn));
$client->execute('DROP TABLE IF EXISTS test_users, flow_migrations_test CASCADE');
$client->close();
}
@@ -146,7 +146,7 @@ public function container(): ContainerInterface
public function createDatabase(string $name): void
{
$client = PgSqlClient::connect(
- (new DsnParser())
+ new DsnParser()
->parse($this->testDsn)
->withDatabase('postgres'),
);
@@ -157,7 +157,7 @@ public function createDatabase(string $name): void
public function databaseExists(string $name): bool
{
$client = PgSqlClient::connect(
- (new DsnParser())
+ new DsnParser()
->parse($this->testDsn)
->withDatabase('postgres'),
);
@@ -170,7 +170,7 @@ public function databaseExists(string $name): bool
public function dropDatabase(string $name): void
{
$client = PgSqlClient::connect(
- (new DsnParser())
+ new DsnParser()
->parse($this->testDsn)
->withDatabase('postgres'),
);
@@ -205,7 +205,7 @@ public function generateDiffMigration(): string
public function generateMigrationOlderThanAnyExecuted(): void
{
- (new CommandTester($this->command('flow.postgresql.command.generate')))->execute(['name' => 'older']);
+ new CommandTester($this->command('flow.postgresql.command.generate'))->execute(['name' => 'older']);
$this->filesystem->mv(
path((string) $this->migrationDirs('*_older')[0]),
@@ -215,7 +215,7 @@ public function generateMigrationOlderThanAnyExecuted(): void
public function isUpToDate(): bool
{
- return (new CommandTester($this->command('flow.postgresql.command.up_to_date')))->execute([])
+ return new CommandTester($this->command('flow.postgresql.command.up_to_date'))->execute([])
=== Command::SUCCESS;
}
@@ -244,7 +244,7 @@ public function shutdown(): void
{
$this->symfonyContext->shutdown();
- $client = PgSqlClient::connect((new DsnParser())->parse($this->testDsn));
+ $client = PgSqlClient::connect(new DsnParser()->parse($this->testDsn));
$client->execute('DROP TABLE IF EXISTS test_users, flow_migrations_test, flow_sql_test CASCADE');
$client->close();
@@ -253,7 +253,7 @@ public function shutdown(): void
public function tableExists(string $table, string $schema = 'public'): bool
{
- $client = PgSqlClient::connect((new DsnParser())->parse($this->testDsn));
+ $client = PgSqlClient::connect(new DsnParser()->parse($this->testDsn));
$result = $client->fetch('SELECT 1 FROM information_schema.tables WHERE table_schema = $1 AND table_name = $2', [
$schema,
$table,
@@ -270,7 +270,7 @@ public function tableExistsInDatabase(string $database, string $table, string $s
if (!is_string($targetDsn)) {
throw new LogicException('Failed to build target DSN.');
}
- $client = PgSqlClient::connect((new DsnParser())->parse($targetDsn));
+ $client = PgSqlClient::connect(new DsnParser()->parse($targetDsn));
$result = $client->fetch('SELECT 1 FROM information_schema.tables WHERE table_schema = $1 AND table_name = $2', [
$schema,
$table,
diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/FlowPostgreSqlExtensionTest.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/FlowPostgreSqlExtensionTest.php
index 948ded2a98..2a25c912a8 100644
--- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/FlowPostgreSqlExtensionTest.php
+++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/FlowPostgreSqlExtensionTest.php
@@ -1921,7 +1921,7 @@ public function test_migrations_configuration_receives_the_configured_lock(array
public function test_migrate_command_receives_the_configured_lock_timeout(): void
{
- $container = (new ExtensionContext())->load([
+ $container = new ExtensionContext()->load([
'connections' => [
'default' => ['dsn' => 'postgresql://postgres:postgres@localhost:5432/postgres'],
],
diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/MigrationExecutionContext.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/MigrationExecutionContext.php
index 88f8002b19..113495db16 100644
--- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/MigrationExecutionContext.php
+++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/MigrationExecutionContext.php
@@ -128,7 +128,7 @@ public function tableExists(string $table): bool
private function connect(): Client
{
- return PgSqlClient::connect((new DsnParser())->parse($this->dsn));
+ return PgSqlClient::connect(new DsnParser()->parse($this->dsn));
}
private function dropTestTables(): void
diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/Profiler/FlowMigrationsProfilerTest.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/Profiler/FlowMigrationsProfilerTest.php
index 0a01b22a9b..d78a558d1c 100644
--- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/Profiler/FlowMigrationsProfilerTest.php
+++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/Profiler/FlowMigrationsProfilerTest.php
@@ -43,7 +43,7 @@ final class FlowMigrationsProfilerTest extends KernelTestCase
#[Override]
protected function tearDown(): void
{
- $client = PgSqlClient::connect((new DsnParser())->parse($this->dsn()));
+ $client = PgSqlClient::connect(new DsnParser()->parse($this->dsn()));
$client->execute('DROP TABLE IF EXISTS users, ' . self::STORE_TABLE . ' CASCADE');
$client->close();
diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/CatalogProvider/ArrayCatalogProviderTest.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/CatalogProvider/ArrayCatalogProviderTest.php
index befb4ff82b..70b3462197 100644
--- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/CatalogProvider/ArrayCatalogProviderTest.php
+++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/CatalogProvider/ArrayCatalogProviderTest.php
@@ -109,7 +109,7 @@ public function test_restores_catalog_extensions(): void
static::assertEquals(
$catalog->extensions(),
- (new ArrayCatalogProvider($catalog->normalize()))->get()->extensions(),
+ new ArrayCatalogProvider($catalog->normalize())->get()->extensions(),
);
}
}
diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Lock/SymfonyMigrationLockTest.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Lock/SymfonyMigrationLockTest.php
index 3618efe4b0..04773b79e1 100644
--- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Lock/SymfonyMigrationLockTest.php
+++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Lock/SymfonyMigrationLockTest.php
@@ -42,7 +42,7 @@ public function test_release_without_acquire_throws(): void
{
$this->expectExceptionObject(MigrationException::lockExpired('public.flow_migrations'));
- (new SymfonyMigrationLock(new LockFactory(new InMemoryStore())))->release('public.flow_migrations');
+ new SymfonyMigrationLock(new LockFactory(new InMemoryStore()))->release('public.flow_migrations');
}
public function test_second_lock_on_the_same_store_acquires_after_release(): void
diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Profiler/FlowMigrationsDataCollectorTest.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Profiler/FlowMigrationsDataCollectorTest.php
index b88edd13ee..8cecbd8abb 100644
--- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Profiler/FlowMigrationsDataCollectorTest.php
+++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Profiler/FlowMigrationsDataCollectorTest.php
@@ -46,7 +46,7 @@ public function test_get_name_is_flow_postgresql_migrations(): void
static::assertSame(
'flow_postgresql_migrations',
- (new FlowMigrationsDataCollector('default', $migrator, $configuration))->getName(),
+ new FlowMigrationsDataCollector('default', $migrator, $configuration)->getName(),
);
}
diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Profiler/ProfilerClientTest.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Profiler/ProfilerClientTest.php
index 5faf356fab..7478083144 100644
--- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Profiler/ProfilerClientTest.php
+++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Profiler/ProfilerClientTest.php
@@ -25,7 +25,7 @@ public function test_execute_records_statement_parameters_and_affected_rows(): v
$inner = new FakeClient();
$inner->executeReturn = 3;
- $affected = (new ProfilerClient($inner, $recorder))->execute('DELETE FROM users WHERE id = $1', [42]);
+ $affected = new ProfilerClient($inner, $recorder)->execute('DELETE FROM users WHERE id = $1', [42]);
static::assertSame(3, $affected);
static::assertCount(1, $recorder->queries());
@@ -48,7 +48,7 @@ public function test_execute_records_converted_parameters_as_their_values(): voi
$inner = new FakeClient();
$inner->executeReturn = 2;
- $affected = (new ProfilerClient($inner, $recorder))->execute(
+ $affected = new ProfilerClient($inner, $recorder)->execute(
'DELETE FROM users WHERE id = $1',
new ConvertedParameters(['42']),
);
@@ -64,7 +64,7 @@ public function test_records_the_configured_connection_name(): void
{
$recorder = new QueryRecorder();
- (new ProfilerClient(new FakeClient(), $recorder, 'analytics'))->execute('SELECT 1');
+ new ProfilerClient(new FakeClient(), $recorder, 'analytics')->execute('SELECT 1');
static::assertSame('analytics', $recorder->queries()[0]->connection);
}
@@ -146,7 +146,7 @@ public function test_fetch_records_one_row_when_row_returned(): void
$inner = new FakeClient();
$inner->fetchReturn = ['id' => 1];
- $row = (new ProfilerClient($inner, $recorder))->fetch('SELECT * FROM users LIMIT 1');
+ $row = new ProfilerClient($inner, $recorder)->fetch('SELECT * FROM users LIMIT 1');
static::assertSame(['id' => 1], $row);
static::assertSame(1, $recorder->queries()[0]->rowCount);
@@ -158,7 +158,7 @@ public function test_fetch_records_zero_rows_when_null(): void
$inner = new FakeClient();
$inner->fetchReturn = null;
- (new ProfilerClient($inner, $recorder))->fetch('SELECT * FROM users WHERE 1 = 0');
+ new ProfilerClient($inner, $recorder)->fetch('SELECT * FROM users WHERE 1 = 0');
static::assertSame(0, $recorder->queries()[0]->rowCount);
}
@@ -169,7 +169,7 @@ public function test_fetch_all_records_returned_row_count(): void
$inner = new FakeClient();
$inner->fetchAllReturn = [['id' => 1], ['id' => 2], ['id' => 3]];
- $rows = (new ProfilerClient($inner, $recorder))->fetchAll('SELECT * FROM users');
+ $rows = new ProfilerClient($inner, $recorder)->fetchAll('SELECT * FROM users');
static::assertCount(3, $rows);
static::assertSame(3, $recorder->queries()[0]->rowCount);
@@ -181,7 +181,7 @@ public function test_fetch_scalar_int_records_query(): void
$inner = new FakeClient();
$inner->fetchScalarIntReturn = 7;
- $count = (new ProfilerClient($inner, $recorder))->fetchScalarInt('SELECT COUNT(*) FROM users');
+ $count = new ProfilerClient($inner, $recorder)->fetchScalarInt('SELECT COUNT(*) FROM users');
static::assertSame(7, $count);
static::assertSame('SELECT COUNT(*) FROM users', $recorder->queries()[0]->sql);
@@ -198,7 +198,7 @@ public function toSql(): string
}
};
- (new ProfilerClient(new FakeClient(), $recorder))->execute($sql);
+ new ProfilerClient(new FakeClient(), $recorder)->execute($sql);
static::assertSame('SELECT 1', $recorder->queries()[0]->sql);
}
@@ -231,7 +231,7 @@ public function test_cursor_records_statement_with_unknown_row_count_and_returns
$cursor = $this->createStub(Cursor::class);
$inner = new FakeClient($cursor);
- $returned = (new ProfilerClient($inner, $recorder))->cursor('SELECT * FROM big_table');
+ $returned = new ProfilerClient($inner, $recorder)->cursor('SELECT * FROM big_table');
static::assertSame($cursor, $returned);
static::assertCount(1, $recorder->queries());
diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Profiler/QueryRecorderOptionsTest.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Profiler/QueryRecorderOptionsTest.php
index f3fd43bdd3..b15e392dac 100644
--- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Profiler/QueryRecorderOptionsTest.php
+++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Profiler/QueryRecorderOptionsTest.php
@@ -68,12 +68,12 @@ public function test_rejects_negative_max_parameters(): void
public function test_allows_null_max_parameters_as_unlimited(): void
{
- static::assertNull((new QueryRecorderOptions(maxRetainedParameters: null))->maxRetainedParameters);
+ static::assertNull(new QueryRecorderOptions(maxRetainedParameters: null)->maxRetainedParameters);
}
public function test_retains_parameters_within_limit(): void
{
- static::assertTrue((new QueryRecorderOptions(maxRetainedParameters: 100))->retainsParameters(array_fill(
+ static::assertTrue(new QueryRecorderOptions(maxRetainedParameters: 100)->retainsParameters(array_fill(
0,
5,
'v',
@@ -82,7 +82,7 @@ public function test_retains_parameters_within_limit(): void
public function test_retains_parameters_at_exact_limit(): void
{
- static::assertTrue((new QueryRecorderOptions(maxRetainedParameters: 100))->retainsParameters(array_fill(
+ static::assertTrue(new QueryRecorderOptions(maxRetainedParameters: 100)->retainsParameters(array_fill(
0,
100,
'v',
@@ -91,7 +91,7 @@ public function test_retains_parameters_at_exact_limit(): void
public function test_does_not_retain_parameters_over_limit(): void
{
- static::assertFalse((new QueryRecorderOptions(maxRetainedParameters: 100))->retainsParameters(array_fill(
+ static::assertFalse(new QueryRecorderOptions(maxRetainedParameters: 100)->retainsParameters(array_fill(
0,
101,
'v',
@@ -100,7 +100,7 @@ public function test_does_not_retain_parameters_over_limit(): void
public function test_retains_everything_when_max_parameters_is_null(): void
{
- static::assertTrue((new QueryRecorderOptions(maxRetainedParameters: null))->retainsParameters(array_fill(
+ static::assertTrue(new QueryRecorderOptions(maxRetainedParameters: null)->retainsParameters(array_fill(
0,
17_000,
'v',
@@ -109,11 +109,11 @@ public function test_retains_everything_when_max_parameters_is_null(): void
public function test_does_not_retain_parameters_when_include_parameters_disabled(): void
{
- static::assertFalse((new QueryRecorderOptions(includeParameters: false))->retainsParameters([42]));
+ static::assertFalse(new QueryRecorderOptions(includeParameters: false)->retainsParameters([42]));
}
public function test_retains_empty_parameters_when_include_parameters_disabled(): void
{
- static::assertTrue((new QueryRecorderOptions(includeParameters: false))->retainsParameters([]));
+ static::assertTrue(new QueryRecorderOptions(includeParameters: false)->retainsParameters([]));
}
}
diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Profiler/QueryRecorderTest.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Profiler/QueryRecorderTest.php
index 048b63ca9b..8462a47a95 100644
--- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Profiler/QueryRecorderTest.php
+++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Profiler/QueryRecorderTest.php
@@ -20,7 +20,7 @@ final class QueryRecorderTest extends TestCase
{
public function test_starts_empty(): void
{
- static::assertSame([], (new QueryRecorder())->queries());
+ static::assertSame([], new QueryRecorder()->queries());
}
public function test_add_appends_in_order(): void
diff --git a/src/bridge/symfony/postgresql-cache/composer.json b/src/bridge/symfony/postgresql-cache/composer.json
index 07b73c440d..df07dbf24d 100644
--- a/src/bridge/symfony/postgresql-cache/composer.json
+++ b/src/bridge/symfony/postgresql-cache/composer.json
@@ -9,9 +9,9 @@
"bridge"
],
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/postgresql": "self.version",
- "symfony/cache": "^6.4 || ^7.4 || ^8.0"
+ "symfony/cache": "^7.4 || ^8.0"
},
"config": {
"optimize-autoloader": true,
diff --git a/src/bridge/symfony/postgresql-cache/tests/Flow/Bridge/Symfony/PostgreSQLCache/Tests/Unit/CacheCatalogProviderTest.php b/src/bridge/symfony/postgresql-cache/tests/Flow/Bridge/Symfony/PostgreSQLCache/Tests/Unit/CacheCatalogProviderTest.php
index c980018d0b..62761ba7db 100644
--- a/src/bridge/symfony/postgresql-cache/tests/Flow/Bridge/Symfony/PostgreSQLCache/Tests/Unit/CacheCatalogProviderTest.php
+++ b/src/bridge/symfony/postgresql-cache/tests/Flow/Bridge/Symfony/PostgreSQLCache/Tests/Unit/CacheCatalogProviderTest.php
@@ -12,7 +12,7 @@ final class CacheCatalogProviderTest extends TestCase
{
public function test_data_column_is_bytea_not_null(): void
{
- $col = (new CacheCatalogProvider())->get()->get('public')->tables[0]->column('item_data');
+ $col = new CacheCatalogProvider()->get()->get('public')->tables[0]->column('item_data');
static::assertFalse($col->nullable);
static::assertTrue($col->type->isEqual(ColumnType::bytea()));
@@ -20,14 +20,14 @@ public function test_data_column_is_bytea_not_null(): void
public function test_get_returns_catalog_with_custom_schema(): void
{
- $catalog = (new CacheCatalogProvider(schemaName: 'cache'))->get();
+ $catalog = new CacheCatalogProvider(schemaName: 'cache')->get();
static::assertSame(['cache'], $catalog->names());
}
public function test_id_column_is_primary_key_and_varchar_255(): void
{
- $table = (new CacheCatalogProvider())->get()->get('public')->tables[0];
+ $table = new CacheCatalogProvider()->get()->get('public')->tables[0];
static::assertSame(['item_id'], $table->primaryKey?->columns);
static::assertTrue($table->column('item_id')->type->isEqual(ColumnType::varchar(255)));
@@ -36,7 +36,7 @@ public function test_id_column_is_primary_key_and_varchar_255(): void
public function test_index_on_lifetime_time_uses_table_prefix(): void
{
- $indexes = (new CacheCatalogProvider('my_cache'))->get()->get('public')->tables[0]->indexes;
+ $indexes = new CacheCatalogProvider('my_cache')->get()->get('public')->tables[0]->indexes;
static::assertCount(1, $indexes);
static::assertSame('idx_my_cache_lifetime_time', $indexes[0]->name);
@@ -45,7 +45,7 @@ public function test_index_on_lifetime_time_uses_table_prefix(): void
public function test_lifetime_column_is_integer_nullable(): void
{
- $col = (new CacheCatalogProvider())->get()->get('public')->tables[0]->column('item_lifetime');
+ $col = new CacheCatalogProvider()->get()->get('public')->tables[0]->column('item_lifetime');
static::assertTrue($col->nullable);
static::assertTrue($col->type->isEqual(ColumnType::integer()));
@@ -53,12 +53,12 @@ public function test_lifetime_column_is_integer_nullable(): void
public function test_table_has_custom_columns(): void
{
- $table = (new CacheCatalogProvider(
+ $table = new CacheCatalogProvider(
idCol: 'cid',
dataCol: 'cdata',
lifetimeCol: 'cttl',
timeCol: 'cts',
- ))->get()->get('public')->tables[0];
+ )->get()->get('public')->tables[0];
static::assertSame(['cid', 'cdata', 'cttl', 'cts'], $table->columnNames());
static::assertSame(['cid'], $table->primaryKey?->columns);
@@ -66,7 +66,7 @@ public function test_table_has_custom_columns(): void
public function test_table_has_custom_name_and_schema(): void
{
- $table = (new CacheCatalogProvider('app_cache', 'app'))->get()->get('app')->tables[0];
+ $table = new CacheCatalogProvider('app_cache', 'app')->get()->get('app')->tables[0];
static::assertSame('app_cache', $table->name);
static::assertSame('app', $table->schema);
@@ -74,14 +74,14 @@ public function test_table_has_custom_name_and_schema(): void
public function test_table_has_default_name(): void
{
- $table = (new CacheCatalogProvider())->get()->get('public')->tables[0];
+ $table = new CacheCatalogProvider()->get()->get('public')->tables[0];
static::assertSame('cache_items', $table->name);
}
public function test_time_column_is_integer_not_null(): void
{
- $col = (new CacheCatalogProvider())->get()->get('public')->tables[0]->column('item_time');
+ $col = new CacheCatalogProvider()->get()->get('public')->tables[0]->column('item_time');
static::assertFalse($col->nullable);
static::assertTrue($col->type->isEqual(ColumnType::integer()));
diff --git a/src/bridge/symfony/postgresql-messenger/composer.json b/src/bridge/symfony/postgresql-messenger/composer.json
index f75936c0b3..ced81894f1 100644
--- a/src/bridge/symfony/postgresql-messenger/composer.json
+++ b/src/bridge/symfony/postgresql-messenger/composer.json
@@ -9,9 +9,9 @@
"bridge"
],
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/postgresql": "self.version",
- "symfony/messenger": "^6.4 || ^7.4 || ^8.0"
+ "symfony/messenger": "^7.4 || ^8.0"
},
"config": {
"optimize-autoloader": true,
diff --git a/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Integration/FlowPostgreSqlTransportTest.php b/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Integration/FlowPostgreSqlTransportTest.php
index 1e4a77e23a..23ef26b568 100644
--- a/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Integration/FlowPostgreSqlTransportTest.php
+++ b/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Integration/FlowPostgreSqlTransportTest.php
@@ -193,7 +193,7 @@ public function test_send_with_delay_hides_message_until_available(): void
new PhpSerializer(),
);
- $transport->send((new Envelope(new IntegrationTestMessage('delayed')))->with(new DelayStamp(60000)));
+ $transport->send(new Envelope(new IntegrationTestMessage('delayed'))->with(new DelayStamp(60000)));
static::assertCount(0, iterator_to_array($transport->get(), false));
}
diff --git a/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Unit/FlowPostgreSqlReceiverTest.php b/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Unit/FlowPostgreSqlReceiverTest.php
index 292a4b3af5..2dcc066660 100644
--- a/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Unit/FlowPostgreSqlReceiverTest.php
+++ b/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Unit/FlowPostgreSqlReceiverTest.php
@@ -28,7 +28,7 @@ public function test_ack_delegates_to_connection_with_stamp_id(): void
$client->executeReturn = 1;
$receiver = new FlowPostgreSqlReceiver(new Connection($client), new FakeSerializer());
- $envelope = (new Envelope((object) []))->with(new TransportMessageIdStamp('42'));
+ $envelope = new Envelope((object) [])->with(new TransportMessageIdStamp('42'));
$receiver->ack($envelope);
static::assertSame([42], $client->executedQueries[0]['parameters']);
@@ -260,7 +260,7 @@ public function test_keepalive_delegates_with_stamp_id_and_seconds(): void
$client = new SpyClient();
$receiver = new FlowPostgreSqlReceiver(new Connection($client), new FakeSerializer());
- $envelope = (new Envelope((object) []))->with(new TransportMessageIdStamp('42'));
+ $envelope = new Envelope((object) [])->with(new TransportMessageIdStamp('42'));
$receiver->keepalive($envelope, 60);
static::assertSame([42], [$client->executedQueries[0]['parameters'][1]]);
@@ -276,7 +276,7 @@ public function execute(Sql|string $sql, array|ConvertedParameters $parameters =
};
$receiver = new FlowPostgreSqlReceiver(new Connection($client), new FakeSerializer());
- $envelope = (new Envelope((object) []))->with(new TransportMessageIdStamp('1'));
+ $envelope = new Envelope((object) [])->with(new TransportMessageIdStamp('1'));
$this->expectException(TransportException::class);
$receiver->keepalive($envelope);
@@ -288,7 +288,7 @@ public function test_reject_delegates_to_connection(): void
$client->executeReturn = 1;
$receiver = new FlowPostgreSqlReceiver(new Connection($client), new FakeSerializer());
- $envelope = (new Envelope((object) []))->with(new TransportMessageIdStamp('42'));
+ $envelope = new Envelope((object) [])->with(new TransportMessageIdStamp('42'));
$receiver->reject($envelope);
static::assertSame([42], $client->executedQueries[0]['parameters']);
@@ -304,7 +304,7 @@ public function execute(Sql|string $sql, array|ConvertedParameters $parameters =
};
$receiver = new FlowPostgreSqlReceiver(new Connection($client), new FakeSerializer());
- $envelope = (new Envelope((object) []))->with(new TransportMessageIdStamp('1'));
+ $envelope = new Envelope((object) [])->with(new TransportMessageIdStamp('1'));
$this->expectException(TransportException::class);
$receiver->reject($envelope);
diff --git a/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Unit/FlowPostgreSqlSenderTest.php b/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Unit/FlowPostgreSqlSenderTest.php
index e1d7920556..acb224e31c 100644
--- a/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Unit/FlowPostgreSqlSenderTest.php
+++ b/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Unit/FlowPostgreSqlSenderTest.php
@@ -85,7 +85,7 @@ public function test_send_with_delay_stamp_delegates_delay_to_connection(): void
$client->fetchSingleReturn = ['id' => 1];
$sender = new FlowPostgreSqlSender(new Connection($client), new FakeSerializer());
- $envelope = (new Envelope((object) []))->with(new DelayStamp(5000));
+ $envelope = new Envelope((object) [])->with(new DelayStamp(5000));
$sender->send($envelope);
static::assertCount(1, $client->executedQueries);
diff --git a/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Unit/FlowPostgreSqlTransportTest.php b/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Unit/FlowPostgreSqlTransportTest.php
index cde23cf3c0..29c14ec9e0 100644
--- a/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Unit/FlowPostgreSqlTransportTest.php
+++ b/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Unit/FlowPostgreSqlTransportTest.php
@@ -28,7 +28,7 @@ public function test_ack_delegates_to_receiver(): void
$client->executeReturn = 1;
$transport = new FlowPostgreSqlTransport(new Connection($client), new FakeSerializer());
- $envelope = (new Envelope((object) []))->with(new TransportMessageIdStamp('1'));
+ $envelope = new Envelope((object) [])->with(new TransportMessageIdStamp('1'));
$transport->ack($envelope);
static::assertSame([1], $client->executedQueries[0]['parameters']);
@@ -47,7 +47,7 @@ public function test_all_delegates_to_receiver(): void
public function test_does_not_implement_setupable_transport_interface(): void
{
- static::assertFalse((new ReflectionClass(FlowPostgreSqlTransport::class))->implementsInterface(
+ static::assertFalse(new ReflectionClass(FlowPostgreSqlTransport::class)->implementsInterface(
SetupableTransportInterface::class,
));
}
@@ -94,7 +94,7 @@ public function test_keepalive_delegates_to_receiver(): void
$client = new SpyClient();
$transport = new FlowPostgreSqlTransport(new Connection($client), new FakeSerializer());
- $envelope = (new Envelope((object) []))->with(new TransportMessageIdStamp('1'));
+ $envelope = new Envelope((object) [])->with(new TransportMessageIdStamp('1'));
$transport->keepalive($envelope);
static::assertCount(1, $client->executedQueries);
@@ -106,7 +106,7 @@ public function test_reject_delegates_to_receiver(): void
$client->executeReturn = 1;
$transport = new FlowPostgreSqlTransport(new Connection($client), new FakeSerializer());
- $envelope = (new Envelope((object) []))->with(new TransportMessageIdStamp('1'));
+ $envelope = new Envelope((object) [])->with(new TransportMessageIdStamp('1'));
$transport->reject($envelope);
static::assertSame([1], $client->executedQueries[0]['parameters']);
diff --git a/src/bridge/symfony/postgresql-session/composer.json b/src/bridge/symfony/postgresql-session/composer.json
index 8a8e44be7f..7db20d26ad 100644
--- a/src/bridge/symfony/postgresql-session/composer.json
+++ b/src/bridge/symfony/postgresql-session/composer.json
@@ -9,9 +9,9 @@
"bridge"
],
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/postgresql": "self.version",
- "symfony/http-foundation": "^6.4 || ^7.4 || ^8.0"
+ "symfony/http-foundation": "^7.4 || ^8.0"
},
"config": {
"optimize-autoloader": true,
diff --git a/src/bridge/symfony/postgresql-session/tests/Flow/Bridge/Symfony/PostgreSQLSession/Tests/Unit/SessionCatalogProviderTest.php b/src/bridge/symfony/postgresql-session/tests/Flow/Bridge/Symfony/PostgreSQLSession/Tests/Unit/SessionCatalogProviderTest.php
index 07908a3f35..e570305788 100644
--- a/src/bridge/symfony/postgresql-session/tests/Flow/Bridge/Symfony/PostgreSQLSession/Tests/Unit/SessionCatalogProviderTest.php
+++ b/src/bridge/symfony/postgresql-session/tests/Flow/Bridge/Symfony/PostgreSQLSession/Tests/Unit/SessionCatalogProviderTest.php
@@ -12,7 +12,7 @@ final class SessionCatalogProviderTest extends TestCase
{
public function test_data_column_is_bytea_not_null(): void
{
- $col = (new SessionCatalogProvider())->get()->get('public')->tables[0]->column('sess_data');
+ $col = new SessionCatalogProvider()->get()->get('public')->tables[0]->column('sess_data');
static::assertFalse($col->nullable);
static::assertTrue($col->type->isEqual(ColumnType::bytea()));
@@ -20,14 +20,14 @@ public function test_data_column_is_bytea_not_null(): void
public function test_get_returns_catalog_with_custom_schema(): void
{
- $catalog = (new SessionCatalogProvider(schemaName: 'session'))->get();
+ $catalog = new SessionCatalogProvider(schemaName: 'session')->get();
static::assertSame(['session'], $catalog->names());
}
public function test_id_column_is_primary_key_and_varchar_128(): void
{
- $table = (new SessionCatalogProvider())->get()->get('public')->tables[0];
+ $table = new SessionCatalogProvider()->get()->get('public')->tables[0];
static::assertSame(['sess_id'], $table->primaryKey?->columns);
static::assertTrue($table->column('sess_id')->type->isEqual(ColumnType::varchar(128)));
@@ -36,7 +36,7 @@ public function test_id_column_is_primary_key_and_varchar_128(): void
public function test_index_on_lifetime_uses_table_prefix(): void
{
- $indexes = (new SessionCatalogProvider('app_sessions'))->get()->get('public')->tables[0]->indexes;
+ $indexes = new SessionCatalogProvider('app_sessions')->get()->get('public')->tables[0]->indexes;
static::assertCount(1, $indexes);
static::assertSame('idx_app_sessions_lifetime', $indexes[0]->name);
@@ -45,7 +45,7 @@ public function test_index_on_lifetime_uses_table_prefix(): void
public function test_lifetime_column_is_integer_not_null(): void
{
- $col = (new SessionCatalogProvider())->get()->get('public')->tables[0]->column('sess_lifetime');
+ $col = new SessionCatalogProvider()->get()->get('public')->tables[0]->column('sess_lifetime');
static::assertFalse($col->nullable);
static::assertTrue($col->type->isEqual(ColumnType::integer()));
@@ -53,12 +53,12 @@ public function test_lifetime_column_is_integer_not_null(): void
public function test_table_has_custom_columns(): void
{
- $table = (new SessionCatalogProvider(
+ $table = new SessionCatalogProvider(
idCol: 'sid',
dataCol: 'sdata',
lifetimeCol: 'sttl',
timeCol: 'sts',
- ))->get()->get('public')->tables[0];
+ )->get()->get('public')->tables[0];
static::assertSame(['sid', 'sdata', 'sttl', 'sts'], $table->columnNames());
static::assertSame(['sid'], $table->primaryKey?->columns);
@@ -66,7 +66,7 @@ public function test_table_has_custom_columns(): void
public function test_table_has_custom_name_and_schema(): void
{
- $table = (new SessionCatalogProvider('app_sessions', 'app'))->get()->get('app')->tables[0];
+ $table = new SessionCatalogProvider('app_sessions', 'app')->get()->get('app')->tables[0];
static::assertSame('app_sessions', $table->name);
static::assertSame('app', $table->schema);
@@ -74,14 +74,14 @@ public function test_table_has_custom_name_and_schema(): void
public function test_table_has_default_name(): void
{
- $table = (new SessionCatalogProvider())->get()->get('public')->tables[0];
+ $table = new SessionCatalogProvider()->get()->get('public')->tables[0];
static::assertSame('sessions', $table->name);
}
public function test_time_column_is_integer_not_null(): void
{
- $col = (new SessionCatalogProvider())->get()->get('public')->tables[0]->column('sess_time');
+ $col = new SessionCatalogProvider()->get()->get('public')->tables[0]->column('sess_time');
static::assertFalse($col->nullable);
static::assertTrue($col->type->isEqual(ColumnType::integer()));
diff --git a/src/bridge/symfony/telemetry-bundle/composer.json b/src/bridge/symfony/telemetry-bundle/composer.json
index f98fd2e94a..3440d1a674 100644
--- a/src/bridge/symfony/telemetry-bundle/composer.json
+++ b/src/bridge/symfony/telemetry-bundle/composer.json
@@ -15,39 +15,39 @@
"homepage": "https://github.com/flow-php/flow",
"license": "MIT",
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/psr3-telemetry-bridge": "self.version",
"flow-php/telemetry": "self.version",
"psr/clock": "^1.0",
- "symfony/config": "^6.4 || ^7.4 || ^8.0",
- "symfony/console": "^6.4.34 || ^7.4.6 || ^8.0.6",
- "symfony/dependency-injection": "^6.4 || ^7.4 || ^8.0",
+ "symfony/config": "^7.4 || ^8.0",
+ "symfony/console": "^7.4.6 || ^8.0.6",
+ "symfony/dependency-injection": "^7.4 || ^8.0",
"symfony/http-client-contracts": "^3.0",
- "symfony/http-kernel": "^6.4 || ^7.4 || ^8.0",
+ "symfony/http-kernel": "^7.4 || ^8.0",
"symfony/polyfill-mbstring": "^1.33"
},
"require-dev": {
"composer-runtime-api": "^2.2",
"composer/semver": "^3.4",
- "doctrine/dbal": "^4.5",
+ "doctrine/dbal": "^4.6",
"flow-php/psr18-telemetry-bridge": "self.version",
"flow-php/symfony-http-foundation-telemetry-bridge": "self.version",
"flow-php/telemetry-otlp-bridge": "self.version",
"nyholm/psr7": "^1.8",
- "symfony/framework-bundle": "^6.4 || ^7.4 || ^8.0",
- "symfony/http-client": "^6.4 || ^7.4 || ^8.0",
- "symfony/messenger": "^6.4 || ^7.4 || ^8.0",
- "symfony/routing": "^6.4 || ^7.4 || ^8.0",
- "symfony/security-bundle": "^6.4 || ^7.4 || ^8.0",
- "symfony/security-core": "^6.4 || ^7.4 || ^8.0",
- "symfony/security-http": "^6.4 || ^7.4 || ^8.0",
- "symfony/serializer": "^6.4 || ^7.4 || ^8.0",
- "symfony/var-dumper": "^6.4 || ^7.4 || ^8.0",
- "symfony/web-profiler-bundle": "^6.4 || ^7.4 || ^8.0",
+ "symfony/framework-bundle": "^7.4 || ^8.0",
+ "symfony/http-client": "^7.4 || ^8.0",
+ "symfony/messenger": "^7.4 || ^8.0",
+ "symfony/routing": "^7.4 || ^8.0",
+ "symfony/security-bundle": "^7.4 || ^8.0",
+ "symfony/security-core": "^7.4 || ^8.0",
+ "symfony/security-http": "^7.4 || ^8.0",
+ "symfony/serializer": "^7.4 || ^8.0",
+ "symfony/var-dumper": "^7.4 || ^8.0",
+ "symfony/web-profiler-bundle": "^7.4 || ^8.0",
"twig/twig": "^3.0"
},
"suggest": {
- "doctrine/dbal": "Required for Doctrine DBAL tracing (^4.5)",
+ "doctrine/dbal": "Required for Doctrine DBAL tracing (^4.6)",
"flow-php/psr18-telemetry-bridge": "Required for PSR-18 HTTP client tracing",
"flow-php/symfony-http-foundation-telemetry-bridge": "Required for HTTP trace context propagation (extract incoming / inject outgoing W3C trace headers)",
"flow-php/telemetry-otlp-bridge": "Required for OTLP exporter support",
diff --git a/src/bridge/symfony/telemetry-bundle/src/Flow/Bridge/Symfony/TelemetryBundle/Instrumentation/HttpKernel/HttpKernelSpanSubscriber.php b/src/bridge/symfony/telemetry-bundle/src/Flow/Bridge/Symfony/TelemetryBundle/Instrumentation/HttpKernel/HttpKernelSpanSubscriber.php
index e2a5f813e6..856fa7aa0d 100644
--- a/src/bridge/symfony/telemetry-bundle/src/Flow/Bridge/Symfony/TelemetryBundle/Instrumentation/HttpKernel/HttpKernelSpanSubscriber.php
+++ b/src/bridge/symfony/telemetry-bundle/src/Flow/Bridge/Symfony/TelemetryBundle/Instrumentation/HttpKernel/HttpKernelSpanSubscriber.php
@@ -308,7 +308,7 @@ private function extractContextFromRequest(Request $request): void
$spanContext = $propagationContext->spanContext;
if ($spanContext !== null) {
- $context = (new Context())->withActiveSpan($spanContext);
+ $context = new Context()->withActiveSpan($spanContext);
if ($propagationContext->baggage !== null) {
$context = $context->withBaggage($propagationContext->baggage);
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Context/ConfigurationContext.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Context/ConfigurationContext.php
index ef3b62e995..9a95169d80 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Context/ConfigurationContext.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Context/ConfigurationContext.php
@@ -35,7 +35,7 @@ public function processRawConfig(mixed $config): array
*/
public function processConfigs(mixed ...$configs): array
{
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
if (!$extension instanceof ConfigurationExtensionInterface) {
throw new LogicException('FlowTelemetryBundle extension does not expose a configuration tree.');
@@ -47,6 +47,6 @@ public function processConfigs(mixed ...$configs): array
throw new LogicException('FlowTelemetryBundle extension exposes no configuration tree.');
}
- return (new Processor())->processConfiguration($configuration, $configs);
+ return new Processor()->processConfiguration($configuration, $configs);
}
}
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Fixtures/TestKernel.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Fixtures/TestKernel.php
index 5485b6e4ce..ff841bb562 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Fixtures/TestKernel.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Fixtures/TestKernel.php
@@ -10,7 +10,7 @@
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\HttpKernel\Bundle\BundleInterface;
+use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\Kernel;
use function array_merge;
@@ -21,7 +21,7 @@
final class TestKernel extends Kernel
{
- /** @var array> */
+ /** @var array> */
private array $testBundles = [];
/** @var array */
@@ -43,7 +43,7 @@ public function __construct(string $environment = 'test', bool $debug = true)
}
/**
- * @param class-string $bundleClass
+ * @param class-string $bundleClass
*/
public function addTestBundle(string $bundleClass): void
{
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Fixtures/config/profiler_panel_routes.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Fixtures/config/profiler_panel_routes.php
index 027fd37b87..0556162db5 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Fixtures/config/profiler_panel_routes.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Fixtures/config/profiler_panel_routes.php
@@ -2,14 +2,8 @@
declare(strict_types=1);
-use Composer\InstalledVersions;
-use Composer\Semver\VersionParser;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
return static function (RoutingConfigurator $routes): void {
- if (InstalledVersions::satisfies(new VersionParser(), 'symfony/web-profiler-bundle', '^6.4.0')) {
- $routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml')->prefix('/_profiler');
- } else {
- $routes->import('@WebProfilerBundle/Resources/config/routing/profiler.php')->prefix('/_profiler');
- }
+ $routes->import('@WebProfilerBundle/Resources/config/routing/profiler.php')->prefix('/_profiler');
};
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Integration/DependencyInjection/Compiler/CacheTelemetryPassTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Integration/DependencyInjection/Compiler/CacheTelemetryPassTest.php
index 33e5f45224..1c1ceac811 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Integration/DependencyInjection/Compiler/CacheTelemetryPassTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Integration/DependencyInjection/Compiler/CacheTelemetryPassTest.php
@@ -16,7 +16,6 @@
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
-use function class_exists;
use function restore_exception_handler;
use function version_compare;
@@ -133,10 +132,6 @@ public function test_excluded_pools_are_not_traced_in_a_booted_kernel(): void
*/
public function test_container_lint_passes_with_every_instrumentation_enabled(): void
{
- if (!class_exists(CheckAliasValidityPass::class)) {
- static::markTestSkipped('CheckAliasValidityPass requires symfony/dependency-injection >= 7.3');
- }
-
$collector = new CompiledIdCollectorPass();
$this->bootKernel([
@@ -170,10 +165,6 @@ public function test_container_lint_passes_with_every_instrumentation_enabled():
public function test_container_lint_passes_with_a_tag_aware_app_pool(): void
{
- if (!class_exists(CheckAliasValidityPass::class)) {
- static::markTestSkipped('CheckAliasValidityPass requires symfony/dependency-injection >= 7.3');
- }
-
$collector = new CompiledIdCollectorPass();
$this->bootKernel([
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Integration/FlowTelemetryExtensionTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Integration/FlowTelemetryExtensionTest.php
index 7a7fdb03f5..310c9e057a 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Integration/FlowTelemetryExtensionTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Integration/FlowTelemetryExtensionTest.php
@@ -609,7 +609,7 @@ public function test_async_curl_transport_options_and_error_handler_are_wired():
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([[
'resource' => [],
@@ -640,7 +640,7 @@ public function test_async_curl_transport_is_tagged_for_worker_pump(): void
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([[
'resource' => [],
@@ -666,7 +666,7 @@ public function test_sync_curl_transport_is_not_tagged_for_worker_pump(): void
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([[
'resource' => [],
@@ -696,7 +696,7 @@ public function test_async_curl_transport_tick_subscriber_is_registered_when_mes
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([[
'resource' => [],
@@ -716,7 +716,7 @@ public function test_security_instrumentation_registers_subscriber_and_field_par
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([[
'resource' => [],
@@ -748,7 +748,7 @@ public function test_security_instrumentation_is_not_registered_by_default(): vo
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([['resource' => []]], $container);
@@ -761,7 +761,7 @@ public function test_trace_context_propagation_services_are_registered(): void
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([['resource' => []]], $container);
@@ -781,7 +781,7 @@ public function test_telemetry_definition_registers_process_end_shutdown(): void
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([['resource' => []]], $container);
@@ -1024,7 +1024,7 @@ public function test_otlp_exporter_uses_named_error_handler(): void
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([[
'resource' => [],
@@ -1057,7 +1057,7 @@ public function test_messenger_defaults_trace_true_and_registers_suppression():
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([[
'resource' => [],
@@ -1087,7 +1087,7 @@ public function test_messenger_trace_false_disables_the_handler_span(): void
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([[
'resource' => [],
@@ -1104,7 +1104,7 @@ public function test_exclude_commands_defaults_to_messenger_consume(): void
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([['resource' => []]], $container);
@@ -1120,7 +1120,7 @@ public function test_exclude_commands_can_be_customized(): void
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([[
'resource' => [],
@@ -1139,7 +1139,7 @@ public function test_exclude_commands_empty_traces_everything(): void
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([[
'resource' => [],
@@ -1159,7 +1159,7 @@ public function test_messenger_context_storage_wired_even_when_propagation_disab
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([[
'resource' => [],
@@ -1182,7 +1182,7 @@ public function test_messenger_flush_subscriber_is_registered_and_tagged_when_en
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([[
'resource' => [],
@@ -1202,7 +1202,7 @@ public function test_messenger_flush_subscriber_absent_when_messenger_disabled()
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([[
'resource' => [],
@@ -1305,7 +1305,7 @@ public function test_processor_uses_named_error_handler(): void
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([[
'resource' => [],
@@ -1336,7 +1336,7 @@ public function test_max_batch_age_is_passed_to_batching_processor_definitions()
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([[
'resource' => [],
@@ -1365,7 +1365,7 @@ public function test_max_batch_age_defaults_to_null_in_batching_processor_defini
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([[
'resource' => [],
@@ -1394,7 +1394,7 @@ public function test_provider_uses_named_error_handler(): void
$container->setParameter('kernel.environment', 'test');
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->setParameter('kernel.build_dir', sys_get_temp_dir());
- $extension = (new FlowTelemetryBundle())->getContainerExtension();
+ $extension = new FlowTelemetryBundle()->getContainerExtension();
assert($extension !== null);
$extension->load([[
'resource' => [],
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Integration/Instrumentation/Cache/TraceableCacheAdapterTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Integration/Instrumentation/Cache/TraceableCacheAdapterTest.php
index dbbef93bbe..4ae49692d3 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Integration/Instrumentation/Cache/TraceableCacheAdapterTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Integration/Instrumentation/Cache/TraceableCacheAdapterTest.php
@@ -681,7 +681,7 @@ public function test_traceable_adapter_records_error_span_when_operation_fails()
/** @var TraceableCacheAdapter $cache */
$cache = $container->get('test.cache.app');
- $item = (new ArrayCacheAdapter())->getItem('save-key');
+ $item = new ArrayCacheAdapter()->getItem('save-key');
$failures = 0;
@@ -815,7 +815,7 @@ public function test_tag_aware_adapter_records_error_span_when_operation_fails()
/** @var TagAwareTraceableCacheAdapter $cache */
$cache = $container->get('test.cache.tags');
- $item = (new TagAwareArrayCacheAdapter())->getItem('save-key');
+ $item = new TagAwareArrayCacheAdapter()->getItem('save-key');
$failures = 0;
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Mother/CachePoolContainerMother.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Mother/CachePoolContainerMother.php
index 135fce1daf..717a25626f 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Mother/CachePoolContainerMother.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Mother/CachePoolContainerMother.php
@@ -27,25 +27,25 @@ public static function frameworkPoolGraph(): ContainerBuilder
$container->setDefinition(
'cache.system',
- (new ChildDefinition('cache.adapter.system'))
+ new ChildDefinition('cache.adapter.system')
->addTag('cache.pool')
->setPublic(true),
);
$container->setDefinition(
'cache.validator',
- (new ChildDefinition('cache.system'))
+ new ChildDefinition('cache.system')
->addTag('cache.pool')
->setPublic(true),
);
$container->setDefinition(
'cache.app',
- (new ChildDefinition('cache.adapter.filesystem'))
+ new ChildDefinition('cache.adapter.filesystem')
->addTag('cache.pool')
->setPublic(true),
);
$container->setDefinition(
'cache.doctrine.orm.default.result',
- (new ChildDefinition('cache.app'))
+ new ChildDefinition('cache.app')
->addTag('cache.pool')
->setPublic(true),
);
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Attribute/WithTelemetryChannelTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Attribute/WithTelemetryChannelTest.php
index de6571cf95..15abddfeca 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Attribute/WithTelemetryChannelTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Attribute/WithTelemetryChannelTest.php
@@ -15,12 +15,12 @@ final class WithTelemetryChannelTest extends TestCase
{
public function test_exposes_the_channel(): void
{
- static::assertSame('events', (new WithTelemetryChannel('events'))->channel);
+ static::assertSame('events', new WithTelemetryChannel('events')->channel);
}
public function test_is_a_class_targeted_attribute(): void
{
- $attributes = (new ReflectionClass(WithTelemetryChannel::class))->getAttributes(Attribute::class);
+ $attributes = new ReflectionClass(WithTelemetryChannel::class)->getAttributes(Attribute::class);
static::assertCount(1, $attributes);
static::assertSame(Attribute::TARGET_CLASS, $attributes[0]->newInstance()->flags);
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ArgumentResolverTelemetryPassTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ArgumentResolverTelemetryPassTest.php
index 5ff68d33a7..615bc9c769 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ArgumentResolverTelemetryPassTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ArgumentResolverTelemetryPassTest.php
@@ -19,7 +19,7 @@ public function test_no_op_when_parameter_absent(): void
$container = new ContainerBuilder();
$container->setDefinition('argument_resolver', new Definition());
- (new ArgumentResolverTelemetryPass())->process($container);
+ new ArgumentResolverTelemetryPass()->process($container);
static::assertFalse($container->hasDefinition('argument_resolver.flow_telemetry'));
}
@@ -30,7 +30,7 @@ public function test_no_op_when_parameter_false(): void
$container->setParameter('flow.telemetry.http_kernel.trace_controller_arguments', false);
$container->setDefinition('argument_resolver', new Definition());
- (new ArgumentResolverTelemetryPass())->process($container);
+ new ArgumentResolverTelemetryPass()->process($container);
static::assertFalse($container->hasDefinition('argument_resolver.flow_telemetry'));
}
@@ -41,7 +41,7 @@ public function test_decorates_argument_resolver_when_enabled(): void
$container->setParameter('flow.telemetry.http_kernel.trace_controller_arguments', true);
$container->setDefinition('argument_resolver', new Definition());
- (new ArgumentResolverTelemetryPass())->process($container);
+ new ArgumentResolverTelemetryPass()->process($container);
$decorator = $container->getDefinition('argument_resolver.flow_telemetry');
static::assertSame(TracingArgumentResolver::class, $decorator->getClass());
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ArgumentValueResolverTelemetryPassTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ArgumentValueResolverTelemetryPassTest.php
index 54da5c7891..71e5e6f668 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ArgumentValueResolverTelemetryPassTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ArgumentValueResolverTelemetryPassTest.php
@@ -20,10 +20,10 @@ public function test_no_op_when_parameter_absent(): void
$container = new ContainerBuilder();
$container->setDefinition(
'value_resolver.test',
- (new Definition())->addTag('controller.argument_value_resolver'),
+ new Definition()->addTag('controller.argument_value_resolver'),
);
- (new ArgumentValueResolverTelemetryPass())->process($container);
+ new ArgumentValueResolverTelemetryPass()->process($container);
static::assertFalse($container->hasDefinition('value_resolver.test.flow_telemetry'));
}
@@ -34,10 +34,10 @@ public function test_no_op_when_parameter_false(): void
$container->setParameter('flow.telemetry.http_kernel.trace_controller_argument_resolvers', false);
$container->setDefinition(
'value_resolver.test',
- (new Definition())->addTag('controller.argument_value_resolver'),
+ new Definition()->addTag('controller.argument_value_resolver'),
);
- (new ArgumentValueResolverTelemetryPass())->process($container);
+ new ArgumentValueResolverTelemetryPass()->process($container);
static::assertFalse($container->hasDefinition('value_resolver.test.flow_telemetry'));
}
@@ -46,22 +46,16 @@ public function test_decorates_concrete_tagged_resolvers_only(): void
{
$container = new ContainerBuilder();
$container->setParameter('flow.telemetry.http_kernel.trace_controller_argument_resolvers', true);
- $container->setDefinition(
- 'value_resolver.one',
- (new Definition())->addTag('controller.argument_value_resolver'),
- );
- $container->setDefinition(
- 'value_resolver.two',
- (new Definition())->addTag('controller.argument_value_resolver'),
- );
+ $container->setDefinition('value_resolver.one', new Definition()->addTag('controller.argument_value_resolver'));
+ $container->setDefinition('value_resolver.two', new Definition()->addTag('controller.argument_value_resolver'));
$container->setDefinition(
'value_resolver.abstract',
- (new Definition())
+ new Definition()
->setAbstract(true)
->addTag('controller.argument_value_resolver'),
);
- (new ArgumentValueResolverTelemetryPass())->process($container);
+ new ArgumentValueResolverTelemetryPass()->process($container);
static::assertFalse($container->hasDefinition('value_resolver.abstract.flow_telemetry'));
@@ -84,12 +78,12 @@ public function test_a_resolver_that_also_listens_to_events_is_not_decorated(str
$container->setParameter('flow.telemetry.http_kernel.trace_controller_argument_resolvers', true);
$container->setDefinition(
'value_resolver.listening',
- (new Definition())
+ new Definition()
->addTag('controller.argument_value_resolver')
->addTag($eventTag),
);
- (new ArgumentValueResolverTelemetryPass())->process($container);
+ new ArgumentValueResolverTelemetryPass()->process($container);
static::assertFalse($container->hasDefinition('value_resolver.listening.flow_telemetry'));
}
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/CacheTelemetryPassTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/CacheTelemetryPassTest.php
index 482765012f..a62b33ab29 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/CacheTelemetryPassTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/CacheTelemetryPassTest.php
@@ -22,7 +22,7 @@ public function test_abstract_adapter_templates_are_skipped(): void
{
$container = CachePoolContainerMother::frameworkPoolGraph();
- (new CacheTelemetryPass())->process($container);
+ new CacheTelemetryPass()->process($container);
static::assertFalse($container->hasDefinition('cache.adapter.system.flow_telemetry'));
static::assertFalse($container->hasDefinition('cache.adapter.filesystem.flow_telemetry'));
@@ -32,7 +32,7 @@ public function test_pool_inheriting_its_class_from_a_parent_is_traced(): void
{
$container = CachePoolContainerMother::frameworkPoolGraph();
- (new CacheTelemetryPass())->process($container);
+ new CacheTelemetryPass()->process($container);
static::assertSame(
TraceableCacheAdapter::class,
@@ -48,7 +48,7 @@ public function test_pool_inheriting_through_multiple_levels_is_traced(): void
{
$container = CachePoolContainerMother::frameworkPoolGraph();
- (new CacheTelemetryPass())->process($container);
+ new CacheTelemetryPass()->process($container);
static::assertSame(
TraceableCacheAdapter::class,
@@ -60,7 +60,7 @@ public function test_tag_aware_pool_gets_the_tag_aware_decorator(): void
{
$container = CachePoolContainerMother::frameworkPoolGraph();
- (new CacheTelemetryPass())->process($container);
+ new CacheTelemetryPass()->process($container);
static::assertSame(
TagAwareTraceableCacheAdapter::class,
@@ -72,7 +72,7 @@ public function test_pool_declared_as_a_parameter_is_traced(): void
{
$container = CachePoolContainerMother::frameworkPoolGraph();
- (new CacheTelemetryPass())->process($container);
+ new CacheTelemetryPass()->process($container);
static::assertSame(
TraceableCacheAdapter::class,
@@ -86,7 +86,7 @@ public function test_tag_aware_pool_declared_as_a_parameter_gets_the_tag_aware_d
$container->setParameter('app.tag_aware_pool.class', RedisTagAwareAdapter::class);
$container->register('app.param_tag_aware_pool', '%app.tag_aware_pool.class%')->addTag('cache.pool');
- (new CacheTelemetryPass())->process($container);
+ new CacheTelemetryPass()->process($container);
static::assertSame(
TagAwareTraceableCacheAdapter::class,
@@ -99,7 +99,7 @@ public function test_pool_excluded_by_exact_id_is_left_untouched(): void
$container = CachePoolContainerMother::frameworkPoolGraph();
$container->setParameter('flow.telemetry.cache.exclude_pools', ['cache.system']);
- (new CacheTelemetryPass())->process($container);
+ new CacheTelemetryPass()->process($container);
static::assertFalse($container->hasDefinition('cache.system.flow_telemetry'));
static::assertTrue($container->hasDefinition('cache.validator.flow_telemetry'));
@@ -110,7 +110,7 @@ public function test_pool_excluded_by_regex_is_left_untouched(): void
$container = CachePoolContainerMother::frameworkPoolGraph();
$container->setParameter('flow.telemetry.cache.exclude_pools', ['/^cache\.validator.*/']);
- (new CacheTelemetryPass())->process($container);
+ new CacheTelemetryPass()->process($container);
static::assertFalse($container->hasDefinition('cache.validator.flow_telemetry'));
static::assertTrue($container->hasDefinition('cache.system.flow_telemetry'));
@@ -122,7 +122,7 @@ public function test_nothing_is_decorated_when_disabled(): void
$container->setParameter('flow.telemetry.cache.enabled', false);
$container->setParameter('flow.telemetry.cache.flush_deferred', true);
- (new CacheTelemetryPass())->process($container);
+ new CacheTelemetryPass()->process($container);
static::assertFalse($container->hasDefinition('cache.system.flow_telemetry'));
static::assertFalse($container->hasDefinition('app.redis_pool.flow_telemetry'));
@@ -134,7 +134,7 @@ public function test_deferred_flush_subscriber_collects_the_newly_traced_pools()
$container = CachePoolContainerMother::frameworkPoolGraph();
$container->setParameter('flow.telemetry.cache.flush_deferred', true);
- (new CacheTelemetryPass())->process($container);
+ new CacheTelemetryPass()->process($container);
/** @var mixed $innerPools */
$innerPools = $container->getDefinition('flow.telemetry.cache.deferred_flush_subscriber')->getArgument(0);
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ChannelLoggerPassTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ChannelLoggerPassTest.php
index 3f81f11cc9..ac34fb3ff0 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ChannelLoggerPassTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ChannelLoggerPassTest.php
@@ -24,7 +24,7 @@ public function test_app_channel_is_synthesized_like_any_other_channel(): void
{
$container = ChannelLoggerMother::taggedConsumerContainer('app');
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
static::assertTrue($container->hasDefinition('flow.telemetry.app.logger'));
static::assertSame(
@@ -40,7 +40,7 @@ public function test_default_channel_reuses_the_always_present_default_logger():
$container->setDefinition('flow.telemetry.default.logger', $existing);
$container->setDefinition('flow.telemetry.default.logger.psr3', new Definition(Logger::class));
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
static::assertSame($existing, $container->getDefinition('flow.telemetry.default.logger'));
static::assertSame(
@@ -53,7 +53,7 @@ public function test_binds_channel_logger_to_tagged_service(): void
{
$container = ChannelLoggerMother::taggedConsumerContainer('events');
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
static::assertSame(
'flow.telemetry.events.logger.psr3',
@@ -65,7 +65,7 @@ public function test_binds_native_logger_to_tagged_service(): void
{
$container = ChannelLoggerMother::taggedConsumerContainer('events');
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
static::assertSame(
'flow.telemetry.events.logger',
@@ -77,7 +77,7 @@ public function test_app_channel_binds_its_own_native_logger(): void
{
$container = ChannelLoggerMother::taggedConsumerContainer('app');
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
static::assertSame(
'flow.telemetry.app.logger',
@@ -89,7 +89,7 @@ public function test_registers_native_logger_named_argument_alias(): void
{
$container = ChannelLoggerMother::taggedConsumerContainer('events');
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
$aliasId = Logger::class . ' $eventsLogger';
static::assertTrue($container->hasAlias($aliasId));
@@ -103,7 +103,7 @@ public function test_does_not_override_a_declared_logger(): void
$container->setDefinition('flow.telemetry.events.logger', $declared);
$container->setDefinition('flow.telemetry.events.logger.psr3', new Definition(Logger::class));
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
static::assertSame($declared, $container->getDefinition('flow.telemetry.events.logger'));
}
@@ -115,7 +115,7 @@ public function test_empty_channel_attribute_throws(): void
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('missing the required non-empty "channel" attribute');
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
}
public function test_channel_parameter_resolving_to_empty_throws(): void
@@ -126,7 +126,7 @@ public function test_channel_parameter_resolving_to_empty_throws(): void
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('did not resolve to a non-empty string');
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
}
public function test_missing_channel_attribute_throws(): void
@@ -139,14 +139,14 @@ public function test_missing_channel_attribute_throws(): void
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('Service "consumer" is tagged');
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
}
public function test_registers_camel_cased_named_argument_alias(): void
{
$container = ChannelLoggerMother::taggedConsumerContainer('http_client');
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
$aliasId = LoggerInterface::class . ' $httpClientLogger';
static::assertTrue($container->hasAlias($aliasId));
@@ -158,7 +158,7 @@ public function test_rewrites_explicit_logger_reference_in_arguments(): void
$container = ChannelLoggerMother::taggedConsumerContainer('events');
$container->getDefinition('consumer')->setArgument(0, new Reference('logger'));
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
static::assertSame(
'flow.telemetry.events.logger.psr3',
@@ -170,7 +170,7 @@ public function test_synthesizes_channel_logger_with_log_channel_on_both_scope_a
{
$container = ChannelLoggerMother::taggedConsumerContainer('events');
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
$logger = $container->getDefinition('flow.telemetry.events.logger');
@@ -192,7 +192,7 @@ public function test_channel_attribute_target_scope_places_log_channel_on_scope_
$container = ChannelLoggerMother::taggedConsumerContainer('events');
$container->setParameter('flow.telemetry.channel_attribute_target', 'scope');
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
$logger = $container->getDefinition('flow.telemetry.events.logger');
@@ -208,7 +208,7 @@ public function test_channel_attribute_target_signal_places_log_channel_on_signa
$container = ChannelLoggerMother::taggedConsumerContainer('events');
$container->setParameter('flow.telemetry.channel_attribute_target', 'signal');
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
$logger = $container->getDefinition('flow.telemetry.events.logger');
@@ -223,7 +223,7 @@ public function test_captures_framework_monolog_logger_channel(): void
{
$container = ChannelLoggerMother::frameworkConsumerContainer('request');
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
static::assertSame(
'flow.telemetry.request.logger.psr3',
@@ -237,7 +237,7 @@ public function test_does_not_capture_framework_channels_when_disabled(): void
$container->setParameter('flow.telemetry.capture_framework_channels', false);
$container->getDefinition('framework.consumer')->setArgument(0, new Reference('logger'));
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
static::assertSame('logger', (string) $container->getDefinition('framework.consumer')->getArgument(0));
static::assertArrayNotHasKey(
@@ -255,7 +255,7 @@ public function test_explicit_channel_takes_precedence_over_framework_channel():
$consumer->addTag(ChannelLoggerPass::TAG, ['channel' => 'events']);
$container->setDefinition('consumer', $consumer);
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
static::assertSame(
'flow.telemetry.events.logger.psr3',
@@ -271,7 +271,7 @@ public function test_preserves_invalid_reference_behavior_when_rewriting(): void
new Reference('logger', ContainerInterface::IGNORE_ON_INVALID_REFERENCE),
);
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
// @mago-expect analysis:mixed-assignment
$reference = $container->getDefinition('framework.consumer')->getArgument(0);
@@ -284,7 +284,7 @@ public function test_registers_named_argument_alias_for_framework_channel(): voi
{
$container = ChannelLoggerMother::frameworkConsumerContainer('http_client');
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
$aliasId = LoggerInterface::class . ' $httpClientLogger';
static::assertTrue($container->hasAlias($aliasId));
@@ -296,7 +296,7 @@ public function test_rewrites_logger_reference_in_method_call(): void
$container = ChannelLoggerMother::frameworkConsumerContainer('cache');
$container->getDefinition('framework.consumer')->addMethodCall('setLogger', [new Reference('logger')]);
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
// @mago-expect analysis:mixed-assignment
$call = $container->getDefinition('framework.consumer')->getMethodCalls()[0] ?? null;
@@ -316,7 +316,7 @@ public function test_skips_framework_tag_whose_channel_resolves_to_empty(): void
$container->setParameter('flow.test.channel', '');
$container->getDefinition('framework.consumer')->setArgument(0, new Reference('logger'));
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
static::assertSame('logger', (string) $container->getDefinition('framework.consumer')->getArgument(0));
}
@@ -330,7 +330,7 @@ public function test_skips_framework_tag_without_a_channel(): void
$consumer->setArgument(0, new Reference('logger'));
$container->setDefinition('framework.consumer', $consumer);
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
static::assertSame('logger', (string) $container->getDefinition('framework.consumer')->getArgument(0));
}
@@ -340,7 +340,7 @@ public function test_still_routes_explicitly_tagged_services_when_telemetry_is_d
$container = ChannelLoggerMother::taggedConsumerContainer('events');
$container->setParameter('flow.telemetry.enabled', false);
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
static::assertTrue($container->hasDefinition('flow.telemetry.events.logger'));
static::assertSame(
@@ -355,7 +355,7 @@ public function test_does_not_capture_framework_channels_when_telemetry_is_disab
$container->setParameter('flow.telemetry.enabled', false);
$container->getDefinition('framework.consumer')->setArgument(0, new Reference('logger'));
- (new ChannelLoggerPass())->process($container);
+ new ChannelLoggerPass()->process($container);
static::assertSame('logger', (string) $container->getDefinition('framework.consumer')->getArgument(0));
static::assertArrayNotHasKey(
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ControllerResolverTelemetryPassTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ControllerResolverTelemetryPassTest.php
index 33ca7de1a0..31663821af 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ControllerResolverTelemetryPassTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ControllerResolverTelemetryPassTest.php
@@ -19,7 +19,7 @@ public function test_no_op_when_parameter_absent(): void
$container = new ContainerBuilder();
$container->setDefinition('controller_resolver', new Definition());
- (new ControllerResolverTelemetryPass())->process($container);
+ new ControllerResolverTelemetryPass()->process($container);
static::assertFalse($container->hasDefinition('controller_resolver.flow_telemetry'));
}
@@ -30,7 +30,7 @@ public function test_no_op_when_parameter_false(): void
$container->setParameter('flow.telemetry.http_kernel.trace_controller_resolution', false);
$container->setDefinition('controller_resolver', new Definition());
- (new ControllerResolverTelemetryPass())->process($container);
+ new ControllerResolverTelemetryPass()->process($container);
static::assertFalse($container->hasDefinition('controller_resolver.flow_telemetry'));
}
@@ -41,7 +41,7 @@ public function test_decorates_controller_resolver_when_enabled(): void
$container->setParameter('flow.telemetry.http_kernel.trace_controller_resolution', true);
$container->setDefinition('controller_resolver', new Definition());
- (new ControllerResolverTelemetryPass())->process($container);
+ new ControllerResolverTelemetryPass()->process($container);
$decorator = $container->getDefinition('controller_resolver.flow_telemetry');
static::assertSame(TracingControllerResolver::class, $decorator->getClass());
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/DBALTelemetryPassOrderingTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/DBALTelemetryPassOrderingTest.php
index f52c640812..23c150d136 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/DBALTelemetryPassOrderingTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/DBALTelemetryPassOrderingTest.php
@@ -34,7 +34,7 @@ public function test_dbal_pass_runs_before_a_priority_zero_pass_registered_befor
$consumer = new NoopCompilerPass();
$container->addCompilerPass($consumer, PassConfig::TYPE_BEFORE_OPTIMIZATION, 0);
- (new FlowTelemetryBundle())->build($container);
+ new FlowTelemetryBundle()->build($container);
$passes = $container->getCompiler()->getPassConfig()->getBeforeOptimizationPasses();
$dbalIndex = null;
@@ -61,7 +61,7 @@ public function test_dbal_pass_runs_before_a_priority_zero_pass_registered_after
$container = new ContainerBuilder();
$container->setParameter('flow.telemetry.dbal.enabled', true);
- (new FlowTelemetryBundle())->build($container);
+ new FlowTelemetryBundle()->build($container);
$consumer = new NoopCompilerPass();
$container->addCompilerPass($consumer, PassConfig::TYPE_BEFORE_OPTIMIZATION, 0);
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/DBALTelemetryPassTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/DBALTelemetryPassTest.php
index 889772b169..7b8517db51 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/DBALTelemetryPassTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/DBALTelemetryPassTest.php
@@ -30,7 +30,7 @@ public function test_transaction_spans_mode_is_wired_into_the_middleware_definit
$container->setParameter('flow.telemetry.dbal.transaction_spans', 'per_operation');
$container->setParameter('doctrine.connections', ['default' => 'doctrine.dbal.default_connection']);
- (new DBALTelemetryPass())->process($container);
+ new DBALTelemetryPass()->process($container);
static::assertSame(
TransactionSpanMode::PER_OPERATION,
@@ -44,7 +44,7 @@ public function test_transaction_spans_mode_defaults_to_grouped_when_parameter_a
$container->setParameter('flow.telemetry.dbal.enabled', true);
$container->setParameter('doctrine.connections', ['default' => 'doctrine.dbal.default_connection']);
- (new DBALTelemetryPass())->process($container);
+ new DBALTelemetryPass()->process($container);
static::assertSame(
TransactionSpanMode::GROUPED,
@@ -62,7 +62,7 @@ public function test_metric_and_parameter_config_is_wired_into_the_middleware_de
$container->setParameter('flow.telemetry.dbal.max_parameter_length', 20);
$container->setParameter('doctrine.connections', ['default' => 'doctrine.dbal.default_connection']);
- (new DBALTelemetryPass())->process($container);
+ new DBALTelemetryPass()->process($container);
$definition = $container->getDefinition('flow.telemetry.dbal.middleware.default');
static::assertFalse($definition->getArgument(6), 'collect_metrics');
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/DefinitionClassResolverTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/DefinitionClassResolverTest.php
index b2cf4688b5..e5453695e2 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/DefinitionClassResolverTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/DefinitionClassResolverTest.php
@@ -22,7 +22,7 @@ public function test_resolves_a_directly_declared_class(): void
static::assertSame(
MockPsr18Client::class,
- (new DefinitionClassResolver($container))->resolve($container->register(
+ new DefinitionClassResolver($container)->resolve($container->register(
'app.client',
MockPsr18Client::class,
)),
@@ -37,7 +37,7 @@ public function test_resolves_a_class_from_a_direct_parent(): void
static::assertSame(
MockPsr18Client::class,
- (new DefinitionClassResolver($container))->resolve($container->getDefinition('app.client')),
+ new DefinitionClassResolver($container)->resolve($container->getDefinition('app.client')),
);
}
@@ -47,13 +47,13 @@ public function test_resolves_a_class_through_a_multi_level_parent_chain(): void
$container->register('app.grandparent_client', MockPsr18Client::class)->setAbstract(true);
$container->setDefinition(
'app.parent_client',
- (new ChildDefinition('app.grandparent_client'))->setAbstract(true),
+ new ChildDefinition('app.grandparent_client')->setAbstract(true),
);
$container->setDefinition('app.client', new ChildDefinition('app.parent_client'));
static::assertSame(
MockPsr18Client::class,
- (new DefinitionClassResolver($container))->resolve($container->getDefinition('app.client')),
+ new DefinitionClassResolver($container)->resolve($container->getDefinition('app.client')),
);
}
@@ -64,10 +64,7 @@ public function test_resolves_a_class_declared_as_a_parameter(): void
static::assertSame(
MockPsr18Client::class,
- (new DefinitionClassResolver($container))->resolve($container->register(
- 'app.client',
- '%app.client.class%',
- )),
+ new DefinitionClassResolver($container)->resolve($container->register('app.client', '%app.client.class%')),
);
}
@@ -77,7 +74,7 @@ public function test_returns_null_for_a_circular_parent_chain(): void
$container->setDefinition('app.first', new ChildDefinition('app.second'));
$container->setDefinition('app.second', new ChildDefinition('app.first'));
- static::assertNull((new DefinitionClassResolver($container))->resolve($container->getDefinition('app.first')));
+ static::assertNull(new DefinitionClassResolver($container)->resolve($container->getDefinition('app.first')));
}
public function test_returns_null_for_a_definition_that_is_its_own_parent(): void
@@ -85,23 +82,21 @@ public function test_returns_null_for_a_definition_that_is_its_own_parent(): voi
$container = new ContainerBuilder();
$container->setDefinition('app.client', new ChildDefinition('app.client'));
- static::assertNull((new DefinitionClassResolver($container))->resolve($container->getDefinition('app.client')));
+ static::assertNull(new DefinitionClassResolver($container)->resolve($container->getDefinition('app.client')));
}
public function test_returns_null_when_the_parent_service_is_missing(): void
{
$container = new ContainerBuilder();
- static::assertNull((new DefinitionClassResolver($container))->resolve(
- new ChildDefinition('app.does_not_exist'),
- ));
+ static::assertNull(new DefinitionClassResolver($container)->resolve(new ChildDefinition('app.does_not_exist')));
}
public function test_returns_null_when_the_class_does_not_exist(): void
{
$container = new ContainerBuilder();
- static::assertNull((new DefinitionClassResolver($container))->resolve($container->register(
+ static::assertNull(new DefinitionClassResolver($container)->resolve($container->register(
'app.client',
'Flow\Bridge\Symfony\TelemetryBundle\Tests\NoSuchClass',
)));
@@ -111,7 +106,7 @@ public function test_returns_null_when_the_class_parameter_does_not_exist(): voi
{
$container = new ContainerBuilder();
- static::assertNull((new DefinitionClassResolver($container))->resolve($container->register(
+ static::assertNull(new DefinitionClassResolver($container)->resolve($container->register(
'app.client',
'%app.absent.class%',
)));
@@ -122,7 +117,7 @@ public function test_returns_null_when_the_class_parameter_is_not_a_string(): vo
$container = new ContainerBuilder();
$container->setParameter('app.client.class', [MockPsr18Client::class]);
- static::assertNull((new DefinitionClassResolver($container))->resolve($container->register(
+ static::assertNull(new DefinitionClassResolver($container)->resolve($container->register(
'app.client',
'%app.client.class%',
)));
@@ -134,7 +129,7 @@ public function test_resolves_an_interface_declared_as_a_class(): void
static::assertSame(
AdapterInterface::class,
- (new DefinitionClassResolver($container))->resolve($container->register(
+ new DefinitionClassResolver($container)->resolve($container->register(
'cache.adapter.system',
AdapterInterface::class,
)),
@@ -143,6 +138,6 @@ public function test_resolves_an_interface_declared_as_a_class(): void
public function test_returns_null_for_a_definition_without_a_class(): void
{
- static::assertNull((new DefinitionClassResolver(new ContainerBuilder()))->resolve(new Definition()));
+ static::assertNull(new DefinitionClassResolver(new ContainerBuilder())->resolve(new Definition()));
}
}
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/FrameworkLoggerPassTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/FrameworkLoggerPassTest.php
index f51fef63c1..d24b9fb961 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/FrameworkLoggerPassTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/FrameworkLoggerPassTest.php
@@ -20,7 +20,7 @@ public function test_leaves_symfony_logger_untouched_when_telemetry_is_disabled(
$container->setParameter('flow.telemetry.enabled', false);
$container->setDefinition('logger', new Definition(SymfonyDefaultLogger::class));
- (new FrameworkLoggerPass())->process($container);
+ new FrameworkLoggerPass()->process($container);
static::assertFalse($container->hasAlias('logger'));
static::assertSame(SymfonyDefaultLogger::class, $container->getDefinition('logger')->getClass());
@@ -32,7 +32,7 @@ public function test_aliases_symfony_logger_when_telemetry_is_enabled(): void
$container->setParameter('flow.telemetry.enabled', true);
$container->setDefinition('logger', new Definition(SymfonyDefaultLogger::class));
- (new FrameworkLoggerPass())->process($container);
+ new FrameworkLoggerPass()->process($container);
static::assertTrue($container->hasAlias('logger'));
static::assertSame('flow.telemetry.default.logger.psr3', (string) $container->getAlias('logger'));
@@ -44,7 +44,7 @@ public function test_symfony_logger_stays_when_logs_have_no_destination(): void
$container->setParameter('flow.telemetry.logger_provider.has_destination', false);
$container->setDefinition('logger', new Definition(SymfonyDefaultLogger::class));
- (new FrameworkLoggerPass())->process($container);
+ new FrameworkLoggerPass()->process($container);
static::assertFalse($container->hasAlias('logger'));
static::assertSame(SymfonyDefaultLogger::class, $container->getDefinition('logger')->getClass());
@@ -56,7 +56,7 @@ public function test_symfony_logger_is_aliased_when_logs_have_a_destination(): v
$container->setParameter('flow.telemetry.logger_provider.has_destination', true);
$container->setDefinition('logger', new Definition(SymfonyDefaultLogger::class));
- (new FrameworkLoggerPass())->process($container);
+ new FrameworkLoggerPass()->process($container);
static::assertSame('flow.telemetry.default.logger.psr3', (string) $container->getAlias('logger'));
}
@@ -69,7 +69,7 @@ public function test_framework_logger_is_aliased_without_a_destination(): void
$container->setDefinition('logger', new Definition(SymfonyDefaultLogger::class));
$container->setDefinition('flow.telemetry.default.logger.psr3', new Definition(SymfonyDefaultLogger::class));
- (new FrameworkLoggerPass())->process($container);
+ new FrameworkLoggerPass()->process($container);
static::assertSame('flow.telemetry.default.logger.psr3', (string) $container->getAlias('logger'));
}
@@ -79,7 +79,7 @@ public function test_aliases_symfony_logger_when_enabled_parameter_is_absent():
$container = new ContainerBuilder();
$container->setDefinition('logger', new Definition(SymfonyDefaultLogger::class));
- (new FrameworkLoggerPass())->process($container);
+ new FrameworkLoggerPass()->process($container);
static::assertTrue($container->hasAlias('logger'));
}
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/HttpClientTelemetryPassTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/HttpClientTelemetryPassTest.php
index 6a9d2d6b79..98497ba9d0 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/HttpClientTelemetryPassTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/HttpClientTelemetryPassTest.php
@@ -20,7 +20,7 @@ public function test_decorator_receives_url_sanitizer(): void
$container->setParameter('flow.telemetry.http_client.enabled', true);
$container->register('app.http_client', SuccessHttpClient::class)->addTag('http_client.client');
- (new HttpClientTelemetryPass())->process($container);
+ new HttpClientTelemetryPass()->process($container);
static::assertEquals(
new Reference('flow.telemetry.url_sanitizer'),
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/InterfaceAliasRepointerTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/InterfaceAliasRepointerTest.php
index 50fc1dba59..cbba220350 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/InterfaceAliasRepointerTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/InterfaceAliasRepointerTest.php
@@ -8,7 +8,6 @@
use Flow\Bridge\Symfony\TelemetryBundle\Instrumentation\Cache\TraceableCacheAdapter;
use Flow\Bridge\Symfony\TelemetryBundle\Tests\Fixtures\Cache\ArrayCacheAdapter;
use PHPUnit\Framework\Attributes\CoversClass;
-use PHPUnit\Framework\Attributes\RequiresMethod;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -18,14 +17,13 @@
#[CoversClass(InterfaceAliasRepointer::class)]
final class InterfaceAliasRepointerTest extends TestCase
{
- #[RequiresMethod(NamespacedPoolInterface::class, 'withSubNamespace')]
public function test_alias_the_decorator_cannot_satisfy_is_pointed_at_the_inner_service(): void
{
$container = new ContainerBuilder();
$container->register('cache.app', ArrayCacheAdapter::class);
$container->setAlias(NamespacedPoolInterface::class, 'cache.app');
- (new InterfaceAliasRepointer($container))->repoint(
+ new InterfaceAliasRepointer($container)->repoint(
'cache.app',
'cache.app.flow_telemetry.inner',
TraceableCacheAdapter::class,
@@ -43,7 +41,7 @@ public function test_alias_the_decorator_satisfies_is_left_alone(): void
$container->register('cache.app', ArrayCacheAdapter::class);
$container->setAlias(CacheInterface::class, 'cache.app');
- (new InterfaceAliasRepointer($container))->repoint(
+ new InterfaceAliasRepointer($container)->repoint(
'cache.app',
'cache.app.flow_telemetry.inner',
TraceableCacheAdapter::class,
@@ -52,14 +50,13 @@ public function test_alias_the_decorator_satisfies_is_left_alone(): void
static::assertSame('cache.app', (string) $container->getAlias(CacheInterface::class));
}
- #[RequiresMethod(NamespacedPoolInterface::class, 'withSubNamespace')]
public function test_alias_pointing_at_another_service_is_left_alone(): void
{
$container = new ContainerBuilder();
$container->register('cache.other', ArrayCacheAdapter::class);
$container->setAlias(NamespacedPoolInterface::class, 'cache.other');
- (new InterfaceAliasRepointer($container))->repoint(
+ new InterfaceAliasRepointer($container)->repoint(
'cache.app',
'cache.app.flow_telemetry.inner',
TraceableCacheAdapter::class,
@@ -74,7 +71,7 @@ public function test_alias_that_is_not_an_interface_is_left_alone(): void
$container->register('cache.app', ArrayCacheAdapter::class);
$container->setAlias('cache.app.alias', 'cache.app');
- (new InterfaceAliasRepointer($container))->repoint(
+ new InterfaceAliasRepointer($container)->repoint(
'cache.app',
'cache.app.flow_telemetry.inner',
TraceableCacheAdapter::class,
@@ -83,14 +80,13 @@ public function test_alias_that_is_not_an_interface_is_left_alone(): void
static::assertSame('cache.app', (string) $container->getAlias('cache.app.alias'));
}
- #[RequiresMethod(NamespacedPoolInterface::class, 'withSubNamespace')]
public function test_public_visibility_is_preserved(): void
{
$container = new ContainerBuilder();
$container->register('cache.app', ArrayCacheAdapter::class);
$container->setAlias(NamespacedPoolInterface::class, new Alias('cache.app', true));
- (new InterfaceAliasRepointer($container))->repoint(
+ new InterfaceAliasRepointer($container)->repoint(
'cache.app',
'cache.app.flow_telemetry.inner',
TraceableCacheAdapter::class,
@@ -99,14 +95,13 @@ public function test_public_visibility_is_preserved(): void
static::assertTrue($container->getAlias(NamespacedPoolInterface::class)->isPublic());
}
- #[RequiresMethod(NamespacedPoolInterface::class, 'withSubNamespace')]
public function test_private_visibility_is_preserved(): void
{
$container = new ContainerBuilder();
$container->register('cache.app', ArrayCacheAdapter::class);
$container->setAlias(NamespacedPoolInterface::class, new Alias('cache.app', false));
- (new InterfaceAliasRepointer($container))->repoint(
+ new InterfaceAliasRepointer($container)->repoint(
'cache.app',
'cache.app.flow_telemetry.inner',
TraceableCacheAdapter::class,
@@ -115,7 +110,6 @@ public function test_private_visibility_is_preserved(): void
static::assertFalse($container->getAlias(NamespacedPoolInterface::class)->isPublic());
}
- #[RequiresMethod(NamespacedPoolInterface::class, 'withSubNamespace')]
public function test_deprecation_is_preserved(): void
{
$container = new ContainerBuilder();
@@ -126,7 +120,7 @@ public function test_deprecation_is_preserved(): void
'The "%alias_id%" alias is deprecated.',
);
- (new InterfaceAliasRepointer($container))->repoint(
+ new InterfaceAliasRepointer($container)->repoint(
'cache.app',
'cache.app.flow_telemetry.inner',
TraceableCacheAdapter::class,
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/MessengerTelemetryPassTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/MessengerTelemetryPassTest.php
index ada0ee0e3c..da553ba3b5 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/MessengerTelemetryPassTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/MessengerTelemetryPassTest.php
@@ -23,7 +23,7 @@ public function test_prepends_the_tracing_middleware_to_every_bus(): void
$container->setParameter('messenger.bus.default.middleware', [['id' => 'add_bus_name_stamp_middleware']]);
$container->setParameter('messenger.bus.commands.middleware', []);
- (new MessengerTelemetryPass())->process($container);
+ new MessengerTelemetryPass()->process($container);
static::assertSame(
[['id' => 'flow.telemetry.messenger.middleware'], ['id' => 'add_bus_name_stamp_middleware']],
@@ -41,7 +41,7 @@ public function test_is_a_no_op_when_the_middleware_is_not_registered(): void
$container->register('messenger.bus.default')->addTag('messenger.bus');
$container->setParameter('messenger.bus.default.middleware', []);
- (new MessengerTelemetryPass())->process($container);
+ new MessengerTelemetryPass()->process($container);
static::assertSame([], $container->getParameter('messenger.bus.default.middleware'));
}
@@ -52,7 +52,7 @@ public function test_skips_buses_without_a_middleware_parameter(): void
$container->setDefinition('flow.telemetry.messenger.middleware', new Definition(TracingMiddleware::class));
$container->register('messenger.bus.default')->addTag('messenger.bus');
- (new MessengerTelemetryPass())->process($container);
+ new MessengerTelemetryPass()->process($container);
static::assertFalse($container->hasParameter('messenger.bus.default.middleware'));
}
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/OTLPAvailabilityPassTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/OTLPAvailabilityPassTest.php
index 58a417a5c1..b70f2d620f 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/OTLPAvailabilityPassTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/OTLPAvailabilityPassTest.php
@@ -17,7 +17,7 @@ public function test_does_not_set_otlp_available_when_telemetry_is_disabled(): v
$container = new ContainerBuilder();
$container->setParameter('flow.telemetry.enabled', false);
- (new OTLPAvailabilityPass())->process($container);
+ new OTLPAvailabilityPass()->process($container);
static::assertFalse($container->hasParameter('flow.telemetry.otlp_available'));
}
@@ -27,7 +27,7 @@ public function test_sets_otlp_available_when_telemetry_is_enabled(): void
$container = new ContainerBuilder();
$container->setParameter('flow.telemetry.enabled', true);
- (new OTLPAvailabilityPass())->process($container);
+ new OTLPAvailabilityPass()->process($container);
static::assertTrue($container->hasParameter('flow.telemetry.otlp_available'));
}
@@ -36,7 +36,7 @@ public function test_sets_otlp_available_when_enabled_parameter_is_absent(): voi
{
$container = new ContainerBuilder();
- (new OTLPAvailabilityPass())->process($container);
+ new OTLPAvailabilityPass()->process($container);
static::assertTrue($container->hasParameter('flow.telemetry.otlp_available'));
}
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ProfilerSignalCapturePassTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ProfilerSignalCapturePassTest.php
index fe1dfba93f..4fd956ac3a 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ProfilerSignalCapturePassTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ProfilerSignalCapturePassTest.php
@@ -21,7 +21,7 @@ public function test_no_op_when_parameter_absent(): void
$container = new ContainerBuilder();
$container->setDefinition('flow.telemetry.exporter.primary', new Definition(VoidExporter::class));
- (new ProfilerSignalCapturePass())->process($container);
+ new ProfilerSignalCapturePass()->process($container);
static::assertFalse($container->hasDefinition('flow.telemetry.exporter.primary.profiler_tee'));
}
@@ -31,7 +31,7 @@ public function test_no_op_when_captured_list_empty(): void
$container = new ContainerBuilder();
$container->setParameter('flow.telemetry.profiler.captured_exporters', []);
- (new ProfilerSignalCapturePass())->process($container);
+ new ProfilerSignalCapturePass()->process($container);
static::assertFalse($container->hasDefinition('flow.telemetry.exporter.primary.profiler_tee'));
}
@@ -42,7 +42,7 @@ public function test_decorates_captured_exporter_into_a_composite(): void
$container->setDefinition('flow.telemetry.exporter.primary', new Definition(VoidExporter::class));
$container->setParameter('flow.telemetry.profiler.captured_exporters', ['flow.telemetry.exporter.primary']);
- (new ProfilerSignalCapturePass())->process($container);
+ new ProfilerSignalCapturePass()->process($container);
$decorator = $container->getDefinition('flow.telemetry.exporter.primary.profiler_tee');
static::assertSame(CompositeExporter::class, $decorator->getClass());
@@ -60,7 +60,7 @@ public function test_throws_when_captured_exporter_is_an_alias(): void
$this->expectException(RuntimeException::class);
- (new ProfilerSignalCapturePass())->process($container);
+ new ProfilerSignalCapturePass()->process($container);
}
public function test_throws_when_captured_exporter_is_not_defined(): void
@@ -70,6 +70,6 @@ public function test_throws_when_captured_exporter_is_not_defined(): void
$this->expectException(RuntimeException::class);
- (new ProfilerSignalCapturePass())->process($container);
+ new ProfilerSignalCapturePass()->process($container);
}
}
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/Psr18ClientTelemetryPassTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/Psr18ClientTelemetryPassTest.php
index e328fdaca7..3f77228745 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/Psr18ClientTelemetryPassTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/Psr18ClientTelemetryPassTest.php
@@ -44,7 +44,7 @@ public function test_child_of_an_abstract_psr18_parent_compiles_and_is_traced():
$container->register(Telemetry::class)->setSynthetic(true);
$container->register('flow.telemetry.url_sanitizer', UrlSanitizer::class);
$container->register('app.base_client', MockPsr18Client::class)->setAbstract(true);
- $container->setDefinition('app.child_client', (new ChildDefinition('app.base_client'))->setPublic(true));
+ $container->setDefinition('app.child_client', new ChildDefinition('app.base_client')->setPublic(true));
$container->addCompilerPass(new Psr18ClientTelemetryPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION);
$container->compile();
@@ -87,7 +87,7 @@ public function test_decorator_receives_url_sanitizer(): void
$container->setParameter('flow.telemetry.psr18_client.enabled', true);
$container->register('psr18.http_client', MockPsr18Client::class);
- (new Psr18ClientTelemetryPass())->process($container);
+ new Psr18ClientTelemetryPass()->process($container);
static::assertEquals(
new Reference('flow.telemetry.url_sanitizer'),
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ServiceIdPatternsTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ServiceIdPatternsTest.php
index 1d8e800bcc..a03102587a 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ServiceIdPatternsTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ServiceIdPatternsTest.php
@@ -28,7 +28,7 @@ public function test_matching_a_service_id_against_patterns(
string $serviceId,
bool $expected,
): void {
- static::assertSame($expected, (new ServiceIdPatterns($patterns))->matches($serviceId));
+ static::assertSame($expected, new ServiceIdPatterns($patterns)->matches($serviceId));
}
#[TestWith(['[unterminated'])]
@@ -36,7 +36,7 @@ public function test_matching_a_service_id_against_patterns(
#[TestWith(['cache.system'])]
public function test_an_invalid_regular_expression_is_compared_as_an_exact_service_id(string $pattern): void
{
- static::assertTrue((new ServiceIdPatterns([$pattern]))->matches($pattern));
- static::assertFalse((new ServiceIdPatterns([$pattern]))->matches('some.other.service'));
+ static::assertTrue(new ServiceIdPatterns([$pattern])->matches($pattern));
+ static::assertFalse(new ServiceIdPatterns([$pattern])->matches('some.other.service'));
}
}
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/TraceContextUrlGeneratorPassTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/TraceContextUrlGeneratorPassTest.php
index d73da6d020..68a7e4bcd1 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/TraceContextUrlGeneratorPassTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/TraceContextUrlGeneratorPassTest.php
@@ -18,7 +18,7 @@ public function test_does_nothing_when_generator_definition_is_absent(): void
{
$container = new ContainerBuilder();
- (new TraceContextUrlGeneratorPass())->process($container);
+ new TraceContextUrlGeneratorPass()->process($container);
static::assertFalse($container->hasDefinition('flow.telemetry.trace_context_url_generator'));
}
@@ -29,7 +29,7 @@ public function test_keeps_generator_when_router_is_present(): void
$container->register('flow.telemetry.trace_context_url_generator', stdClass::class);
$container->register('router', stdClass::class);
- (new TraceContextUrlGeneratorPass())->process($container);
+ new TraceContextUrlGeneratorPass()->process($container);
static::assertTrue($container->hasDefinition('flow.telemetry.trace_context_url_generator'));
}
@@ -40,7 +40,7 @@ public function test_removes_generator_when_router_is_absent(): void
$container->register('flow.telemetry.trace_context_url_generator', stdClass::class);
$container->setAlias(TraceContextUrlGenerator::class, 'flow.telemetry.trace_context_url_generator');
- (new TraceContextUrlGeneratorPass())->process($container);
+ new TraceContextUrlGeneratorPass()->process($container);
static::assertFalse($container->hasDefinition('flow.telemetry.trace_context_url_generator'));
}
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Cache/CacheDeferredFlushSubscriberTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Cache/CacheDeferredFlushSubscriberTest.php
index 998af4f1c0..086a12f82b 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Cache/CacheDeferredFlushSubscriberTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Cache/CacheDeferredFlushSubscriberTest.php
@@ -38,7 +38,7 @@ public function test_it_commits_deferred_writes_of_every_pool(): void
$itemB->set('value');
$poolB->saveDeferred($itemB);
- (new CacheDeferredFlushSubscriber([$poolA, $poolB], $telemetry))->onFlush(new stdClass());
+ new CacheDeferredFlushSubscriber([$poolA, $poolB], $telemetry)->onFlush(new stdClass());
static::assertTrue($poolA->hasItem('a'));
static::assertTrue($poolB->hasItem('b'));
@@ -49,7 +49,7 @@ public function test_it_wraps_the_flush_in_a_single_cache_flush_span(): void
$processor = new MemorySpanProcessor(new MemoryExporter());
$telemetry = TelemetryMother::withSpanProcessor($processor);
- (new CacheDeferredFlushSubscriber([new ArrayCacheAdapter()], $telemetry))->onFlush(new stdClass());
+ new CacheDeferredFlushSubscriber([new ArrayCacheAdapter()], $telemetry)->onFlush(new stdClass());
$spans = $processor->endedSpans();
static::assertCount(1, $spans);
@@ -66,7 +66,7 @@ public function test_pool_writes_are_nested_under_the_flush_span(): void
$item->set('value');
$pool->saveDeferred($item);
- (new CacheDeferredFlushSubscriber([$pool], $telemetry))->onFlush(new stdClass());
+ new CacheDeferredFlushSubscriber([$pool], $telemetry)->onFlush(new stdClass());
$byName = [];
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Console/CommandExclusionRuleTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Console/CommandExclusionRuleTest.php
index 743e6ff029..38af449c16 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Console/CommandExclusionRuleTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Console/CommandExclusionRuleTest.php
@@ -22,6 +22,6 @@ final class CommandExclusionRuleTest extends TestCase
#[TestWith(['/^messenger:consume$/', 'messenger:consume-failed', false])]
public function test_matches(string $pattern, string $commandName, bool $expected): void
{
- static::assertSame($expected, (new CommandExclusionRule($pattern))->matches($commandName));
+ static::assertSame($expected, new CommandExclusionRule($pattern)->matches($commandName));
}
}
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Console/ConsoleAttributesTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Console/ConsoleAttributesTest.php
index 1756121d0e..fc9abe0981 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Console/ConsoleAttributesTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Console/ConsoleAttributesTest.php
@@ -13,7 +13,7 @@ final class ConsoleAttributesTest extends TestCase
public function test_all_custom_keys_use_the_flow_prefix(): void
{
// @mago-expect analysis:mixed-assignment
- foreach ((new ReflectionClass(ConsoleAttributes::class))->getConstants() as $name => $value) {
+ foreach (new ReflectionClass(ConsoleAttributes::class)->getConstants() as $name => $value) {
static::assertIsString($value);
static::assertStringStartsWith(
'flow.symfony.',
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Console/ConsoleLogOutputSubscriberTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Console/ConsoleLogOutputSubscriberTest.php
index 865c497c86..ec0154f278 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Console/ConsoleLogOutputSubscriberTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Console/ConsoleLogOutputSubscriberTest.php
@@ -26,7 +26,7 @@ public function test_on_command_pushes_the_output_into_the_processor(): void
$processor = new ConsoleOutputLogProcessor(ConsoleVerbosityLevels::default());
$output = new BufferedOutput();
- (new ConsoleLogOutputSubscriber($processor))->onCommand(
+ new ConsoleLogOutputSubscriber($processor)->onCommand(
new ConsoleCommandEvent(new Command('t'), new ArrayInput([]), $output),
);
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Doctrine/DBAL/DbAttributesTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Doctrine/DBAL/DbAttributesTest.php
index bc01a53f12..17f0503d5d 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Doctrine/DBAL/DbAttributesTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Doctrine/DBAL/DbAttributesTest.php
@@ -13,7 +13,7 @@ final class DbAttributesTest extends TestCase
public function test_all_custom_keys_use_the_flow_prefix(): void
{
// @mago-expect analysis:mixed-assignment
- foreach ((new ReflectionClass(DbAttributes::class))->getConstants() as $name => $value) {
+ foreach (new ReflectionClass(DbAttributes::class)->getConstants() as $name => $value) {
static::assertIsString($value);
static::assertStringStartsWith(
'flow.db.',
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Doctrine/DBAL/ParameterFormatterTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Doctrine/DBAL/ParameterFormatterTest.php
index f1a621c355..8bbadd47fd 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Doctrine/DBAL/ParameterFormatterTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Doctrine/DBAL/ParameterFormatterTest.php
@@ -14,7 +14,7 @@ final class ParameterFormatterTest extends TestCase
{
public function test_formats_scalars_null_and_bool(): void
{
- $formatted = (new ParameterFormatter())->format([42, null, true, 'x'], 10, 100);
+ $formatted = new ParameterFormatter()->format([42, null, true, 'x'], 10, 100);
static::assertSame(
[
@@ -29,14 +29,14 @@ public function test_formats_scalars_null_and_bool(): void
public function test_formats_named_parameters(): void
{
- $formatted = (new ParameterFormatter())->format(['name' => 'John'], 10, 100);
+ $formatted = new ParameterFormatter()->format(['name' => 'John'], 10, 100);
static::assertSame(['db.query.parameter.name' => 'John'], $formatted);
}
public function test_caps_number_of_parameters(): void
{
- $formatted = (new ParameterFormatter())->format([1, 2, 3, 4], 2, 100);
+ $formatted = new ParameterFormatter()->format([1, 2, 3, 4], 2, 100);
static::assertSame(
[
@@ -49,33 +49,33 @@ public function test_caps_number_of_parameters(): void
public function test_truncates_long_values(): void
{
- $formatted = (new ParameterFormatter())->format(['abcdefghij'], 10, 4);
+ $formatted = new ParameterFormatter()->format(['abcdefghij'], 10, 4);
static::assertSame(['db.query.parameter.0' => 'abcd...'], $formatted);
}
public function test_returns_empty_for_no_parameters(): void
{
- static::assertSame([], (new ParameterFormatter())->format([], 10, 100));
+ static::assertSame([], new ParameterFormatter()->format([], 10, 100));
}
public function test_does_not_truncate_when_max_length_is_zero(): void
{
- $formatted = (new ParameterFormatter())->format(['abcdefghij'], 10, 0);
+ $formatted = new ParameterFormatter()->format(['abcdefghij'], 10, 0);
static::assertSame(['db.query.parameter.0' => 'abcdefghij'], $formatted);
}
public function test_formats_datetime(): void
{
- $formatted = (new ParameterFormatter())->format([new DateTimeImmutable('2026-01-01T00:00:00+00:00')], 10, 100);
+ $formatted = new ParameterFormatter()->format([new DateTimeImmutable('2026-01-01T00:00:00+00:00')], 10, 100);
static::assertSame(['db.query.parameter.0' => '2026-01-01T00:00:00+00:00'], $formatted);
}
public function test_formats_arrays_as_json(): void
{
- $formatted = (new ParameterFormatter())->format([['a' => 1]], 10, 100);
+ $formatted = new ParameterFormatter()->format([['a' => 1]], 10, 100);
static::assertSame(['db.query.parameter.0' => '{"a":1}'], $formatted);
}
@@ -89,7 +89,7 @@ public function __toString(): string
}
};
- $formatted = (new ParameterFormatter())->format([$stringable], 10, 100);
+ $formatted = new ParameterFormatter()->format([$stringable], 10, 100);
static::assertSame(['db.query.parameter.0' => 'stringable'], $formatted);
}
@@ -100,7 +100,7 @@ public function test_formats_plain_objects_as_json(): void
public int $id = 7;
};
- $formatted = (new ParameterFormatter())->format([$object], 10, 100);
+ $formatted = new ParameterFormatter()->format([$object], 10, 100);
static::assertSame(['db.query.parameter.0' => '{"id":7}'], $formatted);
}
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Doctrine/DBAL/SqlAttributesExtractorTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Doctrine/DBAL/SqlAttributesExtractorTest.php
index ad3d0652f7..4f4fb53298 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Doctrine/DBAL/SqlAttributesExtractorTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Doctrine/DBAL/SqlAttributesExtractorTest.php
@@ -23,7 +23,7 @@ final class SqlAttributesExtractorTest extends TestCase
#[TestWith(['not a real sql statement', null, null])]
public function test_extract(string $sql, ?string $operation, ?string $collection): void
{
- $attributes = (new SqlAttributesExtractor())->extract($sql);
+ $attributes = new SqlAttributesExtractor()->extract($sql);
static::assertSame($operation, $attributes->operation);
static::assertSame($collection, $attributes->collection);
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Doctrine/DBAL/TracingDriverTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Doctrine/DBAL/TracingDriverTest.php
index f4c1a03105..b8efdb614f 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Doctrine/DBAL/TracingDriverTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Doctrine/DBAL/TracingDriverTest.php
@@ -12,7 +12,7 @@
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\DB2Platform;
use Doctrine\DBAL\Platforms\MariaDBPlatform;
-use Doctrine\DBAL\Platforms\MySQL80Platform;
+use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\OraclePlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Platforms\SQLitePlatform;
@@ -103,8 +103,7 @@ public function test_get_semantic_db_system_detects_mysql(): void
$spanProcessor = new MemorySpanProcessor(new MemoryExporter());
$telemetry = TelemetryMother::withSpanProcessor($spanProcessor);
- // @mago-expect analysis:deprecated-class
- $platform = new MySQL80Platform();
+ $platform = new MySQLPlatform();
$driver = $this->createMockDriverWithPlatform($platform);
$tracingDriver = new TracingDriver($telemetry, $driver, 'default', maxSqlLength: 100);
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpClient/HttpClientAttributesTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpClient/HttpClientAttributesTest.php
index c319769a50..1f650d47e8 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpClient/HttpClientAttributesTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpClient/HttpClientAttributesTest.php
@@ -13,7 +13,7 @@ final class HttpClientAttributesTest extends TestCase
public function test_all_custom_keys_use_the_flow_prefix(): void
{
// @mago-expect analysis:mixed-assignment
- foreach ((new ReflectionClass(HttpClientAttributes::class))->getConstants() as $name => $value) {
+ foreach (new ReflectionClass(HttpClientAttributes::class)->getConstants() as $name => $value) {
static::assertIsString($value);
static::assertStringStartsWith(
'flow.http.',
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpKernel/HttpKernelAttributesTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpKernel/HttpKernelAttributesTest.php
index 28eb79584c..956c301958 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpKernel/HttpKernelAttributesTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpKernel/HttpKernelAttributesTest.php
@@ -13,7 +13,7 @@ final class HttpKernelAttributesTest extends TestCase
public function test_all_custom_keys_use_the_flow_prefix(): void
{
// @mago-expect analysis:mixed-assignment
- foreach ((new ReflectionClass(HttpKernelAttributes::class))->getConstants() as $name => $value) {
+ foreach (new ReflectionClass(HttpKernelAttributes::class)->getConstants() as $name => $value) {
static::assertIsString($value);
static::assertStringStartsWith(
'flow.symfony.',
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpKernel/RouteNamePathMapTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpKernel/RouteNamePathMapTest.php
index c715742b43..9d43c9a8a5 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpKernel/RouteNamePathMapTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpKernel/RouteNamePathMapTest.php
@@ -35,7 +35,7 @@ public function test_path_for_degrades_to_null_when_the_map_cannot_be_written():
static::assertNull($map->pathFor('order_show'));
static::assertNull($map->pathFor('order_show'));
- static::assertNull((new RouteNamePathMap($router, $directory, false))->pathFor('order_show'));
+ static::assertNull(new RouteNamePathMap($router, $directory, false)->pathFor('order_show'));
static::assertSame(0, $router->getRouteCollectionCalls);
});
}
@@ -46,7 +46,7 @@ public function test_path_for_does_not_touch_the_router_once_the_map_is_written(
$routes = new RouteCollection();
$routes->add('order_show', new Route('/orders/{id}'));
- (new RouteNamePathMap(new FakeRouter($routes), $directory, false))->warmUp('');
+ new RouteNamePathMap(new FakeRouter($routes), $directory, false)->warmUp('');
$router = new FakeRouter($routes);
$map = new RouteNamePathMap($router, $directory, false);
@@ -101,7 +101,7 @@ public function test_stale_map_is_rebuilt_in_debug_when_route_resources_change()
$router = new FakeRouter($routes);
- (new RouteNamePathMap($router, $directory, true))->warmUp('');
+ new RouteNamePathMap($router, $directory, true)->warmUp('');
$changedRoutes = new RouteCollection();
$changedRoutes->add('order_show', new Route('/purchases/{id}'));
@@ -111,7 +111,7 @@ public function test_stale_map_is_rebuilt_in_debug_when_route_resources_change()
static::assertSame(
'/purchases/{id}',
- (new RouteNamePathMap($router, $directory, true))->pathFor('order_show'),
+ new RouteNamePathMap($router, $directory, true)->pathFor('order_show'),
);
});
}
@@ -122,7 +122,7 @@ public function test_warm_up_returns_the_map_file_for_preloading(): void
$routes = new RouteCollection();
$routes->add('order_show', new Route('/orders/{id}'));
- $preload = (new RouteNamePathMap(new FakeRouter($routes), $directory, false))->warmUp('');
+ $preload = new RouteNamePathMap(new FakeRouter($routes), $directory, false)->warmUp('');
static::assertSame([$directory . '/flow_telemetry_route_paths.php'], $preload);
static::assertFileExists($directory . '/flow_telemetry_route_paths.php');
@@ -142,7 +142,7 @@ public function test_warm_up_without_router_writes_nothing(): void
public function test_warmer_is_optional(): void
{
TempDirectoryContext::with(static function (string $directory): void {
- static::assertTrue((new RouteNamePathMap(null, $directory, false))->isOptional());
+ static::assertTrue(new RouteNamePathMap(null, $directory, false)->isOptional());
});
}
}
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpKernel/TracingArgumentResolverTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpKernel/TracingArgumentResolverTest.php
index de6778bd70..adaf21bb78 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpKernel/TracingArgumentResolverTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpKernel/TracingArgumentResolverTest.php
@@ -41,10 +41,7 @@ public function test_traces_argument_resolution_when_request_span_present(): voi
$request = new Request();
$request->attributes->set(HttpKernelSpanSubscriber::SPAN_ATTRIBUTE, $requestSpan);
- $arguments = (new TracingArgumentResolver($inner, $telemetry))->getArguments(
- $request,
- static fn(): null => null,
- );
+ $arguments = new TracingArgumentResolver($inner, $telemetry)->getArguments($request, static fn(): null => null);
static::assertSame(['a', 'b'], $arguments);
@@ -63,7 +60,7 @@ public function test_passes_through_when_request_span_absent(): void
$inner = $this->createStub(ArgumentResolverInterface::class);
$inner->method('getArguments')->willReturn(['a']);
- $arguments = (new TracingArgumentResolver($inner, $telemetry))->getArguments(
+ $arguments = new TracingArgumentResolver($inner, $telemetry)->getArguments(
new Request(),
static fn(): null => null,
);
@@ -96,7 +93,7 @@ public function test_records_exception_when_inner_resolver_fails(): void
$caught = false;
try {
- (new TracingArgumentResolver($inner, $telemetry))->getArguments($request, static fn(): null => null);
+ new TracingArgumentResolver($inner, $telemetry)->getArguments($request, static fn(): null => null);
} catch (RuntimeException) {
$caught = true;
}
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpKernel/TracingControllerResolverTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpKernel/TracingControllerResolverTest.php
index cb4aea6b38..8935aef1f0 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpKernel/TracingControllerResolverTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpKernel/TracingControllerResolverTest.php
@@ -42,7 +42,7 @@ public function test_traces_resolution_when_request_span_present(): void
$request = new Request();
$request->attributes->set(HttpKernelSpanSubscriber::SPAN_ATTRIBUTE, $requestSpan);
- static::assertSame($controller, (new TracingControllerResolver($inner, $telemetry))->getController($request));
+ static::assertSame($controller, new TracingControllerResolver($inner, $telemetry)->getController($request));
$spans = $spanProcessor->endedSpans();
static::assertCount(1, $spans);
@@ -62,7 +62,7 @@ public function test_passes_through_when_request_span_absent(): void
static::assertSame(
$controller,
- (new TracingControllerResolver($inner, $telemetry))->getController(new Request()),
+ new TracingControllerResolver($inner, $telemetry)->getController(new Request()),
);
static::assertCount(0, $spanProcessor->endedSpans());
}
@@ -91,7 +91,7 @@ public function test_records_exception_when_inner_resolver_fails(): void
$caught = false;
try {
- (new TracingControllerResolver($inner, $telemetry))->getController($request);
+ new TracingControllerResolver($inner, $telemetry)->getController($request);
} catch (RuntimeException) {
$caught = true;
}
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpKernel/TracingValueResolverTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpKernel/TracingValueResolverTest.php
index bed2408b01..d1096a333c 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpKernel/TracingValueResolverTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/HttpKernel/TracingValueResolverTest.php
@@ -45,7 +45,7 @@ public function test_traces_value_resolution_when_request_span_present(): void
$request->attributes->set(HttpKernelSpanSubscriber::SPAN_ATTRIBUTE, $requestSpan);
$argument = new ArgumentMetadata('id', 'int', false, false, null);
- $resolved = iterator_to_array((new TracingValueResolver($inner, $telemetry))->resolve($request, $argument));
+ $resolved = iterator_to_array(new TracingValueResolver($inner, $telemetry)->resolve($request, $argument));
static::assertSame(['resolved'], $resolved);
@@ -66,7 +66,7 @@ public function test_passes_through_when_request_span_absent(): void
$inner = $this->createStub(ValueResolverInterface::class);
$inner->method('resolve')->willReturn(['resolved']);
- $resolved = iterator_to_array((new TracingValueResolver($inner, $telemetry))->resolve(
+ $resolved = iterator_to_array(new TracingValueResolver($inner, $telemetry)->resolve(
new Request(),
new ArgumentMetadata('id', 'int', false, false, null),
));
@@ -100,7 +100,7 @@ public function test_records_exception_when_inner_resolver_fails(): void
$caught = false;
try {
- iterator_to_array((new TracingValueResolver($inner, $telemetry))->resolve($request, $argument));
+ iterator_to_array(new TracingValueResolver($inner, $telemetry)->resolve($request, $argument));
} catch (RuntimeException) {
$caught = true;
}
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Messenger/AsyncCurlTransportTickSubscriberTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Messenger/AsyncCurlTransportTickSubscriberTest.php
index ad6a90588f..fbc0fa3600 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Messenger/AsyncCurlTransportTickSubscriberTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Messenger/AsyncCurlTransportTickSubscriberTest.php
@@ -45,7 +45,7 @@ public function dispatch(object $message, array $stamps = []): Envelope
}
};
- (new AsyncCurlTransportTickSubscriber($transports))->onWorkerRunning(
+ new AsyncCurlTransportTickSubscriber($transports)->onWorkerRunning(
new WorkerRunningEvent(new Worker([], $bus), false),
);
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Messenger/MessengerAttributesTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Messenger/MessengerAttributesTest.php
index c2c8267e06..00b2d3e0d5 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Messenger/MessengerAttributesTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Messenger/MessengerAttributesTest.php
@@ -13,7 +13,7 @@ final class MessengerAttributesTest extends TestCase
public function test_all_custom_keys_use_the_flow_prefix(): void
{
// @mago-expect analysis:mixed-assignment
- foreach ((new ReflectionClass(MessengerAttributes::class))->getConstants() as $name => $value) {
+ foreach (new ReflectionClass(MessengerAttributes::class)->getConstants() as $name => $value) {
static::assertIsString($value);
static::assertStringStartsWith(
'flow.messenger.',
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Messenger/MessengerFlushSubscriberTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Messenger/MessengerFlushSubscriberTest.php
index 99dc4e2ee6..b01acb9101 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Messenger/MessengerFlushSubscriberTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Messenger/MessengerFlushSubscriberTest.php
@@ -28,7 +28,7 @@ public function test_flush_on_handled_exports_buffered_span(): void
static::assertCount(0, $exporter->spans());
- (new MessengerFlushSubscriber($telemetry))->onMessageHandled(
+ new MessengerFlushSubscriber($telemetry)->onMessageHandled(
new WorkerMessageHandledEvent(new Envelope(new stdClass()), 'receiver'),
);
@@ -60,7 +60,7 @@ public function test_flush_on_failed_exports_buffered_span(): void
static::assertCount(0, $exporter->spans());
- (new MessengerFlushSubscriber($telemetry))->onMessageFailed(
+ new MessengerFlushSubscriber($telemetry)->onMessageFailed(
new WorkerMessageFailedEvent(new Envelope(new stdClass()), 'receiver', new RuntimeException('boom')),
);
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Logger/ConsoleOutputLogProcessorTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Logger/ConsoleOutputLogProcessorTest.php
index 365704b246..01d777abea 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Logger/ConsoleOutputLogProcessorTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Logger/ConsoleOutputLogProcessorTest.php
@@ -29,7 +29,7 @@ public function test_debug_verbosity_writes_debug(): void
public function test_flush_is_a_noop_returning_true(): void
{
- static::assertTrue((new ConsoleOutputLogProcessor(ConsoleVerbosityLevels::default()))->flush());
+ static::assertTrue(new ConsoleOutputLogProcessor(ConsoleVerbosityLevels::default())->flush());
}
public function test_includes_attributes(): void
diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Propagation/TraceContextProviderTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Propagation/TraceContextProviderTest.php
index 398220b593..58b59c950a 100644
--- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Propagation/TraceContextProviderTest.php
+++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Propagation/TraceContextProviderTest.php
@@ -39,11 +39,11 @@ public function test_current_emits_the_request_span_traceparent(): void
$requestStack = new RequestStack();
$requestStack->push($request);
- $context = (new TraceContextProvider(
+ $context = new TraceContextProvider(
new W3CTraceContext(),
new MemoryContextStorage(),
$requestStack,
- ))->current();
+ )->current();
static::assertArrayHasKey('traceparent', $context);
static::assertStringStartsWith('00-' . self::TRACE_ID . '-' . self::SPAN_ID . '-', $context['traceparent']);
@@ -64,7 +64,7 @@ public function test_traceparent_returns_the_request_span_w3c_value(): void
static::assertStringStartsWith(
'00-' . self::TRACE_ID . '-' . self::SPAN_ID . '-',
- (new TraceContextProvider(new W3CTraceContext(), new MemoryContextStorage(), $requestStack))->traceparent(),
+ new TraceContextProvider(new W3CTraceContext(), new MemoryContextStorage(), $requestStack)->traceparent(),
);
}
@@ -82,12 +82,12 @@ public function test_request_span_wins_over_the_active_inner_span(): void
$requestStack->push($request);
$storage = new MemoryContextStorage();
- $storage->attach((new Context())->withActiveSpan(SpanContext::create(
+ $storage->attach(new Context()->withActiveSpan(SpanContext::create(
TraceId::fromHex(self::TRACE_ID),
SpanId::fromHex('aaaaaaaaaaaaaaaa'),
)));
- $context = (new TraceContextProvider(new W3CTraceContext(), $storage, $requestStack))->current();
+ $context = new TraceContextProvider(new W3CTraceContext(), $storage, $requestStack)->current();
static::assertStringStartsWith('00-' . self::TRACE_ID . '-' . self::SPAN_ID . '-', $context['traceparent']);
static::assertStringNotContainsString('aaaaaaaaaaaaaaaa', $context['traceparent']);
@@ -106,11 +106,9 @@ public function test_append_to_url_adds_request_context_to_a_plain_url(): void
$requestStack = new RequestStack();
$requestStack->push($request);
- $url = (new TraceContextProvider(
- new W3CTraceContext(),
- new MemoryContextStorage(),
- $requestStack,
- ))->appendToUrl('/next');
+ $url = new TraceContextProvider(new W3CTraceContext(), new MemoryContextStorage(), $requestStack)->appendToUrl(
+ '/next',
+ );
static::assertStringStartsWith('/next?traceparent=00-' . self::TRACE_ID, $url);
}
@@ -128,11 +126,9 @@ public function test_append_to_url_uses_ampersand_when_a_query_already_exists():
$requestStack = new RequestStack();
$requestStack->push($request);
- $url = (new TraceContextProvider(
- new W3CTraceContext(),
- new MemoryContextStorage(),
- $requestStack,
- ))->appendToUrl('/next?page=2');
+ $url = new TraceContextProvider(new W3CTraceContext(), new MemoryContextStorage(), $requestStack)->appendToUrl(
+ '/next?page=2',
+ );
static::assertStringContainsString('page=2&traceparent=00-' . self::TRACE_ID, $url);
}
diff --git a/src/bridge/telemetry/otlp/composer.json b/src/bridge/telemetry/otlp/composer.json
index f2867c6da1..45fabaddb5 100644
--- a/src/bridge/telemetry/otlp/composer.json
+++ b/src/bridge/telemetry/otlp/composer.json
@@ -15,7 +15,7 @@
"homepage": "https://github.com/flow-php/flow",
"license": "MIT",
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"flow-php/telemetry": "self.version"
},
"require-dev": {
@@ -25,7 +25,7 @@
"nyholm/psr7": "^1.8",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0",
- "symfony/http-client": "^6.4 || ^7.4 || ^8.0"
+ "symfony/http-client": "^7.4 || ^8.0"
},
"suggest": {
"ext-grpc": "Required for gRPC transport",
diff --git a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Exporter/OTLPExporterTest.php b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Exporter/OTLPExporterTest.php
index f4e881237c..3b7b952079 100644
--- a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Exporter/OTLPExporterTest.php
+++ b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Exporter/OTLPExporterTest.php
@@ -66,7 +66,7 @@ public function test_export_logs_calls_transport(): void
$transport = new RecordingTransport();
$exporter = new OTLPExporter($transport);
$entry = new LogEntry(
- (new LogRecord())
+ new LogRecord()
->setSeverity(Severity::INFO)
->setBody('hello'),
ResourceMother::default(),
diff --git a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/AsyncCurlTransportOptionsTest.php b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/AsyncCurlTransportOptionsTest.php
index 21b5e7d741..f7c24cd917 100644
--- a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/AsyncCurlTransportOptionsTest.php
+++ b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/AsyncCurlTransportOptionsTest.php
@@ -63,14 +63,14 @@ public function test_default_shutdown_timeout(): void
public function test_with_pump_timeout(): void
{
- $options = (new AsyncCurlTransportOptions())->withPumpTimeout(250);
+ $options = new AsyncCurlTransportOptions()->withPumpTimeout(250);
static::assertSame(250, $options->pumpTimeoutMs());
}
public function test_with_pump_timeout_accepts_zero(): void
{
- $options = (new AsyncCurlTransportOptions())->withPumpTimeout(0);
+ $options = new AsyncCurlTransportOptions()->withPumpTimeout(0);
static::assertSame(0, $options->pumpTimeoutMs());
}
@@ -80,7 +80,7 @@ public function test_with_pump_timeout_rejects_negative_value(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Pump timeout must be non-negative');
- (new AsyncCurlTransportOptions())->withPumpTimeout(-1);
+ new AsyncCurlTransportOptions()->withPumpTimeout(-1);
}
public function test_dsl_function_creates_options(): void
@@ -140,7 +140,7 @@ public function test_to_curl_options_basic(): void
public function test_to_curl_options_with_all_settings(): void
{
- $options = (new AsyncCurlTransportOptions())
+ $options = new AsyncCurlTransportOptions()
->withTimeout(2000)
->withConnectTimeout(500)
->withSslVerification(false, false)
@@ -164,14 +164,14 @@ public function test_to_curl_options_with_all_settings(): void
public function test_with_ca_info(): void
{
- $options = (new AsyncCurlTransportOptions())->withCaInfo('/path/to/ca-bundle.crt');
+ $options = new AsyncCurlTransportOptions()->withCaInfo('/path/to/ca-bundle.crt');
static::assertSame('/path/to/ca-bundle.crt', $options->caInfoPath());
}
public function test_with_compression_disabled(): void
{
- $options = (new AsyncCurlTransportOptions())
+ $options = new AsyncCurlTransportOptions()
->withCompression(true)
->withCompression(false);
@@ -180,14 +180,14 @@ public function test_with_compression_disabled(): void
public function test_with_compression_enabled(): void
{
- $options = (new AsyncCurlTransportOptions())->withCompression();
+ $options = new AsyncCurlTransportOptions()->withCompression();
static::assertTrue($options->compression());
}
public function test_with_connect_timeout(): void
{
- $options = (new AsyncCurlTransportOptions())->withConnectTimeout(750);
+ $options = new AsyncCurlTransportOptions()->withConnectTimeout(750);
static::assertSame(750, $options->connectTimeoutMs());
}
@@ -197,19 +197,19 @@ public function test_with_connect_timeout_rejects_negative_value(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Connect timeout must be non-negative');
- (new AsyncCurlTransportOptions())->withConnectTimeout(-1);
+ new AsyncCurlTransportOptions()->withConnectTimeout(-1);
}
public function test_with_follow_redirects_disabled(): void
{
- $options = (new AsyncCurlTransportOptions())->withFollowRedirects(false);
+ $options = new AsyncCurlTransportOptions()->withFollowRedirects(false);
static::assertFalse($options->followRedirects());
}
public function test_with_follow_redirects_enabled(): void
{
- $options = (new AsyncCurlTransportOptions())->withFollowRedirects(true, 5);
+ $options = new AsyncCurlTransportOptions()->withFollowRedirects(true, 5);
static::assertTrue($options->followRedirects());
static::assertSame(5, $options->maxRedirects());
@@ -220,12 +220,12 @@ public function test_with_follow_redirects_rejects_negative_max_redirects(): voi
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Max redirects must be non-negative');
- (new AsyncCurlTransportOptions())->withFollowRedirects(true, -1);
+ new AsyncCurlTransportOptions()->withFollowRedirects(true, -1);
}
public function test_with_header(): void
{
- $options = (new AsyncCurlTransportOptions())
+ $options = new AsyncCurlTransportOptions()
->withHeader('Authorization', 'Bearer token')
->withHeader('X-Custom', 'value');
@@ -240,7 +240,7 @@ public function test_with_header(): void
public function test_with_headers(): void
{
- $options = (new AsyncCurlTransportOptions())->withHeaders([
+ $options = new AsyncCurlTransportOptions()->withHeaders([
'Authorization' => 'Bearer token',
'X-Custom' => 'value',
]);
@@ -256,7 +256,7 @@ public function test_with_headers(): void
public function test_with_headers_replaces_previous_headers(): void
{
- $options = (new AsyncCurlTransportOptions())
+ $options = new AsyncCurlTransportOptions()
->withHeader('Old-Header', 'old-value')
->withHeaders(['New-Header' => 'new-value']);
@@ -265,14 +265,14 @@ public function test_with_headers_replaces_previous_headers(): void
public function test_with_proxy(): void
{
- $options = (new AsyncCurlTransportOptions())->withProxy('http://proxy:8080');
+ $options = new AsyncCurlTransportOptions()->withProxy('http://proxy:8080');
static::assertSame('http://proxy:8080', $options->proxy());
}
public function test_with_shutdown_timeout(): void
{
- $options = (new AsyncCurlTransportOptions())->withShutdownTimeout(7500);
+ $options = new AsyncCurlTransportOptions()->withShutdownTimeout(7500);
static::assertSame(7500, $options->shutdownTimeoutMs());
}
@@ -282,12 +282,12 @@ public function test_with_shutdown_timeout_rejects_negative_value(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Shutdown timeout must be non-negative');
- (new AsyncCurlTransportOptions())->withShutdownTimeout(-1);
+ new AsyncCurlTransportOptions()->withShutdownTimeout(-1);
}
public function test_with_ssl_certificate(): void
{
- $options = (new AsyncCurlTransportOptions())->withSslCertificate('/path/to/cert.pem');
+ $options = new AsyncCurlTransportOptions()->withSslCertificate('/path/to/cert.pem');
static::assertSame('/path/to/cert.pem', $options->sslCertPath());
static::assertNull($options->sslKeyPath());
@@ -295,7 +295,7 @@ public function test_with_ssl_certificate(): void
public function test_with_ssl_certificate_and_key(): void
{
- $options = (new AsyncCurlTransportOptions())->withSslCertificate('/path/to/cert.pem', '/path/to/key.pem');
+ $options = new AsyncCurlTransportOptions()->withSslCertificate('/path/to/cert.pem', '/path/to/key.pem');
static::assertSame('/path/to/cert.pem', $options->sslCertPath());
static::assertSame('/path/to/key.pem', $options->sslKeyPath());
@@ -303,7 +303,7 @@ public function test_with_ssl_certificate_and_key(): void
public function test_with_ssl_verification_disabled(): void
{
- $options = (new AsyncCurlTransportOptions())->withSslVerification(false, false);
+ $options = new AsyncCurlTransportOptions()->withSslVerification(false, false);
static::assertFalse($options->sslVerifyPeer());
static::assertFalse($options->sslVerifyHost());
@@ -311,7 +311,7 @@ public function test_with_ssl_verification_disabled(): void
public function test_with_ssl_verification_enabled(): void
{
- $options = (new AsyncCurlTransportOptions())->withSslVerification(true, true);
+ $options = new AsyncCurlTransportOptions()->withSslVerification(true, true);
static::assertTrue($options->sslVerifyPeer());
static::assertTrue($options->sslVerifyHost());
@@ -319,7 +319,7 @@ public function test_with_ssl_verification_enabled(): void
public function test_with_timeout(): void
{
- $options = (new AsyncCurlTransportOptions())->withTimeout(2500);
+ $options = new AsyncCurlTransportOptions()->withTimeout(2500);
static::assertSame(2500, $options->timeoutMs());
}
@@ -329,6 +329,6 @@ public function test_with_timeout_rejects_negative_value(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Timeout must be non-negative');
- (new AsyncCurlTransportOptions())->withTimeout(-1);
+ new AsyncCurlTransportOptions()->withTimeout(-1);
}
}
diff --git a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/AsyncCurlTransportTest.php b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/AsyncCurlTransportTest.php
index e2ed3ff649..8279cb6495 100644
--- a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/AsyncCurlTransportTest.php
+++ b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/AsyncCurlTransportTest.php
@@ -113,7 +113,7 @@ public function test_failover_receives_failed_batches_and_shutdown_throws_compos
$transport = new AsyncCurlTransport(
'http://127.0.0.1:1',
new JsonSerializer(),
- (new AsyncCurlTransportOptions())
+ new AsyncCurlTransportOptions()
->withConnectTimeout(1)
->withTimeout(1),
$failover,
@@ -155,7 +155,7 @@ public function test_failover_records_double_failure_when_failover_send_also_thr
$transport = new AsyncCurlTransport(
'http://127.0.0.1:1',
new JsonSerializer(),
- (new AsyncCurlTransportOptions())
+ new AsyncCurlTransportOptions()
->withConnectTimeout(1)
->withTimeout(1),
$failover,
@@ -227,7 +227,7 @@ public function test_shutdown_cascades_to_failover_shutdown(): void
$transport = new AsyncCurlTransport(
'http://127.0.0.1:1',
new JsonSerializer(),
- (new AsyncCurlTransportOptions())
+ new AsyncCurlTransportOptions()
->withConnectTimeout(1)
->withTimeout(1),
$failover,
@@ -293,7 +293,7 @@ public function test_shutdown_with_zero_timeout_forwards_pending_to_failover():
$transport = new AsyncCurlTransport(
'http://127.0.0.1:1',
new JsonSerializer(),
- (new AsyncCurlTransportOptions())
+ new AsyncCurlTransportOptions()
->withConnectTimeout(60_000)
->withTimeout(60_000)
->withShutdownTimeout(0),
@@ -324,7 +324,7 @@ public function test_shutdown_with_zero_timeout_surfaces_pending_failure_to_erro
$transport = new AsyncCurlTransport(
'http://127.0.0.1:1',
new JsonSerializer(),
- (new AsyncCurlTransportOptions())
+ new AsyncCurlTransportOptions()
->withConnectTimeout(60_000)
->withTimeout(60_000)
->withShutdownTimeout(0),
diff --git a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/CurlTransportOptionsTest.php b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/CurlTransportOptionsTest.php
index d70fd1c85a..3897c5381a 100644
--- a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/CurlTransportOptionsTest.php
+++ b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/CurlTransportOptionsTest.php
@@ -108,7 +108,7 @@ public function test_to_curl_options_basic(): void
public function test_to_curl_options_with_all_settings(): void
{
- $options = (new CurlTransportOptions())
+ $options = new CurlTransportOptions()
->withTimeout(2000)
->withConnectTimeout(500)
->withSslVerification(false, false)
@@ -132,14 +132,14 @@ public function test_to_curl_options_with_all_settings(): void
public function test_with_ca_info(): void
{
- $options = (new CurlTransportOptions())->withCaInfo('/path/to/ca-bundle.crt');
+ $options = new CurlTransportOptions()->withCaInfo('/path/to/ca-bundle.crt');
static::assertSame('/path/to/ca-bundle.crt', $options->caInfoPath());
}
public function test_with_compression_disabled(): void
{
- $options = (new CurlTransportOptions())
+ $options = new CurlTransportOptions()
->withCompression(true)
->withCompression(false);
@@ -148,14 +148,14 @@ public function test_with_compression_disabled(): void
public function test_with_compression_enabled(): void
{
- $options = (new CurlTransportOptions())->withCompression();
+ $options = new CurlTransportOptions()->withCompression();
static::assertTrue($options->compression());
}
public function test_with_connect_timeout(): void
{
- $options = (new CurlTransportOptions())->withConnectTimeout(750);
+ $options = new CurlTransportOptions()->withConnectTimeout(750);
static::assertSame(750, $options->connectTimeoutMs());
}
@@ -165,19 +165,19 @@ public function test_with_connect_timeout_rejects_negative_value(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Connect timeout must be non-negative');
- (new CurlTransportOptions())->withConnectTimeout(-1);
+ new CurlTransportOptions()->withConnectTimeout(-1);
}
public function test_with_follow_redirects_disabled(): void
{
- $options = (new CurlTransportOptions())->withFollowRedirects(false);
+ $options = new CurlTransportOptions()->withFollowRedirects(false);
static::assertFalse($options->followRedirects());
}
public function test_with_follow_redirects_enabled(): void
{
- $options = (new CurlTransportOptions())->withFollowRedirects(true, 5);
+ $options = new CurlTransportOptions()->withFollowRedirects(true, 5);
static::assertTrue($options->followRedirects());
static::assertSame(5, $options->maxRedirects());
@@ -188,12 +188,12 @@ public function test_with_follow_redirects_rejects_negative_max_redirects(): voi
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Max redirects must be non-negative');
- (new CurlTransportOptions())->withFollowRedirects(true, -1);
+ new CurlTransportOptions()->withFollowRedirects(true, -1);
}
public function test_with_header(): void
{
- $options = (new CurlTransportOptions())
+ $options = new CurlTransportOptions()
->withHeader('Authorization', 'Bearer token')
->withHeader('X-Custom', 'value');
@@ -208,7 +208,7 @@ public function test_with_header(): void
public function test_with_headers(): void
{
- $options = (new CurlTransportOptions())->withHeaders([
+ $options = new CurlTransportOptions()->withHeaders([
'Authorization' => 'Bearer token',
'X-Custom' => 'value',
]);
@@ -224,7 +224,7 @@ public function test_with_headers(): void
public function test_with_headers_replaces_previous_headers(): void
{
- $options = (new CurlTransportOptions())
+ $options = new CurlTransportOptions()
->withHeader('Old-Header', 'old-value')
->withHeaders(['New-Header' => 'new-value']);
@@ -233,14 +233,14 @@ public function test_with_headers_replaces_previous_headers(): void
public function test_with_proxy(): void
{
- $options = (new CurlTransportOptions())->withProxy('http://proxy:8080');
+ $options = new CurlTransportOptions()->withProxy('http://proxy:8080');
static::assertSame('http://proxy:8080', $options->proxy());
}
public function test_with_shutdown_timeout(): void
{
- $options = (new CurlTransportOptions())->withShutdownTimeout(7500);
+ $options = new CurlTransportOptions()->withShutdownTimeout(7500);
static::assertSame(7500, $options->shutdownTimeoutMs());
}
@@ -250,12 +250,12 @@ public function test_with_shutdown_timeout_rejects_negative_value(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Shutdown timeout must be non-negative');
- (new CurlTransportOptions())->withShutdownTimeout(-1);
+ new CurlTransportOptions()->withShutdownTimeout(-1);
}
public function test_with_ssl_certificate(): void
{
- $options = (new CurlTransportOptions())->withSslCertificate('/path/to/cert.pem');
+ $options = new CurlTransportOptions()->withSslCertificate('/path/to/cert.pem');
static::assertSame('/path/to/cert.pem', $options->sslCertPath());
static::assertNull($options->sslKeyPath());
@@ -263,7 +263,7 @@ public function test_with_ssl_certificate(): void
public function test_with_ssl_certificate_and_key(): void
{
- $options = (new CurlTransportOptions())->withSslCertificate('/path/to/cert.pem', '/path/to/key.pem');
+ $options = new CurlTransportOptions()->withSslCertificate('/path/to/cert.pem', '/path/to/key.pem');
static::assertSame('/path/to/cert.pem', $options->sslCertPath());
static::assertSame('/path/to/key.pem', $options->sslKeyPath());
@@ -271,7 +271,7 @@ public function test_with_ssl_certificate_and_key(): void
public function test_with_ssl_verification_disabled(): void
{
- $options = (new CurlTransportOptions())->withSslVerification(false, false);
+ $options = new CurlTransportOptions()->withSslVerification(false, false);
static::assertFalse($options->sslVerifyPeer());
static::assertFalse($options->sslVerifyHost());
@@ -279,7 +279,7 @@ public function test_with_ssl_verification_disabled(): void
public function test_with_ssl_verification_enabled(): void
{
- $options = (new CurlTransportOptions())->withSslVerification(true, true);
+ $options = new CurlTransportOptions()->withSslVerification(true, true);
static::assertTrue($options->sslVerifyPeer());
static::assertTrue($options->sslVerifyHost());
@@ -287,7 +287,7 @@ public function test_with_ssl_verification_enabled(): void
public function test_with_timeout(): void
{
- $options = (new CurlTransportOptions())->withTimeout(2500);
+ $options = new CurlTransportOptions()->withTimeout(2500);
static::assertSame(2500, $options->timeoutMs());
}
@@ -297,6 +297,6 @@ public function test_with_timeout_rejects_negative_value(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Timeout must be non-negative');
- (new CurlTransportOptions())->withTimeout(-1);
+ new CurlTransportOptions()->withTimeout(-1);
}
}
diff --git a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/CurlTransportTest.php b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/CurlTransportTest.php
index 56ccb28335..90f3f619db 100644
--- a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/CurlTransportTest.php
+++ b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/CurlTransportTest.php
@@ -128,7 +128,7 @@ public function test_send_forwards_failed_batch_to_failover_and_throws(): void
$transport = new CurlTransport(
'http://127.0.0.1:1',
new JsonSerializer(),
- (new CurlTransportOptions())
+ new CurlTransportOptions()
->withConnectTimeout(1)
->withTimeout(1),
$failover,
@@ -164,7 +164,7 @@ public function test_send_records_double_failure_when_failover_send_also_throws(
$transport = new CurlTransport(
'http://127.0.0.1:1',
new JsonSerializer(),
- (new CurlTransportOptions())
+ new CurlTransportOptions()
->withConnectTimeout(1)
->withTimeout(1),
$failover,
@@ -209,7 +209,7 @@ public function test_shutdown_cascades_to_failover_shutdown(): void
$transport = new CurlTransport(
'http://127.0.0.1:1',
new JsonSerializer(),
- (new CurlTransportOptions())
+ new CurlTransportOptions()
->withConnectTimeout(1)
->withTimeout(1),
$failover,
diff --git a/src/cli/composer.json b/src/cli/composer.json
index 992c31716c..3a51e9c9ea 100644
--- a/src/cli/composer.json
+++ b/src/cli/composer.json
@@ -8,11 +8,11 @@
"cli"
],
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
- "symfony/console": "^6.4.34 || ^7.4.6 || ^8.0.6",
- "symfony/http-client": "^6.4 || ^7.4 || ^8.0",
+ "php": "~8.5.0 || ~8.6.0",
+ "symfony/console": "^7.4.6 || ^8.0.6",
+ "symfony/http-client": "^7.4 || ^8.0",
"nyholm/psr7": "^1.8",
- "symfony/uid": "^6.4 || ^7.4 || ^8.0",
+ "symfony/uid": "^7.4 || ^8.0",
"flow-php/etl": "self.version",
"flow-php/etl-adapter-csv": "self.version",
"flow-php/etl-adapter-parquet": "self.version",
diff --git a/src/cli/flow b/src/cli/flow
index d03206e6e3..9485ae8edc 100755
--- a/src/cli/flow
+++ b/src/cli/flow
@@ -1,9 +1,9 @@
#!/usr/bin/env php
configure($this);
+ new DbConnectionOptions()->configure($this);
}
protected function execute(InputInterface $input, OutputInterface $output): int
@@ -103,7 +103,7 @@ protected function initialize(InputInterface $input, OutputInterface $output): v
),
);
- $this->connection = DriverManager::getConnection((new DsnParser())->parse($connectionString));
+ $this->connection = DriverManager::getConnection(new DsnParser()->parse($connectionString));
}
}
}
diff --git a/src/cli/src/Flow/CLI/Command/DatabaseTableSchemaCommand.php b/src/cli/src/Flow/CLI/Command/DatabaseTableSchemaCommand.php
index 6a47da7ffc..ff5212116b 100644
--- a/src/cli/src/Flow/CLI/Command/DatabaseTableSchemaCommand.php
+++ b/src/cli/src/Flow/CLI/Command/DatabaseTableSchemaCommand.php
@@ -53,7 +53,7 @@ public function configure(): void
'Filter schema by column name(s)',
);
- (new DbConnectionOptions())->configure($this);
+ new DbConnectionOptions()->configure($this);
}
protected function execute(InputInterface $input, OutputInterface $output): int
@@ -109,19 +109,19 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}
if (option_bool('output-ascii', $input)) {
- $style->write((new ASCIISchemaFormatter())->format($schema));
+ $style->write(new ASCIISchemaFormatter()->format($schema));
return Command::SUCCESS;
}
if (option_bool('output-table', $input)) {
- $style->write((new ASCIISchemaFormatter(true))->format($schema));
+ $style->write(new ASCIISchemaFormatter(true)->format($schema));
return Command::SUCCESS;
}
if (option_bool('output-php', $input)) {
- $style->writeln((new PHPSchemaFormatter())->format($schema));
+ $style->writeln(new PHPSchemaFormatter()->format($schema));
return Command::SUCCESS;
}
@@ -145,7 +145,7 @@ protected function initialize(InputInterface $input, OutputInterface $output): v
),
);
- $this->connection = DriverManager::getConnection((new DsnParser())->parse($connectionString));
+ $this->connection = DriverManager::getConnection(new DsnParser()->parse($connectionString));
}
}
}
diff --git a/src/cli/src/Flow/CLI/Command/FileAnalyzeCommand.php b/src/cli/src/Flow/CLI/Command/FileAnalyzeCommand.php
index b4e9228ebd..089f170506 100644
--- a/src/cli/src/Flow/CLI/Command/FileAnalyzeCommand.php
+++ b/src/cli/src/Flow/CLI/Command/FileAnalyzeCommand.php
@@ -85,14 +85,14 @@ public function configure(): void
null,
);
- (new ConfigOption('config'))->configure($this);
- (new JSONInputOptions())->configure($this);
- (new CSVInputOptions())->configure($this);
- (new ExcelInputOptions())->configure($this);
- (new XMLInputOptions())->configure($this);
- (new ParquetInputOptions())->configure($this);
- (new SchemaInferenceOptions())->configure($this);
- (new StatisticsOptions())->configure($this);
+ new ConfigOption('config')->configure($this);
+ new JSONInputOptions()->configure($this);
+ new CSVInputOptions()->configure($this);
+ new ExcelInputOptions()->configure($this);
+ new XMLInputOptions()->configure($this);
+ new ParquetInputOptions()->configure($this);
+ new SchemaInferenceOptions()->configure($this);
+ new StatisticsOptions()->configure($this);
}
protected function execute(InputInterface $input, OutputInterface $output): int
@@ -106,9 +106,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$style->title('Analyzing File');
$style->info('File path: ' . $this->sourcePath->basename());
- $extractor = (new ExtractorFactory($this->sourcePath, $this->fileFormat))->get($input);
+ $extractor = new ExtractorFactory($this->sourcePath, $this->fileFormat)->get($input);
- if (!(new SchemaInferenceOptions())->apply($extractor, $input, $style)) {
+ if (!new SchemaInferenceOptions()->apply($extractor, $input, $style)) {
return Command::FAILURE;
}
@@ -162,15 +162,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$progress?->finish();
}
- (new PipelineReportFormatter($report, $style, $input))->format();
+ new PipelineReportFormatter($report, $style, $input)->format();
return Command::SUCCESS;
}
protected function initialize(InputInterface $input, OutputInterface $output): void
{
- $this->flowConfig = (new ConfigOption('config'))->get($input);
- $this->sourcePath = (new FilePathArgument('input-file'))->getExisting($input);
- $this->fileFormat = (new FileFormatOption($this->sourcePath, 'input-file-format'))->get($input);
+ $this->flowConfig = new ConfigOption('config')->get($input);
+ $this->sourcePath = new FilePathArgument('input-file')->getExisting($input);
+ $this->fileFormat = new FileFormatOption($this->sourcePath, 'input-file-format')->get($input);
}
}
diff --git a/src/cli/src/Flow/CLI/Command/FileConvertCommand.php b/src/cli/src/Flow/CLI/Command/FileConvertCommand.php
index 4edda313df..8a3dffe78b 100644
--- a/src/cli/src/Flow/CLI/Command/FileConvertCommand.php
+++ b/src/cli/src/Flow/CLI/Command/FileConvertCommand.php
@@ -113,16 +113,16 @@ public function configure(): void
false,
);
- (new ConfigOption('config'))->configure($this);
- (new JSONInputOptions())->configure($this);
- (new JSONOutputOptions())->configure($this);
- (new CSVInputOptions())->configure($this);
- (new CSVOutputOptions())->configure($this);
- (new ExcelInputOptions())->configure($this);
- (new XMLInputOptions())->configure($this);
- (new XMLOutputOptions())->configure($this);
- (new ParquetInputOptions())->configure($this);
- (new SchemaInferenceOptions())->configure($this);
+ new ConfigOption('config')->configure($this);
+ new JSONInputOptions()->configure($this);
+ new JSONOutputOptions()->configure($this);
+ new CSVInputOptions()->configure($this);
+ new CSVOutputOptions()->configure($this);
+ new ExcelInputOptions()->configure($this);
+ new XMLInputOptions()->configure($this);
+ new XMLOutputOptions()->configure($this);
+ new ParquetInputOptions()->configure($this);
+ new SchemaInferenceOptions()->configure($this);
}
protected function execute(InputInterface $input, OutputInterface $output): int
@@ -139,9 +139,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$style = new SymfonyStyle($input, $output);
- $extractor = (new ExtractorFactory($this->inputFile, $this->inputFileFormat))->get($input);
+ $extractor = new ExtractorFactory($this->inputFile, $this->inputFileFormat)->get($input);
- if (!(new SchemaInferenceOptions())->apply($extractor, $input, $style)) {
+ if (!new SchemaInferenceOptions()->apply($extractor, $input, $style)) {
return Command::FAILURE;
}
@@ -175,7 +175,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$df = $df->offset($offset);
}
- $loader = (new LoaderFactory($this->outputFile, $this->outputFileFormat))->get($input);
+ $loader = new LoaderFactory($this->outputFile, $this->outputFileFormat)->get($input);
if (option_bool('output-overwrite', $input)) {
$loader->saveMode(overwrite());
@@ -201,10 +201,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
protected function initialize(InputInterface $input, OutputInterface $output): void
{
- $this->flowConfig = (new ConfigOption('config'))->get($input);
- $this->inputFile = (new FilePathArgument('input-file'))->getExisting($input);
- $this->outputFile = (new FilePathArgument('output-file'))->get($input);
- $this->inputFileFormat = (new FileFormatOption($this->inputFile, 'input-file-format'))->get($input);
- $this->outputFileFormat = (new FileFormatOption($this->outputFile, 'output-file-format'))->get($input);
+ $this->flowConfig = new ConfigOption('config')->get($input);
+ $this->inputFile = new FilePathArgument('input-file')->getExisting($input);
+ $this->outputFile = new FilePathArgument('output-file')->get($input);
+ $this->inputFileFormat = new FileFormatOption($this->inputFile, 'input-file-format')->get($input);
+ $this->outputFileFormat = new FileFormatOption($this->outputFile, 'output-file-format')->get($input);
}
}
diff --git a/src/cli/src/Flow/CLI/Command/FileReadCommand.php b/src/cli/src/Flow/CLI/Command/FileReadCommand.php
index 31dac9e3f5..263f2be69e 100644
--- a/src/cli/src/Flow/CLI/Command/FileReadCommand.php
+++ b/src/cli/src/Flow/CLI/Command/FileReadCommand.php
@@ -96,13 +96,13 @@ public function configure(): void
[],
);
- (new ConfigOption('config'))->configure($this);
- (new JSONInputOptions())->configure($this);
- (new CSVInputOptions())->configure($this);
- (new ExcelInputOptions())->configure($this);
- (new XMLInputOptions())->configure($this);
- (new ParquetInputOptions())->configure($this);
- (new SchemaInferenceOptions())->configure($this);
+ new ConfigOption('config')->configure($this);
+ new JSONInputOptions()->configure($this);
+ new CSVInputOptions()->configure($this);
+ new ExcelInputOptions()->configure($this);
+ new XMLInputOptions()->configure($this);
+ new ParquetInputOptions()->configure($this);
+ new SchemaInferenceOptions()->configure($this);
}
protected function execute(InputInterface $input, OutputInterface $output): int
@@ -113,9 +113,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$style = new SymfonyStyle($input, $output);
- $extractor = (new ExtractorFactory($this->sourcePath, $this->fileFormat))->get($input);
+ $extractor = new ExtractorFactory($this->sourcePath, $this->fileFormat)->get($input);
- if (!(new SchemaInferenceOptions())->apply($extractor, $input, $style)) {
+ if (!new SchemaInferenceOptions()->apply($extractor, $input, $style)) {
return Command::FAILURE;
}
@@ -161,8 +161,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
protected function initialize(InputInterface $input, OutputInterface $output): void
{
- $this->flowConfig = (new ConfigOption('config'))->get($input);
- $this->sourcePath = (new FilePathArgument('input-file'))->getExisting($input);
- $this->fileFormat = (new FileFormatOption($this->sourcePath, 'input-file-format'))->get($input);
+ $this->flowConfig = new ConfigOption('config')->get($input);
+ $this->sourcePath = new FilePathArgument('input-file')->getExisting($input);
+ $this->fileFormat = new FileFormatOption($this->sourcePath, 'input-file-format')->get($input);
}
}
diff --git a/src/cli/src/Flow/CLI/Command/FileRowsCountCommand.php b/src/cli/src/Flow/CLI/Command/FileRowsCountCommand.php
index 740b587f49..edf4eff715 100644
--- a/src/cli/src/Flow/CLI/Command/FileRowsCountCommand.php
+++ b/src/cli/src/Flow/CLI/Command/FileRowsCountCommand.php
@@ -70,12 +70,12 @@ public function configure(): void
null,
);
- (new ConfigOption('config'))->configure($this);
- (new JSONInputOptions())->configure($this);
- (new ExcelInputOptions())->configure($this);
- (new CSVInputOptions())->configure($this);
- (new XMLInputOptions())->configure($this);
- (new ParquetInputOptions())->configure($this);
+ new ConfigOption('config')->configure($this);
+ new JSONInputOptions()->configure($this);
+ new ExcelInputOptions()->configure($this);
+ new CSVInputOptions()->configure($this);
+ new XMLInputOptions()->configure($this);
+ new ParquetInputOptions()->configure($this);
}
protected function execute(InputInterface $input, OutputInterface $output): int
@@ -92,7 +92,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$this->flowConfig->heartbeat($progress, everySeconds: 0.25, onFailure: HeartbeatFailure::log);
}
- $df = df($this->flowConfig)->read((new ExtractorFactory($this->sourcePath, $this->fileFormat))->get($input));
+ $df = df($this->flowConfig)->read(new ExtractorFactory($this->sourcePath, $this->fileFormat)->get($input));
$limit = option_int_nullable('input-file-limit', $input);
@@ -119,8 +119,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
protected function initialize(InputInterface $input, OutputInterface $output): void
{
- $this->flowConfig = (new ConfigOption('config'))->get($input);
- $this->sourcePath = (new FilePathArgument('input-file'))->getExisting($input);
- $this->fileFormat = (new FileFormatOption($this->sourcePath, 'input-file-format'))->get($input);
+ $this->flowConfig = new ConfigOption('config')->get($input);
+ $this->sourcePath = new FilePathArgument('input-file')->getExisting($input);
+ $this->fileFormat = new FileFormatOption($this->sourcePath, 'input-file-format')->get($input);
}
}
diff --git a/src/cli/src/Flow/CLI/Command/FileSchemaCommand.php b/src/cli/src/Flow/CLI/Command/FileSchemaCommand.php
index bf0e19f356..43049e2e34 100644
--- a/src/cli/src/Flow/CLI/Command/FileSchemaCommand.php
+++ b/src/cli/src/Flow/CLI/Command/FileSchemaCommand.php
@@ -83,13 +83,13 @@ public function configure(): void
->addOption('output-table', null, InputOption::VALUE_NONE, 'Print schema as ascii table')
->addOption('output-ascii', null, InputOption::VALUE_NONE, 'Print schema as ascii list');
- (new ConfigOption('config'))->configure($this);
- (new JSONInputOptions())->configure($this);
- (new CSVInputOptions())->configure($this);
- (new ExcelInputOptions())->configure($this);
- (new XMLInputOptions())->configure($this);
- (new ParquetInputOptions())->configure($this);
- (new SchemaInferenceOptions())->configure($this);
+ new ConfigOption('config')->configure($this);
+ new JSONInputOptions()->configure($this);
+ new CSVInputOptions()->configure($this);
+ new ExcelInputOptions()->configure($this);
+ new XMLInputOptions()->configure($this);
+ new ParquetInputOptions()->configure($this);
+ new SchemaInferenceOptions()->configure($this);
}
protected function execute(InputInterface $input, OutputInterface $output): int
@@ -100,9 +100,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$style = new SymfonyStyle($input, $output);
- $extractor = (new ExtractorFactory($this->sourcePath, $this->fileFormat))->get($input);
+ $extractor = new ExtractorFactory($this->sourcePath, $this->fileFormat)->get($input);
- if (!(new SchemaInferenceOptions())->apply($extractor, $input, $style)) {
+ if (!new SchemaInferenceOptions()->apply($extractor, $input, $style)) {
return Command::FAILURE;
}
@@ -133,19 +133,19 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}
if (option_bool('output-ascii', $input)) {
- $style->write((new ASCIISchemaFormatter())->format($schema));
+ $style->write(new ASCIISchemaFormatter()->format($schema));
return Command::SUCCESS;
}
if (option_bool('output-table', $input)) {
- $style->write((new ASCIISchemaFormatter(true))->format($schema));
+ $style->write(new ASCIISchemaFormatter(true)->format($schema));
return Command::SUCCESS;
}
if (option_bool('output-php', $input)) {
- $style->writeln((new PHPSchemaFormatter())->format($schema));
+ $style->writeln(new PHPSchemaFormatter()->format($schema));
return Command::SUCCESS;
}
@@ -157,8 +157,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
protected function initialize(InputInterface $input, OutputInterface $output): void
{
- $this->flowConfig = (new ConfigOption('config'))->get($input);
- $this->sourcePath = (new FilePathArgument('input-file'))->getExisting($input);
- $this->fileFormat = (new FileFormatOption($this->sourcePath, 'input-file-format'))->get($input);
+ $this->flowConfig = new ConfigOption('config')->get($input);
+ $this->sourcePath = new FilePathArgument('input-file')->getExisting($input);
+ $this->fileFormat = new FileFormatOption($this->sourcePath, 'input-file-format')->get($input);
}
}
diff --git a/src/cli/src/Flow/CLI/Command/PipelineRunCommand.php b/src/cli/src/Flow/CLI/Command/PipelineRunCommand.php
index c2d9045b36..1badc8087a 100644
--- a/src/cli/src/Flow/CLI/Command/PipelineRunCommand.php
+++ b/src/cli/src/Flow/CLI/Command/PipelineRunCommand.php
@@ -56,7 +56,7 @@ public function configure(): void
false,
);
- (new StatisticsOptions())->configure($this);
+ new StatisticsOptions()->configure($this);
}
public function execute(InputInterface $input, OutputInterface $output): int
@@ -86,7 +86,7 @@ public function execute(InputInterface $input, OutputInterface $output): int
$extension = $this->pipelinePath->extension();
$df = match ($extension) {
- 'php' => (new PipelineFactory($this->pipelinePath))->fromPHP(),
+ 'php' => new PipelineFactory($this->pipelinePath)->fromPHP(),
default => throw new InvalidFileFormatException('php', is_string($extension) ? $extension : 'unknown'),
};
$report = $df->run(analyze: $analyze);
@@ -95,7 +95,7 @@ public function execute(InputInterface $input, OutputInterface $output): int
$style->writeln($buffered !== false ? $buffered : '');
if ($report !== null) {
- (new PipelineReportFormatter($report, $style, $input))->format();
+ new PipelineReportFormatter($report, $style, $input)->format();
}
} catch (Exception $exception) {
$style->error($exception->getMessage());
@@ -108,6 +108,6 @@ public function execute(InputInterface $input, OutputInterface $output): int
protected function initialize(InputInterface $input, OutputInterface $output): void
{
- $this->pipelinePath = (new FilePathArgument('pipeline-file'))->getExisting($input);
+ $this->pipelinePath = new FilePathArgument('pipeline-file')->getExisting($input);
}
}
diff --git a/src/cli/src/Flow/CLI/Command/SchemaFormatCommand.php b/src/cli/src/Flow/CLI/Command/SchemaFormatCommand.php
index 4e39821a87..1917d07e37 100644
--- a/src/cli/src/Flow/CLI/Command/SchemaFormatCommand.php
+++ b/src/cli/src/Flow/CLI/Command/SchemaFormatCommand.php
@@ -49,25 +49,25 @@ public function execute(InputInterface $input, OutputInterface $output): int
$style = new SymfonyStyle($input, $output);
$schema = schema_from_json(
- (new NativeLocalFilesystem())
+ new NativeLocalFilesystem()
->readFrom($this->schemaPath)
->content(),
);
if (option_bool('output-ascii', $input)) {
- $style->write((new ASCIISchemaFormatter())->format($schema));
+ $style->write(new ASCIISchemaFormatter()->format($schema));
return Command::SUCCESS;
}
if (option_bool('output-table', $input)) {
- $style->write((new ASCIISchemaFormatter(true))->format($schema));
+ $style->write(new ASCIISchemaFormatter(true)->format($schema));
return Command::SUCCESS;
}
if (option_bool('output-php', $input)) {
- $style->writeln((new PHPSchemaFormatter())->format($schema));
+ $style->writeln(new PHPSchemaFormatter()->format($schema));
return Command::SUCCESS;
}
@@ -79,6 +79,6 @@ public function execute(InputInterface $input, OutputInterface $output): int
protected function initialize(InputInterface $input, OutputInterface $output): void
{
- $this->schemaPath = (new FilePathArgument('input-schema-file'))->getExisting($input);
+ $this->schemaPath = new FilePathArgument('input-schema-file')->getExisting($input);
}
}
diff --git a/src/cli/src/Flow/CLI/DSL/functions.php b/src/cli/src/Flow/CLI/DSL/functions.php
index f00b321002..043a0ccc77 100644
--- a/src/cli/src/Flow/CLI/DSL/functions.php
+++ b/src/cli/src/Flow/CLI/DSL/functions.php
@@ -11,32 +11,32 @@
function option_bool(string $name, InputInterface $input): bool
{
- return (new TypedOption($name))->asBool($input);
+ return new TypedOption($name)->asBool($input);
}
function option_bool_nullable(string $name, InputInterface $input): ?bool
{
- return (new TypedOption($name))->asBoolNullable($input);
+ return new TypedOption($name)->asBoolNullable($input);
}
function option_string(string $name, InputInterface $input, ?string $default = null): string
{
- return (new TypedOption($name))->asString($input, $default);
+ return new TypedOption($name)->asString($input, $default);
}
function option_string_nullable(string $name, InputInterface $input): ?string
{
- return (new TypedOption($name))->asStringNullable($input);
+ return new TypedOption($name)->asStringNullable($input);
}
function option_int(string $name, InputInterface $input, ?int $default = null): int
{
- return (new TypedOption($name))->asInt($input, $default);
+ return new TypedOption($name)->asInt($input, $default);
}
function option_int_nullable(string $name, InputInterface $input): ?int
{
- return (new TypedOption($name))->asIntNullable($input);
+ return new TypedOption($name)->asIntNullable($input);
}
/**
@@ -44,7 +44,7 @@ function option_int_nullable(string $name, InputInterface $input): ?int
*/
function option_list_of_strings(string $name, InputInterface $input): array
{
- return (new TypedOption($name))->asListOfStrings($input);
+ return new TypedOption($name)->asListOfStrings($input);
}
/**
@@ -52,17 +52,17 @@ function option_list_of_strings(string $name, InputInterface $input): array
*/
function option_list_of_strings_nullable(string $name, InputInterface $input): ?array
{
- return (new TypedOption($name))->asListOfStringsNullable($input);
+ return new TypedOption($name)->asListOfStringsNullable($input);
}
function argument_string(string $name, InputInterface $input): string
{
- return (new TypedArgument($name))->asString($input);
+ return new TypedArgument($name)->asString($input);
}
function argument_string_nullable(string $name, InputInterface $input): ?string
{
- return (new TypedArgument($name))->asStringNullable($input);
+ return new TypedArgument($name)->asStringNullable($input);
}
/**
@@ -74,5 +74,5 @@ function argument_string_nullable(string $name, InputInterface $input): ?string
*/
function option_include_file(string $name, InputInterface $input, string $expectedClass): object
{
- return (new IncludeFileOption($name, $expectedClass))->include($input);
+ return new IncludeFileOption($name, $expectedClass)->include($input);
}
diff --git a/src/cli/src/Flow/CLI/Factory/ExtractorFactory.php b/src/cli/src/Flow/CLI/Factory/ExtractorFactory.php
index 1446f8922c..ffc19b3729 100644
--- a/src/cli/src/Flow/CLI/Factory/ExtractorFactory.php
+++ b/src/cli/src/Flow/CLI/Factory/ExtractorFactory.php
@@ -21,12 +21,12 @@ public function __construct(
public function get(InputInterface $input): Extractor
{
return match ($this->format) {
- FileFormat::CSV => (new CSVExtractorFactory($this->path))->get($input),
- FileFormat::JSON => (new JsonExtractorFactory($this->path))->get($input),
- FileFormat::PARQUET => (new ParquetExtractorFactory($this->path))->get($input),
+ FileFormat::CSV => new CSVExtractorFactory($this->path)->get($input),
+ FileFormat::JSON => new JsonExtractorFactory($this->path)->get($input),
+ FileFormat::PARQUET => new ParquetExtractorFactory($this->path)->get($input),
FileFormat::TEXT => from_text($this->path),
- FileFormat::XML => (new XMLExtractorFactory($this->path))->get($input),
- FileFormat::ODS, FileFormat::XLSX => (new ExcelExtractorFactory($this->path))->get($input),
+ FileFormat::XML => new XMLExtractorFactory($this->path)->get($input),
+ FileFormat::ODS, FileFormat::XLSX => new ExcelExtractorFactory($this->path)->get($input),
};
}
}
diff --git a/src/cli/src/Flow/CLI/Factory/LoaderFactory.php b/src/cli/src/Flow/CLI/Factory/LoaderFactory.php
index 5dd6767cfd..a00166c5ff 100644
--- a/src/cli/src/Flow/CLI/Factory/LoaderFactory.php
+++ b/src/cli/src/Flow/CLI/Factory/LoaderFactory.php
@@ -23,10 +23,10 @@ public function __construct(
public function get(InputInterface $input): Loader&FileLoader
{
return match ($this->format) {
- FileFormat::CSV => (new CSVLoaderFactory($this->path))->get($input),
- FileFormat::JSON => (new JsonLoaderFactory($this->path))->get($input),
- FileFormat::XML => (new XMLLoaderFactory($this->path))->get($input),
- FileFormat::PARQUET => (new ParquetLoaderFactory($this->path))->get($input),
+ FileFormat::CSV => new CSVLoaderFactory($this->path)->get($input),
+ FileFormat::JSON => new JsonLoaderFactory($this->path)->get($input),
+ FileFormat::XML => new XMLLoaderFactory($this->path)->get($input),
+ FileFormat::PARQUET => new ParquetLoaderFactory($this->path)->get($input),
FileFormat::TEXT => to_text($this->path),
FileFormat::ODS, FileFormat::XLSX => throw new InvalidArgumentException('To be implemented'),
};
diff --git a/src/cli/tests/Flow/CLI/Tests/Context/DatabaseContext.php b/src/cli/tests/Flow/CLI/Tests/Context/DatabaseContext.php
index 741748ef71..0eff43599b 100644
--- a/src/cli/tests/Flow/CLI/Tests/Context/DatabaseContext.php
+++ b/src/cli/tests/Flow/CLI/Tests/Context/DatabaseContext.php
@@ -17,7 +17,7 @@
public function __construct()
{
- $this->connection = DriverManager::getConnection((new DsnParser(['postgresql' => 'pdo_pgsql']))->parse(
+ $this->connection = DriverManager::getConnection(new DsnParser(['postgresql' => 'pdo_pgsql'])->parse(
getenv('PGSQL_DATABASE_URL') ?: '',
));
}
diff --git a/src/cli/tests/Flow/CLI/Tests/Integration/DatabaseTableListCommandTest.php b/src/cli/tests/Flow/CLI/Tests/Integration/DatabaseTableListCommandTest.php
index bb8e283889..7e0258579e 100644
--- a/src/cli/tests/Flow/CLI/Tests/Integration/DatabaseTableListCommandTest.php
+++ b/src/cli/tests/Flow/CLI/Tests/Integration/DatabaseTableListCommandTest.php
@@ -9,7 +9,6 @@
use Doctrine\DBAL\Schema\Name\UnqualifiedName;
use Doctrine\DBAL\Schema\PrimaryKeyConstraint;
use Doctrine\DBAL\Schema\Table;
-use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use Flow\CLI\Command\DatabaseTableListCommand;
use Flow\CLI\Tests\Context\DatabaseContext;
@@ -40,7 +39,7 @@ public function test_config_option_is_not_accepted(): void
$this->expectException(InvalidOptionException::class);
$this->expectExceptionMessage('The "--config" option does not exist.');
- (new CommandTester(new DatabaseTableListCommand('db:table:list')))->execute([
+ new CommandTester(new DatabaseTableListCommand('db:table:list'))->execute([
'--db-connection-file' => __DIR__ . '/Fixtures/connection.php',
'--config' => 'x.php',
]);
@@ -49,11 +48,11 @@ public function test_config_option_is_not_accepted(): void
public function test_run_db_table_list(): void
{
$this->dbContext()->createTable(
- (new Table('table_01', [
- new Column('id', Type::getType(Types::INTEGER), ['notnull' => true]),
- new Column('name', Type::getType(Types::STRING), ['notnull' => true, 'length' => 255]),
- new Column('description', Type::getType(Types::STRING), ['notnull' => true, 'length' => 255]),
- ]))
+ new Table('table_01', [
+ new Column('id', Types::INTEGER, ['notnull' => true]),
+ new Column('name', Types::STRING, ['notnull' => true, 'length' => 255]),
+ new Column('description', Types::STRING, ['notnull' => true, 'length' => 255]),
+ ])
->edit()
->addPrimaryKeyConstraint(
new PrimaryKeyConstraint(null, [new UnqualifiedName(Identifier::unquoted('id'))], true),
@@ -62,14 +61,14 @@ public function test_run_db_table_list(): void
);
$this->dbContext()->createTable(
- (new Table('table_02', [
- new Column('id', Type::getType(Types::INTEGER), ['notnull' => true]),
- new Column('created_at', Type::getType(Types::DATETIME_IMMUTABLE), ['notnull' => true]),
- new Column('tags', Type::getType(Types::JSON), [
+ new Table('table_02', [
+ new Column('id', Types::INTEGER, ['notnull' => true]),
+ new Column('created_at', Types::DATETIME_IMMUTABLE, ['notnull' => true]),
+ new Column('tags', Types::JSON, [
'notnull' => true,
'platformOptions' => ['jsonb' => true],
]),
- ]))
+ ])
->edit()
->addPrimaryKeyConstraint(
new PrimaryKeyConstraint(null, [new UnqualifiedName(Identifier::unquoted('id'))], true),
diff --git a/src/cli/tests/Flow/CLI/Tests/Integration/DatabaseTableSchemaCommandTest.php b/src/cli/tests/Flow/CLI/Tests/Integration/DatabaseTableSchemaCommandTest.php
index a7240259c9..cf0a2e531c 100644
--- a/src/cli/tests/Flow/CLI/Tests/Integration/DatabaseTableSchemaCommandTest.php
+++ b/src/cli/tests/Flow/CLI/Tests/Integration/DatabaseTableSchemaCommandTest.php
@@ -9,7 +9,6 @@
use Doctrine\DBAL\Schema\Name\UnqualifiedName;
use Doctrine\DBAL\Schema\PrimaryKeyConstraint;
use Doctrine\DBAL\Schema\Table;
-use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use Flow\CLI\Command\DatabaseTableSchemaCommand;
use Flow\CLI\Tests\Context\DatabaseContext;
@@ -19,8 +18,6 @@
use Symfony\Component\Console\Exception\InvalidOptionException;
use Symfony\Component\Console\Tester\CommandTester;
-use function method_exists;
-
final class DatabaseTableSchemaCommandTest extends FlowTestCase
{
protected ?DatabaseContext $dbContext = null;
@@ -42,7 +39,7 @@ public function test_config_option_is_not_accepted(): void
$this->expectException(InvalidOptionException::class);
$this->expectExceptionMessage('The "--config" option does not exist.');
- (new CommandTester(new DatabaseTableSchemaCommand('db:table:schema')))->execute([
+ new CommandTester(new DatabaseTableSchemaCommand('db:table:schema'))->execute([
'input-db-table' => 'table_01',
'--db-connection-file' => __DIR__ . '/Fixtures/connection.php',
'--config' => 'x.php',
@@ -52,11 +49,11 @@ public function test_config_option_is_not_accepted(): void
public function test_run_db_table_list(): void
{
$this->dbContext()->createTable(
- (new Table('table_01', [
- new Column('id', Type::getType(Types::INTEGER), ['notnull' => true]),
- new Column('name', Type::getType(Types::STRING), ['notnull' => true, 'length' => 255]),
- new Column('description', Type::getType(Types::STRING), ['notnull' => true, 'length' => 255]),
- ]))
+ new Table('table_01', [
+ new Column('id', Types::INTEGER, ['notnull' => true]),
+ new Column('name', Types::STRING, ['notnull' => true, 'length' => 255]),
+ new Column('description', Types::STRING, ['notnull' => true, 'length' => 255]),
+ ])
->edit()
->addPrimaryKeyConstraint(
new PrimaryKeyConstraint(null, [new UnqualifiedName(Identifier::unquoted('id'))], true),
@@ -65,14 +62,14 @@ public function test_run_db_table_list(): void
);
$this->dbContext()->createTable(
- (new Table('table_02', [
- new Column('id', Type::getType(Types::INTEGER), ['notnull' => true]),
- new Column('created_at', Type::getType(Types::DATETIME_IMMUTABLE), ['notnull' => true]),
- new Column('tags', Type::getType(Types::JSON), [
+ new Table('table_02', [
+ new Column('id', Types::INTEGER, ['notnull' => true]),
+ new Column('created_at', Types::DATETIME_IMMUTABLE, ['notnull' => true]),
+ new Column('tags', Types::JSON, [
'notnull' => true,
'platformOptions' => ['jsonb' => true],
]),
- ]))
+ ])
->edit()
->addPrimaryKeyConstraint(
new PrimaryKeyConstraint(null, [new UnqualifiedName(Identifier::unquoted('id'))], true),
@@ -90,44 +87,24 @@ public function test_run_db_table_list(): void
$tester->assertCommandIsSuccessful();
- // changeColumn was removed in doctrine/dbal 4.0
- // We are using it to perform a different assertion since prior to 4.0 all
- // columns were also getting precision set to 10 due to a bug that was executing precision set
- // even when precision value was null.
- if (!method_exists(Table::class, 'changeColumn')) {
- static::assertSame(<<<'PHP'
- \Flow\ETL\DSL\schema(
- \Flow\ETL\DSL\integer_schema("id", nullable: false, metadata: \Flow\ETL\DSL\schema_metadata(["dbal_column_primary" => ""])),
- \Flow\ETL\DSL\string_schema("name", nullable: false, metadata: \Flow\ETL\DSL\schema_metadata(["dbal_column_length" => 255])),
- \Flow\ETL\DSL\string_schema("description", nullable: false, metadata: \Flow\ETL\DSL\schema_metadata(["dbal_column_length" => 255])),
- );
-
- PHP, $tester->getDisplay());
- } else {
- static::assertSame(<<<'PHP'
- \Flow\ETL\DSL\schema(
- \Flow\ETL\DSL\integer_schema("id", nullable: false, metadata: \Flow\ETL\DSL\schema_metadata(["dbal_column_precision" => 10, "dbal_column_primary" => ""])),
- \Flow\ETL\DSL\string_schema("name", nullable: false, metadata: \Flow\ETL\DSL\schema_metadata(["dbal_column_length" => 255, "dbal_column_precision" => 10])),
- \Flow\ETL\DSL\string_schema("description", nullable: false, metadata: \Flow\ETL\DSL\schema_metadata(["dbal_column_length" => 255, "dbal_column_precision" => 10])),
- );
-
- PHP, $tester->getDisplay());
- }
+ static::assertSame(<<<'PHP'
+ \Flow\ETL\DSL\schema(
+ \Flow\ETL\DSL\integer_schema("id", nullable: false, metadata: \Flow\ETL\DSL\schema_metadata(["dbal_column_primary" => ""])),
+ \Flow\ETL\DSL\string_schema("name", nullable: false, metadata: \Flow\ETL\DSL\schema_metadata(["dbal_column_length" => 255])),
+ \Flow\ETL\DSL\string_schema("description", nullable: false, metadata: \Flow\ETL\DSL\schema_metadata(["dbal_column_length" => 255])),
+ );
+
+ PHP, $tester->getDisplay());
}
public function test_selecting_specific_columns_only(): void
{
- // We don't need to test this edge case on doctrine/dbal below version 4.0 since the logic does not change.
- if (method_exists(Table::class, 'changeColumn')) {
- static::markTestSkipped('This test is not supported in doctrine/dbal 4.0');
- }
-
$this->dbContext()->createTable(
- (new Table('table_01', [
- new Column('id', Type::getType(Types::INTEGER), ['notnull' => true]),
- new Column('name', Type::getType(Types::STRING), ['notnull' => true, 'length' => 255]),
- new Column('description', Type::getType(Types::STRING), ['notnull' => true, 'length' => 255]),
- ]))
+ new Table('table_01', [
+ new Column('id', Types::INTEGER, ['notnull' => true]),
+ new Column('name', Types::STRING, ['notnull' => true, 'length' => 255]),
+ new Column('description', Types::STRING, ['notnull' => true, 'length' => 255]),
+ ])
->edit()
->addPrimaryKeyConstraint(
new PrimaryKeyConstraint(null, [new UnqualifiedName(Identifier::unquoted('id'))], true),
@@ -157,17 +134,12 @@ public function test_selecting_specific_columns_only(): void
public function test_selecting_not_existing_column(): void
{
- // We don't need to test this edge case on doctrine/dbal below version 4.0 since the logic does not change.
- if (method_exists(Table::class, 'changeColumn')) {
- static::markTestSkipped('This test is not supported in doctrine/dbal 4.0');
- }
-
$this->dbContext()->createTable(
- (new Table('table_01', [
- new Column('id', Type::getType(Types::INTEGER), ['notnull' => true]),
- new Column('name', Type::getType(Types::STRING), ['notnull' => true, 'length' => 255]),
- new Column('description', Type::getType(Types::STRING), ['notnull' => true, 'length' => 255]),
- ]))
+ new Table('table_01', [
+ new Column('id', Types::INTEGER, ['notnull' => true]),
+ new Column('name', Types::STRING, ['notnull' => true, 'length' => 255]),
+ new Column('description', Types::STRING, ['notnull' => true, 'length' => 255]),
+ ])
->edit()
->addPrimaryKeyConstraint(
new PrimaryKeyConstraint(null, [new UnqualifiedName(Identifier::unquoted('id'))], true),
diff --git a/src/cli/tests/Flow/CLI/Tests/Integration/FileAnalyzeCommandTest.php b/src/cli/tests/Flow/CLI/Tests/Integration/FileAnalyzeCommandTest.php
index d92ebe7532..1179771c51 100644
--- a/src/cli/tests/Flow/CLI/Tests/Integration/FileAnalyzeCommandTest.php
+++ b/src/cli/tests/Flow/CLI/Tests/Integration/FileAnalyzeCommandTest.php
@@ -36,7 +36,7 @@ public function test_a_plain_output_gets_no_progress(): void
{
$output = new BufferedOutput();
- (new FileAnalyzeCommand('analyze'))->run(new ArrayInput([
+ new FileAnalyzeCommand('analyze')->run(new ArrayInput([
'input-file' => __DIR__ . '/Fixtures/orders.csv',
'--config' => __DIR__ . '/Fixtures/stepping-clock-config.php',
]), $output);
diff --git a/src/cli/tests/Flow/CLI/Tests/Integration/FileConvertCommandTest.php b/src/cli/tests/Flow/CLI/Tests/Integration/FileConvertCommandTest.php
index 64191cf084..e819072853 100644
--- a/src/cli/tests/Flow/CLI/Tests/Integration/FileConvertCommandTest.php
+++ b/src/cli/tests/Flow/CLI/Tests/Integration/FileConvertCommandTest.php
@@ -52,7 +52,7 @@ public function test_a_plain_output_gets_no_progress(): void
$output = __DIR__ . '/var/' . bin2hex(random_bytes(16)) . '.csv';
$buffered = new BufferedOutput();
- (new FileConvertCommand('convert'))->run(new ArrayInput([
+ new FileConvertCommand('convert')->run(new ArrayInput([
'input-file' => __DIR__ . '/Fixtures/orders.csv',
'output-file' => $output,
'--config' => __DIR__ . '/Fixtures/stepping-clock-config.php',
diff --git a/src/cli/tests/Flow/CLI/Tests/Integration/FileRowsCountCommandTest.php b/src/cli/tests/Flow/CLI/Tests/Integration/FileRowsCountCommandTest.php
index 6997731257..3d034a56fe 100644
--- a/src/cli/tests/Flow/CLI/Tests/Integration/FileRowsCountCommandTest.php
+++ b/src/cli/tests/Flow/CLI/Tests/Integration/FileRowsCountCommandTest.php
@@ -36,7 +36,7 @@ public function test_a_plain_output_gets_only_the_count(): void
{
$output = new BufferedOutput();
- (new FileRowsCountCommand('count'))->run(new ArrayInput([
+ new FileRowsCountCommand('count')->run(new ArrayInput([
'input-file' => __DIR__ . '/Fixtures/orders.csv',
'--config' => __DIR__ . '/Fixtures/stepping-clock-config.php',
]), $output);
diff --git a/src/cli/tests/Flow/CLI/Tests/Integration/Fixtures/connection.php b/src/cli/tests/Flow/CLI/Tests/Integration/Fixtures/connection.php
index d75efd3bfc..c52f711d75 100644
--- a/src/cli/tests/Flow/CLI/Tests/Integration/Fixtures/connection.php
+++ b/src/cli/tests/Flow/CLI/Tests/Integration/Fixtures/connection.php
@@ -5,6 +5,6 @@
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Tools\DsnParser;
-return DriverManager::getConnection((new DsnParser(['postgresql' => 'pdo_pgsql']))->parse(
+return DriverManager::getConnection(new DsnParser(['postgresql' => 'pdo_pgsql'])->parse(
getenv('PGSQL_DATABASE_URL') ?: '',
));
diff --git a/src/cli/tests/Flow/CLI/Tests/Integration/Options/ConfigOptionTest.php b/src/cli/tests/Flow/CLI/Tests/Integration/Options/ConfigOptionTest.php
index 5061b95106..c0c575fced 100644
--- a/src/cli/tests/Flow/CLI/Tests/Integration/Options/ConfigOptionTest.php
+++ b/src/cli/tests/Flow/CLI/Tests/Integration/Options/ConfigOptionTest.php
@@ -21,7 +21,7 @@ public function test_getting_config_from_option(): void
$option = new InputOption('config', null, InputOption::VALUE_REQUIRED);
$definition = new InputDefinition([$option]);
- $config = (new ConfigOption('config'))->get(new ArrayInput([
+ $config = new ConfigOption('config')->get(new ArrayInput([
'--config' => __DIR__ . '/Fixtures/.flow.config.php',
], $definition));
@@ -34,7 +34,7 @@ public function test_getting_default_config(): void
$option = new InputOption('config', null, InputOption::VALUE_OPTIONAL);
$definition = new InputDefinition([$option]);
- $config = (new ConfigOption('config'))->get(new ArrayInput([], $definition));
+ $config = new ConfigOption('config')->get(new ArrayInput([], $definition));
static::assertInstanceOf(ConfigBuilder::class, $config);
static::assertNotSame('execution-id', $config->build()->id());
@@ -52,7 +52,7 @@ public function test_throwing_exception_when_config_file_returns_a_built_config(
$path,
));
- (new ConfigOption('config'))->get(new ArrayInput(['--config' => $path], $definition));
+ new ConfigOption('config')->get(new ArrayInput(['--config' => $path], $definition));
}
public function test_throwing_exception_when_config_file_does_not_exist(): void
@@ -62,6 +62,6 @@ public function test_throwing_exception_when_config_file_does_not_exist(): void
$this->expectException(InvalidArgumentException::class);
- (new ConfigOption('config'))->get(new ArrayInput(['--config' => 'non-existing-file.php'], $definition));
+ new ConfigOption('config')->get(new ArrayInput(['--config' => 'non-existing-file.php'], $definition));
}
}
diff --git a/src/cli/tests/Flow/CLI/Tests/Integration/PipelineRunCommandTest.php b/src/cli/tests/Flow/CLI/Tests/Integration/PipelineRunCommandTest.php
index 4c012c6d97..2abc1bde0f 100644
--- a/src/cli/tests/Flow/CLI/Tests/Integration/PipelineRunCommandTest.php
+++ b/src/cli/tests/Flow/CLI/Tests/Integration/PipelineRunCommandTest.php
@@ -19,7 +19,7 @@ public function test_config_option_is_not_accepted(): void
$this->expectException(InvalidOptionException::class);
$this->expectExceptionMessage('The "--config" option does not exist.');
- (new CommandTester(new PipelineRunCommand('run')))->execute([
+ new CommandTester(new PipelineRunCommand('run'))->execute([
'pipeline-file' => __DIR__ . '/Fixtures/pipeline.php',
'--config' => 'x.php',
]);
diff --git a/src/cli/tests/Flow/CLI/Tests/Integration/SchemaFormatCommandTest.php b/src/cli/tests/Flow/CLI/Tests/Integration/SchemaFormatCommandTest.php
index a49e75194a..3a1e94ce83 100644
--- a/src/cli/tests/Flow/CLI/Tests/Integration/SchemaFormatCommandTest.php
+++ b/src/cli/tests/Flow/CLI/Tests/Integration/SchemaFormatCommandTest.php
@@ -18,7 +18,7 @@ public function test_config_option_is_not_accepted(): void
$this->expectException(InvalidOptionException::class);
$this->expectExceptionMessage('The "--config" option does not exist.');
- (new CommandTester(new SchemaFormatCommand('schema:format')))->execute([
+ new CommandTester(new SchemaFormatCommand('schema:format'))->execute([
'input-schema-file' => __DIR__ . '/Fixtures/schema.json',
'--config' => 'x.php',
]);
diff --git a/src/cli/tests/Flow/CLI/Tests/Unit/Formatter/PipelineReportFormatterTest.php b/src/cli/tests/Flow/CLI/Tests/Unit/Formatter/PipelineReportFormatterTest.php
index 6bf6565ca6..827ad79078 100644
--- a/src/cli/tests/Flow/CLI/Tests/Unit/Formatter/PipelineReportFormatterTest.php
+++ b/src/cli/tests/Flow/CLI/Tests/Unit/Formatter/PipelineReportFormatterTest.php
@@ -18,13 +18,13 @@ final class PipelineReportFormatterTest extends FlowTestCase
{
public function test_a_launched_run_prints_the_worker_peak_and_the_peak_sum(): void
{
- $input = new ArrayInput(['pipeline-file' => 'pipeline.php'], (new PipelineRunCommand('run'))->getDefinition());
+ $input = new ArrayInput(['pipeline-file' => 'pipeline.php'], new PipelineRunCommand('run')->getDefinition());
$output = new BufferedOutput();
- (new PipelineReportFormatter(ReportMother::of(new Processes(Unit::fromMb(25), [
+ new PipelineReportFormatter(ReportMother::of(new Processes(Unit::fromMb(25), [
Unit::fromMb(40),
Unit::fromMb(41),
- ])), new SymfonyStyle($input, $output), $input))->format();
+ ])), new SymfonyStyle($input, $output), $input)->format();
$display = $output->fetch();
static::assertMatchesRegularExpression('/Heap Peak\s+[\d.]+ (B|KiB|MiB|GiB)\s/', $display);
@@ -35,14 +35,14 @@ public function test_a_launched_run_prints_the_worker_peak_and_the_peak_sum(): v
public function test_a_serial_run_prints_no_worker_rows(): void
{
- $input = new ArrayInput(['pipeline-file' => 'pipeline.php'], (new PipelineRunCommand('run'))->getDefinition());
+ $input = new ArrayInput(['pipeline-file' => 'pipeline.php'], new PipelineRunCommand('run')->getDefinition());
$output = new BufferedOutput();
- (new PipelineReportFormatter(
+ new PipelineReportFormatter(
ReportMother::of(new Processes(Unit::fromMb(25), [])),
new SymfonyStyle($input, $output),
$input,
- ))->format();
+ )->format();
$display = $output->fetch();
static::assertMatchesRegularExpression('/Process Peak\s+25\.0 MiB\s/', $display);
diff --git a/src/cli/tests/Flow/CLI/Tests/Unit/Options/FileFormatOptionTest.php b/src/cli/tests/Flow/CLI/Tests/Unit/Options/FileFormatOptionTest.php
index c0af1e6361..5edbe806d2 100644
--- a/src/cli/tests/Flow/CLI/Tests/Unit/Options/FileFormatOptionTest.php
+++ b/src/cli/tests/Flow/CLI/Tests/Unit/Options/FileFormatOptionTest.php
@@ -20,7 +20,7 @@ public function test_getting_format_from_option_for_path_with_extension(): void
$option = new InputOption('format', null, InputOption::VALUE_OPTIONAL);
$definition = new InputDefinition([$option]);
- static::assertSame(FileFormat::JSON, (new FileFormatOption(path(__DIR__ . '/file.csv'), 'format'))->get(
+ static::assertSame(FileFormat::JSON, new FileFormatOption(path(__DIR__ . '/file.csv'), 'format')->get(
new ArrayInput(['--format' => 'json'], $definition),
));
}
@@ -30,7 +30,7 @@ public function test_getting_format_from_option_for_path_without_extension(): vo
$option = new InputOption('format', null, InputOption::VALUE_OPTIONAL);
$definition = new InputDefinition([$option]);
- static::assertSame(FileFormat::JSON, (new FileFormatOption(path(__DIR__ . '/file'), 'format'))->get(
+ static::assertSame(FileFormat::JSON, new FileFormatOption(path(__DIR__ . '/file'), 'format')->get(
new ArrayInput(['--format' => 'json'], $definition),
));
}
@@ -42,7 +42,7 @@ public function test_getting_format_from_path(): void
static::assertSame(
FileFormat::CSV,
- (new FileFormatOption(path(__DIR__ . '/file.csv'), 'format'))->get(new ArrayInput([], $definition)),
+ new FileFormatOption(path(__DIR__ . '/file.csv'), 'format')->get(new ArrayInput([], $definition)),
);
}
@@ -52,6 +52,6 @@ public function test_getting_format_from_path_without_extension(): void
$definition = new InputDefinition([$option]);
$this->expectExceptionMessage("Option 'format' is required");
- (new FileFormatOption(path(__DIR__ . '/file'), 'format'))->get(new ArrayInput([], $definition));
+ new FileFormatOption(path(__DIR__ . '/file'), 'format')->get(new ArrayInput([], $definition));
}
}
diff --git a/src/cli/tests/Flow/CLI/Tests/Unit/Options/TypedOptionTest.php b/src/cli/tests/Flow/CLI/Tests/Unit/Options/TypedOptionTest.php
index 7a0839d099..f2e600e1ed 100644
--- a/src/cli/tests/Flow/CLI/Tests/Unit/Options/TypedOptionTest.php
+++ b/src/cli/tests/Flow/CLI/Tests/Unit/Options/TypedOptionTest.php
@@ -18,21 +18,21 @@ public function test_getting_bool_nullable_value(): void
$option = new InputOption('option', null, InputOption::VALUE_OPTIONAL);
$definition = new InputDefinition([$option]);
- static::assertTrue((new TypedOption('option'))->asBoolNullable(new ArrayInput([
+ static::assertTrue(new TypedOption('option')->asBoolNullable(new ArrayInput([
'--option' => 'true',
], $definition)));
- static::assertTrue((new TypedOption('option'))->asBoolNullable(new ArrayInput([
+ static::assertTrue(new TypedOption('option')->asBoolNullable(new ArrayInput([
'--option' => 'on',
], $definition)));
- static::assertTrue((new TypedOption('option'))->asBoolNullable(new ArrayInput([
+ static::assertTrue(new TypedOption('option')->asBoolNullable(new ArrayInput([
'--option' => '1',
], $definition)));
- static::assertTrue((new TypedOption('option'))->asBoolNullable(new ArrayInput(['--option' => 1], $definition)));
+ static::assertTrue(new TypedOption('option')->asBoolNullable(new ArrayInput(['--option' => 1], $definition)));
- static::assertNull((new TypedOption('option'))->asBoolNullable(new ArrayInput([
+ static::assertNull(new TypedOption('option')->asBoolNullable(new ArrayInput([
'--option' => 'lol',
], $definition)));
- static::assertNull((new TypedOption('option'))->asBoolNullable(new ArrayInput([], $definition)));
+ static::assertNull(new TypedOption('option')->asBoolNullable(new ArrayInput([], $definition)));
}
public function test_getting_bool_nullable_value_with_default_definition(): void
@@ -40,21 +40,21 @@ public function test_getting_bool_nullable_value_with_default_definition(): void
$option = new InputOption('option', null, InputOption::VALUE_OPTIONAL, '', false);
$definition = new InputDefinition([$option]);
- static::assertTrue((new TypedOption('option'))->asBoolNullable(new ArrayInput([
+ static::assertTrue(new TypedOption('option')->asBoolNullable(new ArrayInput([
'--option' => 'true',
], $definition)));
- static::assertTrue((new TypedOption('option'))->asBoolNullable(new ArrayInput([
+ static::assertTrue(new TypedOption('option')->asBoolNullable(new ArrayInput([
'--option' => 'on',
], $definition)));
- static::assertTrue((new TypedOption('option'))->asBoolNullable(new ArrayInput([
+ static::assertTrue(new TypedOption('option')->asBoolNullable(new ArrayInput([
'--option' => '1',
], $definition)));
- static::assertTrue((new TypedOption('option'))->asBoolNullable(new ArrayInput(['--option' => 1], $definition)));
+ static::assertTrue(new TypedOption('option')->asBoolNullable(new ArrayInput(['--option' => 1], $definition)));
- static::assertNull((new TypedOption('option'))->asBoolNullable(new ArrayInput([
+ static::assertNull(new TypedOption('option')->asBoolNullable(new ArrayInput([
'--option' => 'lol',
], $definition)));
- static::assertFalse((new TypedOption('option'))->asBoolNullable(new ArrayInput([], $definition)));
+ static::assertFalse(new TypedOption('option')->asBoolNullable(new ArrayInput([], $definition)));
}
public function test_getting_bool_value(): void
@@ -62,8 +62,8 @@ public function test_getting_bool_value(): void
$option = new InputOption('option', null, InputOption::VALUE_NONE);
$definition = new InputDefinition([$option]);
- static::assertTrue((new TypedOption('option'))->asBool(new ArrayInput(['--option' => null], $definition)));
- static::assertFalse((new TypedOption('option'))->asBool(new ArrayInput([], $definition)));
+ static::assertTrue(new TypedOption('option')->asBool(new ArrayInput(['--option' => null], $definition)));
+ static::assertFalse(new TypedOption('option')->asBool(new ArrayInput([], $definition)));
}
public function test_getting_int_value(): void
@@ -71,12 +71,12 @@ public function test_getting_int_value(): void
$option = new InputOption('option', null, InputOption::VALUE_REQUIRED);
$definition = new InputDefinition([$option]);
- static::assertSame(1, (new TypedOption('option'))->asInt(new ArrayInput(['--option' => '1'], $definition)));
- static::assertSame(1, (new TypedOption('option'))->asInt(new ArrayInput(['--option' => 1], $definition)));
- static::assertSame(10, (new TypedOption('option'))->asInt(new ArrayInput([], $definition), 10));
+ static::assertSame(1, new TypedOption('option')->asInt(new ArrayInput(['--option' => '1'], $definition)));
+ static::assertSame(1, new TypedOption('option')->asInt(new ArrayInput(['--option' => 1], $definition)));
+ static::assertSame(10, new TypedOption('option')->asInt(new ArrayInput([], $definition), 10));
$this->expectException(InvalidArgumentException::class);
- (new TypedOption('option'))->asInt(new ArrayInput([], $definition));
+ new TypedOption('option')->asInt(new ArrayInput([], $definition));
}
public function test_getting_list_of_strings(): void
@@ -84,11 +84,11 @@ public function test_getting_list_of_strings(): void
$option = new InputOption('option', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY);
$definition = new InputDefinition([$option]);
- static::assertEquals(['value1', 'value2', '1'], (new TypedOption('option'))->asListOfStrings(new ArrayInput(
+ static::assertEquals(['value1', 'value2', '1'], new TypedOption('option')->asListOfStrings(new ArrayInput(
['--option' => ['value1', 'value2', 1]],
$definition,
)));
- static::assertEquals([], (new TypedOption('option'))->asListOfStrings(new ArrayInput([], $definition)));
+ static::assertEquals([], new TypedOption('option')->asListOfStrings(new ArrayInput([], $definition)));
}
public function test_getting_list_of_strings_nullable(): void
@@ -96,11 +96,11 @@ public function test_getting_list_of_strings_nullable(): void
$option = new InputOption('option', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY);
$definition = new InputDefinition([$option]);
- static::assertEquals(['value1', 'value2'], (new TypedOption('option'))->asListOfStringsNullable(new ArrayInput(
+ static::assertEquals(['value1', 'value2'], new TypedOption('option')->asListOfStringsNullable(new ArrayInput(
['--option' => ['value1', 'value2']],
$definition,
)));
- static::assertNull((new TypedOption('option'))->asListOfStringsNullable(new ArrayInput([], $definition)));
+ static::assertNull(new TypedOption('option')->asListOfStringsNullable(new ArrayInput([], $definition)));
}
public function test_getting_string_value(): void
@@ -108,15 +108,15 @@ public function test_getting_string_value(): void
$option = new InputOption('option', null, InputOption::VALUE_REQUIRED);
$definition = new InputDefinition([$option]);
- static::assertSame('value', (new TypedOption('option'))->asString(new ArrayInput([
+ static::assertSame('value', new TypedOption('option')->asString(new ArrayInput([
'--option' => 'value',
], $definition)));
- static::assertSame('default value', (new TypedOption('option'))->asString(
+ static::assertSame('default value', new TypedOption('option')->asString(
new ArrayInput([], $definition),
'default value',
));
$this->expectException(InvalidArgumentException::class);
- (new TypedOption('option'))->asString(new ArrayInput([], $definition));
+ new TypedOption('option')->asString(new ArrayInput([], $definition));
}
}
diff --git a/src/core/etl/composer.json b/src/core/etl/composer.json
index c3c4b702b7..67181da3a0 100644
--- a/src/core/etl/composer.json
+++ b/src/core/etl/composer.json
@@ -9,17 +9,17 @@
"load"
],
"require": {
- "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0",
+ "php": "~8.5.0 || ~8.6.0",
"ext-json": "*",
"psr/clock": "^1.0",
- "brick/math": "^0.12 || ^0.13 || ^0.14 || ^0.15 || ^0.16 || ^0.17 || ^0.18 || ^1.0",
+ "brick/math": "^0.14.2 || ^0.15 || ^0.16 || ^0.17 || ^0.18 || ^1.0",
"composer-runtime-api": "^2.2",
"flow-php/telemetry": "self.version",
"flow-php/types": "self.version",
"flow-php/array-dot": "self.version",
"flow-php/filesystem": "self.version",
"psr/simple-cache": "^1.0 || ^2.0 || ^3.0",
- "symfony/string": "^6.4 || ^7.4 || ^8.0"
+ "symfony/string": "^7.4 || ^8.0"
},
"conflict": {
"ext-flow_php": "<0.45"
@@ -31,7 +31,7 @@
"require-dev": {
"ramsey/uuid": "^4.5",
"symfony/polyfill-mbstring": "^1.33",
- "symfony/uid": "^6.4 || ^7.4 || ^8.0"
+ "symfony/uid": "^7.4 || ^8.0"
},
"config": {
"optimize-autoloader": true,
diff --git a/src/core/etl/src/Flow/ETL/API/DataFrame.php b/src/core/etl/src/Flow/ETL/API/DataFrame.php
index 55494e5e41..9d28e89e74 100644
--- a/src/core/etl/src/Flow/ETL/API/DataFrame.php
+++ b/src/core/etl/src/Flow/ETL/API/DataFrame.php
@@ -769,7 +769,7 @@ public function withColumn(string|Definition $column, ScalarFunction|WindowFunct
return new self(
match (true) {
$reference instanceof WindowFunction => new Node\WindowColumn($this->root, $column, $reference),
- (new ExpandingFunctions())->in($reference) !== [] => new Node\ExpandColumn(
+ new ExpandingFunctions()->in($reference) !== [] => new Node\ExpandColumn(
$this->root,
$column,
$reference,
diff --git a/src/core/etl/src/Flow/ETL/DSL/functions.php b/src/core/etl/src/Flow/ETL/DSL/functions.php
index 0b4e5c902f..8fdc6b9229 100644
--- a/src/core/etl/src/Flow/ETL/DSL/functions.php
+++ b/src/core/etl/src/Flow/ETL/DSL/functions.php
@@ -1466,7 +1466,7 @@ function number_format(
#[DocumentationDSL(module: Module::CORE, type: DSLType::DATA_FRAME)]
function array_to_rows(array $data, Schema $schema, Backend $backend = new AdaptiveBackend()): Rows
{
- return (new RowsBuilder($schema, $backend))
+ return new RowsBuilder($schema, $backend)
->appendRecords($data)
->finish();
}
@@ -1618,7 +1618,7 @@ function schema(Definition ...$definitions): Schema
#[DocumentationDSL(module: Module::CORE, type: DSLType::HELPER)]
function schema_to_json(Schema $schema, bool $pretty = false): string
{
- return (new JsonSchemaFormatter($pretty))->format($schema);
+ return new JsonSchemaFormatter($pretty)->format($schema);
}
/**
@@ -1630,7 +1630,7 @@ function schema_to_php(
ValueFormatter $valueFormatter = new ValueFormatter(),
TypeFormatter $typeFormatter = new TypeFormatter(),
): string {
- return (new PHPSchemaFormatter($valueFormatter, $typeFormatter))->format($schema);
+ return new PHPSchemaFormatter($valueFormatter, $typeFormatter)->format($schema);
}
/**
@@ -1916,7 +1916,7 @@ function infer_schema(): SchemaInferenceBuilder
#[DocumentationDSL(module: Module::CORE, type: DSLType::DATA_FRAME)]
function execution_context(?Config $config = null): FlowContext
{
- return new FlowContext($config ?? (new ConfigBuilder())->build());
+ return new FlowContext($config ?? new ConfigBuilder()->build());
}
#[DocumentationDSL(module: Module::CORE, type: DSLType::DATA_FRAME)]
@@ -1928,7 +1928,7 @@ function flow_context(?Config $config = null): FlowContext
#[DocumentationDSL(module: Module::CORE, type: DSLType::DATA_FRAME)]
function config(): Config
{
- return (new ConfigBuilder())->build();
+ return new ConfigBuilder()->build();
}
#[DocumentationDSL(module: Module::CORE, type: DSLType::DATA_FRAME)]
diff --git a/src/core/etl/src/Flow/ETL/Flow.php b/src/core/etl/src/Flow/ETL/Flow.php
index 0fe157eafa..d5c5faec7b 100644
--- a/src/core/etl/src/Flow/ETL/Flow.php
+++ b/src/core/etl/src/Flow/ETL/Flow.php
@@ -24,7 +24,7 @@ public function __construct(Config|ConfigBuilder|null $config = null)
$config = $config->build();
}
- $this->config = $config ?: (new ConfigBuilder())->build();
+ $this->config = $config ?: new ConfigBuilder()->build();
}
public static function setUp(ConfigBuilder|Config $config): self
diff --git a/src/core/etl/src/Flow/ETL/Foundation/Calculator/Calculator.php b/src/core/etl/src/Flow/ETL/Foundation/Calculator/Calculator.php
index 5ca5a5df57..1754e0d350 100644
--- a/src/core/etl/src/Flow/ETL/Foundation/Calculator/Calculator.php
+++ b/src/core/etl/src/Flow/ETL/Foundation/Calculator/Calculator.php
@@ -15,7 +15,6 @@
use Flow\ETL\Foundation\Exception\InvalidArgumentException;
use function abs;
-use function defined;
use function floor;
use function ini_get;
use function is_finite;
@@ -87,30 +86,18 @@ public function divide(
$aDecimal = BigDecimal::of((string) $a);
$effectiveScale = $scale ?? $aDecimal->getScale();
- $useNewNaming = defined('Brick\Math\RoundingMode::Up');
-
// @mago-ignore analysis:possibly-invalid-argument
$result = $aDecimal->dividedBy(BigDecimal::of((string) $b), $effectiveScale, match ($rounding) {
- // @mago-ignore analysis:non-existent-class-constant
- Rounding::UP => $useNewNaming ? RoundingMode::Up : RoundingMode::UP,
- // @mago-ignore analysis:non-existent-class-constant
- Rounding::DOWN => $useNewNaming ? RoundingMode::Down : RoundingMode::DOWN,
- // @mago-ignore analysis:non-existent-class-constant
- Rounding::CEILING => $useNewNaming ? RoundingMode::Ceiling : RoundingMode::CEILING,
- // @mago-ignore analysis:non-existent-class-constant
- Rounding::FLOOR => $useNewNaming ? RoundingMode::Floor : RoundingMode::FLOOR,
- // @mago-ignore analysis:non-existent-class-constant
- Rounding::HALF_UP => $useNewNaming ? RoundingMode::HalfUp : RoundingMode::HALF_UP,
- // @mago-ignore analysis:non-existent-class-constant
- Rounding::HALF_DOWN => $useNewNaming ? RoundingMode::HalfDown : RoundingMode::HALF_DOWN,
- // @mago-ignore analysis:non-existent-class-constant
- Rounding::HALF_CEILING => $useNewNaming ? RoundingMode::HalfCeiling : RoundingMode::HALF_CEILING,
- // @mago-ignore analysis:non-existent-class-constant
- Rounding::HALF_FLOOR => $useNewNaming ? RoundingMode::HalfFloor : RoundingMode::HALF_FLOOR,
- // @mago-ignore analysis:non-existent-class-constant
- Rounding::HALF_EVEN => $useNewNaming ? RoundingMode::HalfEven : RoundingMode::HALF_EVEN,
- // @mago-ignore analysis:non-existent-class-constant
- default => $useNewNaming ? RoundingMode::Unnecessary : RoundingMode::UNNECESSARY,
+ Rounding::UP => RoundingMode::Up,
+ Rounding::DOWN => RoundingMode::Down,
+ Rounding::CEILING => RoundingMode::Ceiling,
+ Rounding::FLOOR => RoundingMode::Floor,
+ Rounding::HALF_UP => RoundingMode::HalfUp,
+ Rounding::HALF_DOWN => RoundingMode::HalfDown,
+ Rounding::HALF_CEILING => RoundingMode::HalfCeiling,
+ Rounding::HALF_FLOOR => RoundingMode::HalfFloor,
+ Rounding::HALF_EVEN => RoundingMode::HalfEven,
+ default => RoundingMode::Unnecessary,
});
return $result->toFloat();
diff --git a/src/core/etl/src/Flow/ETL/Foundation/Describe/ConfiguredFilesystem.php b/src/core/etl/src/Flow/ETL/Foundation/Describe/ConfiguredFilesystem.php
index 04e9147573..895550c702 100644
--- a/src/core/etl/src/Flow/ETL/Foundation/Describe/ConfiguredFilesystem.php
+++ b/src/core/etl/src/Flow/ETL/Foundation/Describe/ConfiguredFilesystem.php
@@ -26,7 +26,7 @@ public static function fromDescription(#[SensitiveParameter] array $data, Rebuil
{
$class = type_string()->assert($data['filesystem'] ?? null);
- if (!is_a($class, Filesystem::class, true) || (new ReflectionClass($class))->isAbstract()) {
+ if (!is_a($class, Filesystem::class, true) || new ReflectionClass($class)->isAbstract()) {
throw InvalidArgumentException::because('%s is not a concrete Filesystem', $class);
}
diff --git a/src/core/etl/src/Flow/ETL/Foundation/Describe/Rebuild.php b/src/core/etl/src/Flow/ETL/Foundation/Describe/Rebuild.php
index b5cead1882..26687f69bb 100644
--- a/src/core/etl/src/Flow/ETL/Foundation/Describe/Rebuild.php
+++ b/src/core/etl/src/Flow/ETL/Foundation/Describe/Rebuild.php
@@ -97,7 +97,7 @@ public function object(Description $description, string $type): object
);
}
- if ((new ReflectionClass($class))->isAbstract()) {
+ if (new ReflectionClass($class)->isAbstract()) {
throw InvalidArgumentException::because('%s is not a concrete class', $class);
}
diff --git a/src/core/etl/src/Flow/ETL/Foundation/Exception/ColumnMismatchException.php b/src/core/etl/src/Flow/ETL/Foundation/Exception/ColumnMismatchException.php
index 3c65dab734..606a8704a0 100644
--- a/src/core/etl/src/Flow/ETL/Foundation/Exception/ColumnMismatchException.php
+++ b/src/core/etl/src/Flow/ETL/Foundation/Exception/ColumnMismatchException.php
@@ -72,7 +72,7 @@ public static function valueDoesNotMatch(
: sprintf(
': could not convert %s (%s) to %s',
self::describe($value),
- (new TypeDetector())
+ new TypeDetector()
->detectType($value)
->toString(),
$type,
diff --git a/src/core/etl/src/Flow/ETL/Foundation/Exception/RequiredPHPVersionException.php b/src/core/etl/src/Flow/ETL/Foundation/Exception/RequiredPHPVersionException.php
deleted file mode 100644
index 9f45f3c1da..0000000000
--- a/src/core/etl/src/Flow/ETL/Foundation/Exception/RequiredPHPVersionException.php
+++ /dev/null
@@ -1,18 +0,0 @@
-closestTo($column, array_values($available)));
+ return new self($column, new SimilarNames()->closestTo($column, array_values($available)));
}
/**
diff --git a/src/core/etl/src/Flow/ETL/Functions/All.php b/src/core/etl/src/Flow/ETL/Functions/All.php
index a8089f2ea4..898a470535 100644
--- a/src/core/etl/src/Flow/ETL/Functions/All.php
+++ b/src/core/etl/src/Flow/ETL/Functions/All.php
@@ -102,7 +102,7 @@ public function withChildren(array $children): static
*/
public function returns(): Type
{
- return (new Nullability())->any(type_boolean(), ...array_map(
+ return new Nullability()->any(type_boolean(), ...array_map(
static fn(ScalarFunction $function): Type => $function->returns(),
$this->functions,
));
@@ -121,7 +121,7 @@ public function eval(Rows $rows, Backend $backend): Column
break;
}
- $truths = (new Selection($undecided))->truths($function, $rows, $backend);
+ $truths = new Selection($undecided)->truths($function, $rows, $backend);
foreach (array_keys($truths, null, true) as $k) {
$sawNull[$undecided[$k]] = true;
@@ -146,7 +146,7 @@ public function eval(Rows $rows, Backend $backend): Column
$ordered[] = $results[$i];
}
- return (new ResultColumn($backend))->of($this, $ordered);
+ return new ResultColumn($backend)->of($this, $ordered);
}
public function or(ScalarFunction $scalarFunction): Any
diff --git a/src/core/etl/src/Flow/ETL/Functions/Any.php b/src/core/etl/src/Flow/ETL/Functions/Any.php
index 4428f49ee2..4d86c31e1b 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Any.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Any.php
@@ -102,7 +102,7 @@ public function withChildren(array $children): static
*/
public function returns(): Type
{
- return (new Nullability())->any(type_boolean(), ...array_map(
+ return new Nullability()->any(type_boolean(), ...array_map(
static fn(ScalarFunction $function): Type => $function->returns(),
$this->functions,
));
@@ -121,7 +121,7 @@ public function eval(Rows $rows, Backend $backend): Column
break;
}
- $truths = (new Selection($undecided))->truths($function, $rows, $backend);
+ $truths = new Selection($undecided)->truths($function, $rows, $backend);
foreach (array_keys($truths, null, true) as $k) {
$sawNull[$undecided[$k]] = true;
@@ -146,7 +146,7 @@ public function eval(Rows $rows, Backend $backend): Column
$ordered[] = $results[$i];
}
- return (new ResultColumn($backend))->of($this, $ordered);
+ return new ResultColumn($backend)->of($this, $ordered);
}
public function or(ScalarFunction $scalarFunction): self
diff --git a/src/core/etl/src/Flow/ETL/Functions/Append.php b/src/core/etl/src/Flow/ETL/Functions/Append.php
index f0b8b98e17..d6fa2de189 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Append.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Append.php
@@ -75,8 +75,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
- $suffixes = (new Parameter($this->suffix))->asStrings($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
+ $suffixes = new Parameter($this->suffix)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -100,6 +100,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/ArrayExpand.php b/src/core/etl/src/Flow/ETL/Functions/ArrayExpand.php
index 2e1cd1b6b9..a9fd77b8c0 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ArrayExpand.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ArrayExpand.php
@@ -110,7 +110,7 @@ public function eval(Rows $rows, Backend $backend): Column
{
$lists = [];
- foreach ((new Parameter($this->ref))->asArrays($rows, $backend) as $array) {
+ foreach (new Parameter($this->ref)->asArrays($rows, $backend) as $array) {
if ($array === null) {
$lists[] = [];
@@ -128,6 +128,6 @@ public function eval(Rows $rows, Backend $backend): Column
};
}
- return (new ResultColumn($backend))->lists($this, $lists);
+ return new ResultColumn($backend)->lists($this, $lists);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/ArrayFilter.php b/src/core/etl/src/Flow/ETL/Functions/ArrayFilter.php
index b2c2c524ff..33f511e239 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ArrayFilter.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ArrayFilter.php
@@ -87,8 +87,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $arrays = (new Parameter($this->array))->asArrays($rows, $backend);
- $values = (new Parameter($this->value))->values($rows, $backend);
+ $arrays = new Parameter($this->array)->asArrays($rows, $backend);
+ $values = new Parameter($this->value)->values($rows, $backend);
$results = [];
$i = 0;
@@ -107,6 +107,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/ArrayGet.php b/src/core/etl/src/Flow/ETL/Functions/ArrayGet.php
index 11b3573649..9c5144afe0 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ArrayGet.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ArrayGet.php
@@ -118,13 +118,13 @@ public function returns(): Type
$type = $element->type;
}
- return $nullable ? (new TypeWidener())->nullable($type) : $type;
+ return $nullable ? new TypeWidener()->nullable($type) : $type;
}
public function eval(Rows $rows, Backend $backend): Column
{
try {
- $values = (new Parameter($this->ref))->asArrays($rows, $backend);
+ $values = new Parameter($this->ref)->asArrays($rows, $backend);
} catch (EvaluationException $e) {
throw new EvaluationException(
$e->rowIndex,
@@ -151,6 +151,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/ArrayGetCollection.php b/src/core/etl/src/Flow/ETL/Functions/ArrayGetCollection.php
index 403bf491c7..8f7bf14968 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ArrayGetCollection.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ArrayGetCollection.php
@@ -103,9 +103,9 @@ public static function fromFirst(ScalarFunction $ref, ScalarFunction|array $keys
public function eval(Rows $rows, Backend $backend): Column
{
try {
- $values = (new Parameter($this->ref))->asArrays($rows, $backend);
- $indexes = (new Parameter($this->index))->asStrings($rows, $backend);
- $keysList = (new Parameter($this->keys))->asArrays($rows, $backend);
+ $values = new Parameter($this->ref)->asArrays($rows, $backend);
+ $indexes = new Parameter($this->index)->asStrings($rows, $backend);
+ $keysList = new Parameter($this->keys)->asArrays($rows, $backend);
} catch (EvaluationException $e) {
throw new EvaluationException(
$e->rowIndex,
@@ -173,6 +173,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/ArrayKeep.php b/src/core/etl/src/Flow/ETL/Functions/ArrayKeep.php
index a903241d85..07bf6108c1 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ArrayKeep.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ArrayKeep.php
@@ -87,8 +87,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $arrays = (new Parameter($this->array))->asArrays($rows, $backend);
- $values = (new Parameter($this->value))->values($rows, $backend);
+ $arrays = new Parameter($this->array)->asArrays($rows, $backend);
+ $values = new Parameter($this->value)->values($rows, $backend);
$results = [];
$i = 0;
@@ -107,6 +107,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/ArrayKeyRename.php b/src/core/etl/src/Flow/ETL/Functions/ArrayKeyRename.php
index ecda1ea7e7..65e0da8b48 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ArrayKeyRename.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ArrayKeyRename.php
@@ -75,7 +75,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->ref))->asArrays($rows, $backend);
+ $values = new Parameter($this->ref)->asArrays($rows, $backend);
$results = [];
$i = 0;
@@ -91,6 +91,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/ArrayKeys.php b/src/core/etl/src/Flow/ETL/Functions/ArrayKeys.php
index da6d169178..08bee26f17 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ArrayKeys.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ArrayKeys.php
@@ -90,7 +90,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $arrays = (new Parameter($this->array))->asArrays($rows, $backend);
+ $arrays = new Parameter($this->array)->asArrays($rows, $backend);
$results = [];
$i = 0;
@@ -106,6 +106,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/ArrayKeysStyleConvert.php b/src/core/etl/src/Flow/ETL/Functions/ArrayKeysStyleConvert.php
index 239b5269e5..755d801922 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ArrayKeysStyleConvert.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ArrayKeysStyleConvert.php
@@ -149,7 +149,7 @@ public function converted(Type $type): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $arrays = (new Parameter($this->ref))->asArrays($rows, $backend);
+ $arrays = new Parameter($this->ref)->asArrays($rows, $backend);
$converter = new ArrayKeyConverter(fn(string $key): string => $this->style->convert($key));
$results = [];
$i = 0;
@@ -166,6 +166,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/ArrayMerge.php b/src/core/etl/src/Flow/ETL/Functions/ArrayMerge.php
index 3097c796e9..11c496c1c1 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ArrayMerge.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ArrayMerge.php
@@ -87,7 +87,7 @@ public function returns(): Type
if ($left instanceof ListType && $right instanceof ListType) {
return type_list(
- (new PromotingUnifier())->unify(
+ new PromotingUnifier()->unify(
$left->element(),
$right->element(),
) ?? throw InvalidTypeException::noCommonType($left->element(), $right->element()),
@@ -99,8 +99,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $lefts = (new Parameter($this->left))->asArrays($rows, $backend);
- $rights = (new Parameter($this->right))->asArrays($rows, $backend);
+ $lefts = new Parameter($this->left)->asArrays($rows, $backend);
+ $rights = new Parameter($this->right)->asArrays($rows, $backend);
$results = [];
$i = 0;
@@ -118,6 +118,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/ArrayMergeCollection.php b/src/core/etl/src/Flow/ETL/Functions/ArrayMergeCollection.php
index a84a912f8a..022d75b148 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ArrayMergeCollection.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ArrayMergeCollection.php
@@ -103,7 +103,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $arrays = (new Parameter($this->array))->asArrays($rows, $backend);
+ $arrays = new Parameter($this->array)->asArrays($rows, $backend);
$results = [];
$i = 0;
@@ -129,6 +129,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/ArrayPathExists.php b/src/core/etl/src/Flow/ETL/Functions/ArrayPathExists.php
index fdb9b25cc4..6085a50e9e 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ArrayPathExists.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ArrayPathExists.php
@@ -74,14 +74,14 @@ public function withChildren(array $children): static
*/
public function returns(): Type
{
- return (new Nullability())->any(type_boolean(), $this->array->returns(), $this->path->returns());
+ return new Nullability()->any(type_boolean(), $this->array->returns(), $this->path->returns());
}
public function eval(Rows $rows, Backend $backend): Column
{
try {
- $arrays = (new Parameter($this->array))->asArrays($rows, $backend);
- $paths = (new Parameter($this->path))->asStrings($rows, $backend);
+ $arrays = new Parameter($this->array)->asArrays($rows, $backend);
+ $paths = new Parameter($this->path)->asStrings($rows, $backend);
} catch (EvaluationException $e) {
throw new EvaluationException(
$e->rowIndex,
@@ -114,6 +114,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/ArrayReverse.php b/src/core/etl/src/Flow/ETL/Functions/ArrayReverse.php
index 13a8d10fbc..3a0e843e77 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ArrayReverse.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ArrayReverse.php
@@ -87,7 +87,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $arrays = (new Parameter($this->array))->asArrays($rows, $backend);
+ $arrays = new Parameter($this->array)->asArrays($rows, $backend);
$results = [];
$i = 0;
@@ -103,6 +103,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/ArraySort.php b/src/core/etl/src/Flow/ETL/Functions/ArraySort.php
index 494a35ec23..0b7bba6969 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ArraySort.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ArraySort.php
@@ -114,9 +114,9 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $arrays = (new Parameter($this->ref))->asArrays($rows, $backend);
- $flagsList = (new Parameter($this->flags))->asInts($rows, $backend);
- $recursives = (new Parameter($this->recursive))->asBooleans($rows, $backend);
+ $arrays = new Parameter($this->ref)->asArrays($rows, $backend);
+ $flagsList = new Parameter($this->flags)->asInts($rows, $backend);
+ $recursives = new Parameter($this->recursive)->asBooleans($rows, $backend);
$results = [];
$i = 0;
@@ -139,7 +139,7 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
/**
diff --git a/src/core/etl/src/Flow/ETL/Functions/ArrayUnpack.php b/src/core/etl/src/Flow/ETL/Functions/ArrayUnpack.php
index 0f49e8f91d..8a958d43d3 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ArrayUnpack.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ArrayUnpack.php
@@ -71,14 +71,14 @@ public function eval(Rows $rows, Backend $backend): Column
$i = 0;
try {
- foreach ((new Parameter($this->array))->asArrays($rows, $backend) as $i => $array) {
+ foreach (new Parameter($this->array)->asArrays($rows, $backend) as $i => $array) {
$results[] = $array ?? throw new InvalidArgumentException('array_unpack() requires a non-null array');
}
} catch (Exception $e) {
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
/**
diff --git a/src/core/etl/src/Flow/ETL/Functions/ArrayValues.php b/src/core/etl/src/Flow/ETL/Functions/ArrayValues.php
index dff7711a3a..3f74e9edba 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ArrayValues.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ArrayValues.php
@@ -87,7 +87,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $arrays = (new Parameter($this->array))->asArrays($rows, $backend);
+ $arrays = new Parameter($this->array)->asArrays($rows, $backend);
$results = [];
$i = 0;
@@ -103,6 +103,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Ascii.php b/src/core/etl/src/Flow/ETL/Functions/Ascii.php
index 50fbc2d104..cbc9b85757 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Ascii.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Ascii.php
@@ -69,7 +69,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $strings = (new Parameter($this->string))->asStrings($rows, $backend);
+ $strings = new Parameter($this->string)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -85,6 +85,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Average.php b/src/core/etl/src/Flow/ETL/Functions/Average.php
index 90c2e5e6ae..d61e3129ae 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Average.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Average.php
@@ -166,7 +166,7 @@ public function frameValues(Rows $partition, array $bounds, Backend $backend, Pr
public function values(Rows $partition, Backend $backend, Progress $progress): array
{
- return (new FrameAccumulation($this->window()->frame()))->values($this, $partition, $backend, $progress);
+ return new FrameAccumulation($this->window()->frame())->values($this, $partition, $backend, $progress);
}
public function over(Window $window): static
@@ -223,7 +223,7 @@ public function value(): ?float
return $sum === null
? null
- : (new Calculator())->divide($sum, $this->total->count(), $this->scale, $this->rounding);
+ : new Calculator()->divide($sum, $this->total->count(), $this->scale, $this->rounding);
}
public function toString(): string
diff --git a/src/core/etl/src/Flow/ETL/Functions/Between.php b/src/core/etl/src/Flow/ETL/Functions/Between.php
index ee61bf1565..ffc526d957 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Between.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Between.php
@@ -105,13 +105,13 @@ public function withOperands(array $operands): static
*/
public function returns(): Type
{
- (new ValueComparator())->assertAllTypesComparable([
+ new ValueComparator()->assertAllTypesComparable([
$this->value->returns(),
$this->lowerBoundRef->returns(),
$this->upperBoundRef->returns(),
], Operator::GREATER_THAN_EQUAL);
- return (new Nullability())->any(
+ return new Nullability()->any(
type_boolean(),
$this->value->returns(),
$this->lowerBoundRef->returns(),
@@ -122,7 +122,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $boundaries = (new Parameter($this->boundary))->asEnums($rows, $backend, Boundary::class);
+ $boundaries = new Parameter($this->boundary)->asEnums($rows, $backend, Boundary::class);
$columns = array_map(static fn(ScalarFunction $function): Column => $function->eval($rows, $backend), [
$this->value,
$this->lowerBoundRef,
@@ -151,6 +151,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/BinaryLength.php b/src/core/etl/src/Flow/ETL/Functions/BinaryLength.php
index e14595924d..f3473b6803 100644
--- a/src/core/etl/src/Flow/ETL/Functions/BinaryLength.php
+++ b/src/core/etl/src/Flow/ETL/Functions/BinaryLength.php
@@ -69,7 +69,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -85,6 +85,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/CallUserFunc.php b/src/core/etl/src/Flow/ETL/Functions/CallUserFunc.php
index b2409d6580..47292f3df4 100644
--- a/src/core/etl/src/Flow/ETL/Functions/CallUserFunc.php
+++ b/src/core/etl/src/Flow/ETL/Functions/CallUserFunc.php
@@ -115,8 +115,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $callables = (new Parameter($this->callable))->values($rows, $backend);
- $arguments = array_map(static fn(ScalarFunction $parameter): array => (new Parameter($parameter))->values(
+ $callables = new Parameter($this->callable)->values($rows, $backend);
+ $arguments = array_map(static fn(ScalarFunction $parameter): array => new Parameter($parameter)->values(
$rows,
$backend,
), $this->parameters);
@@ -146,6 +146,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Capitalize.php b/src/core/etl/src/Flow/ETL/Functions/Capitalize.php
index 6c428009bc..0ba17c821a 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Capitalize.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Capitalize.php
@@ -72,7 +72,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $strings = (new Parameter($this->string))->values($rows, $backend);
+ $strings = new Parameter($this->string)->values($rows, $backend);
$results = [];
$i = 0;
@@ -89,6 +89,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Cast.php b/src/core/etl/src/Flow/ETL/Functions/Cast.php
index a927489ec1..331cc5ffa4 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Cast.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Cast.php
@@ -140,7 +140,7 @@ public function eval(Rows $rows, Backend $backend): Column
/** @var list $bytes */
$bytes = $column->physicals();
$builder = $backend->builder(Definitions::of('value', type_string(), true));
- $builder->appendPhysicals((new TextValues())->uuids($bytes), $column->nullCount());
+ $builder->appendPhysicals(new TextValues()->uuids($bytes), $column->nullCount());
return $builder->finish();
}
@@ -148,7 +148,7 @@ public function eval(Rows $rows, Backend $backend): Column
/** @var list $physicals */
$physicals = $column->physicals();
- return (new ResultColumn($backend))->of($this, (new TextValues())->dateTimes(
+ return new ResultColumn($backend)->of($this, new TextValues()->dateTimes(
$type,
$physicals,
DateTimeInterface::RFC3339,
@@ -168,7 +168,7 @@ public function eval(Rows $rows, Backend $backend): Column
try {
// @mago-ignore analysis:mixed-assignment
- foreach ($values ?? (new Parameter($this->value))->values($rows, $backend) as $i => $value) {
+ foreach ($values ?? new Parameter($this->value)->values($rows, $backend) as $i => $value) {
if ($documents !== null && is_string($value)) {
// @mago-ignore analysis:mixed-assignment
$value = $documents->text($value) ?? $documents->fromPhysical($value);
@@ -188,6 +188,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Chunk.php b/src/core/etl/src/Flow/ETL/Functions/Chunk.php
index b9a480a69a..c21699568f 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Chunk.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Chunk.php
@@ -77,8 +77,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
- $sizes = (new Parameter($this->size))->asInts($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
+ $sizes = new Parameter($this->size)->asInts($rows, $backend);
$results = [];
$i = 0;
@@ -103,6 +103,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Coalesce.php b/src/core/etl/src/Flow/ETL/Functions/Coalesce.php
index fe0d77cc9c..d8263e2d97 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Coalesce.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Coalesce.php
@@ -73,7 +73,7 @@ public function returns(): Type
// SQL COALESCE is nullable only when every branch is - a null in one branch falls through.
return (
- (new PromotingUnifier())->unifyAll(
+ new PromotingUnifier()->unifyAll(
NullabilityRule::ALL,
...$branches,
) ?? throw InvalidTypeException::noCommonType(...$branches)
@@ -90,7 +90,7 @@ public function eval(Rows $rows, Backend $backend): Column
break;
}
- $column = (new Selection($pending))->evaluate($value, $rows, $backend);
+ $column = new Selection($pending)->evaluate($value, $rows, $backend);
$stillNull = [];
// @mago-ignore analysis:mixed-assignment
@@ -113,6 +113,6 @@ public function eval(Rows $rows, Backend $backend): Column
$results[] = $values[$i] ?? null;
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/CodePointLength.php b/src/core/etl/src/Flow/ETL/Functions/CodePointLength.php
index 15e91ef919..4e6e6d281e 100644
--- a/src/core/etl/src/Flow/ETL/Functions/CodePointLength.php
+++ b/src/core/etl/src/Flow/ETL/Functions/CodePointLength.php
@@ -69,7 +69,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -85,6 +85,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/CollapseWhitespace.php b/src/core/etl/src/Flow/ETL/Functions/CollapseWhitespace.php
index 00921f320c..b914684c41 100644
--- a/src/core/etl/src/Flow/ETL/Functions/CollapseWhitespace.php
+++ b/src/core/etl/src/Flow/ETL/Functions/CollapseWhitespace.php
@@ -69,7 +69,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -85,6 +85,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Combine.php b/src/core/etl/src/Flow/ETL/Functions/Combine.php
index c346b1dbbc..100ca110c5 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Combine.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Combine.php
@@ -96,8 +96,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $keysList = (new Parameter($this->keys))->asArrays($rows, $backend);
- $valuesList = (new Parameter($this->values))->asArrays($rows, $backend);
+ $keysList = new Parameter($this->keys)->asArrays($rows, $backend);
+ $valuesList = new Parameter($this->values)->asArrays($rows, $backend);
$results = [];
$i = 0;
@@ -139,6 +139,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Comparison.php b/src/core/etl/src/Flow/ETL/Functions/Comparison.php
index b8a74fbed9..59cb111b18 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Comparison.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Comparison.php
@@ -106,15 +106,11 @@ public function withOperands(array $operands): static
*/
public function returns(): Type
{
- (new ValueComparator())->assertComparableTypes(
- $this->left->returns(),
- $this->right->returns(),
- $this->operator,
- );
+ new ValueComparator()->assertComparableTypes($this->left->returns(), $this->right->returns(), $this->operator);
return $this->identity()
? type_boolean()
- : (new Nullability())->any(type_boolean(), $this->left->returns(), $this->right->returns());
+ : new Nullability()->any(type_boolean(), $this->left->returns(), $this->right->returns());
}
public function eval(Rows $rows, Backend $backend): Column
diff --git a/src/core/etl/src/Flow/ETL/Functions/Concat.php b/src/core/etl/src/Flow/ETL/Functions/Concat.php
index 0fb149a8ea..9b2edbb491 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Concat.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Concat.php
@@ -86,7 +86,7 @@ public function eval(Rows $rows, Backend $backend): Column
$arguments = [];
foreach ($this->refs as $ref) {
- $values = (new Parameter($ref))->values($rows, $backend);
+ $values = new Parameter($ref)->values($rows, $backend);
// a column of strings is taken as it is; anything else is cast once per column, not once per row
if (
@@ -112,7 +112,7 @@ public function eval(Rows $rows, Backend $backend): Column
$arguments[] = $cast;
}
- return (new ResultColumn($backend))->of(
+ return new ResultColumn($backend)->of(
$this,
$arguments === []
? array_fill(0, max(0, $rows->count()), '')
diff --git a/src/core/etl/src/Flow/ETL/Functions/ConcatWithSeparator.php b/src/core/etl/src/Flow/ETL/Functions/ConcatWithSeparator.php
index b2f8f55559..6d863ee157 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ConcatWithSeparator.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ConcatWithSeparator.php
@@ -88,8 +88,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $separators = (new Parameter($this->separator))->asStrings($rows, $backend);
- $arguments = array_map(static fn(ScalarFunction $ref): array => (new Parameter($ref))->values(
+ $separators = new Parameter($this->separator)->asStrings($rows, $backend);
+ $arguments = array_map(static fn(ScalarFunction $ref): array => new Parameter($ref)->values(
$rows,
$backend,
), $this->refs);
@@ -122,6 +122,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Contains.php b/src/core/etl/src/Flow/ETL/Functions/Contains.php
index decd0d5863..97b6d4d84b 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Contains.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Contains.php
@@ -76,7 +76,7 @@ public function withChildren(array $children): static
*/
public function returns(): Type
{
- return (new Nullability())->any(type_boolean(), $this->haystack->returns(), $this->needle->returns());
+ return new Nullability()->any(type_boolean(), $this->haystack->returns(), $this->needle->returns());
}
public function eval(Rows $rows, Backend $backend): Column
@@ -84,11 +84,11 @@ public function eval(Rows $rows, Backend $backend): Column
$haystack = $this->haystack->eval($rows, $backend);
if (type_bare($haystack->type()) instanceof StringType) {
- return $backend->contains($haystack, (new Parameter($this->needle))->asStringColumn($rows, $backend));
+ return $backend->contains($haystack, new Parameter($this->needle)->asStringColumn($rows, $backend));
}
- $haystacks = (new Parameter($this->haystack))->typesOf($haystack, type_string(), type_array());
- $needles = (new Parameter($this->needle))->asStrings($rows, $backend);
+ $haystacks = new Parameter($this->haystack)->typesOf($haystack, type_string(), type_array());
+ $needles = new Parameter($this->needle)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -114,6 +114,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Count.php b/src/core/etl/src/Flow/ETL/Functions/Count.php
index eb1cbbf512..5d7731ad72 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Count.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Count.php
@@ -190,7 +190,7 @@ public function frameValues(Rows $partition, array $bounds, Backend $backend, Pr
public function values(Rows $partition, Backend $backend, Progress $progress): array
{
- return (new FrameAccumulation($this->window()->frame()))->values($this, $partition, $backend, $progress);
+ return new FrameAccumulation($this->window()->frame())->values($this, $partition, $backend, $progress);
}
public function over(Window $window): static
diff --git a/src/core/etl/src/Flow/ETL/Functions/DOMElementAttributeValue.php b/src/core/etl/src/Flow/ETL/Functions/DOMElementAttributeValue.php
index 911a3fda26..1ea4170960 100644
--- a/src/core/etl/src/Flow/ETL/Functions/DOMElementAttributeValue.php
+++ b/src/core/etl/src/Flow/ETL/Functions/DOMElementAttributeValue.php
@@ -19,7 +19,6 @@
use Flow\Types\Type;
use SensitiveParameter;
-use function class_exists;
use function count;
use function Flow\Types\DSL\type_instance_of;
use function Flow\Types\DSL\type_list;
@@ -89,13 +88,11 @@ public function eval(Rows $rows, Backend $backend): Column
type_list(type_instance_of(DOMNode::class)),
];
- if (class_exists('\Dom\HTMLElement')) {
- $types[] = type_instance_of(HTMLElement::class);
- $types[] = type_list(type_instance_of(HTMLElement::class));
- }
+ $types[] = type_instance_of(HTMLElement::class);
+ $types[] = type_list(type_instance_of(HTMLElement::class));
- $nodes = (new Parameter($this->domElement))->asTypes($rows, $backend, ...$types);
- $attributeNames = (new Parameter($this->attribute))->asStrings($rows, $backend);
+ $nodes = new Parameter($this->domElement)->asTypes($rows, $backend, ...$types);
+ $attributeNames = new Parameter($this->attribute)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -147,6 +144,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/DOMElementAttributesCount.php b/src/core/etl/src/Flow/ETL/Functions/DOMElementAttributesCount.php
index b677325419..185e31d015 100644
--- a/src/core/etl/src/Flow/ETL/Functions/DOMElementAttributesCount.php
+++ b/src/core/etl/src/Flow/ETL/Functions/DOMElementAttributesCount.php
@@ -19,7 +19,6 @@
use Flow\Types\Type;
use SensitiveParameter;
-use function class_exists;
use function Flow\Types\DSL\type_instance_of;
use function Flow\Types\DSL\type_integer;
@@ -77,11 +76,9 @@ public function eval(Rows $rows, Backend $backend): Column
type_instance_of(DOMElement::class),
];
- if (class_exists('\Dom\HTMLElement')) {
- $types[] = type_instance_of(HTMLElement::class);
- }
+ $types[] = type_instance_of(HTMLElement::class);
- $domElements = (new Parameter($this->domElement))->asTypes($rows, $backend, ...$types);
+ $domElements = new Parameter($this->domElement)->asTypes($rows, $backend, ...$types);
$results = [];
$i = 0;
@@ -97,6 +94,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/DOMElementNamespaceValue.php b/src/core/etl/src/Flow/ETL/Functions/DOMElementNamespaceValue.php
index 7eb0bc6f22..7829461d25 100644
--- a/src/core/etl/src/Flow/ETL/Functions/DOMElementNamespaceValue.php
+++ b/src/core/etl/src/Flow/ETL/Functions/DOMElementNamespaceValue.php
@@ -23,7 +23,6 @@
use Flow\Types\Type;
use SensitiveParameter;
-use function class_exists;
use function count;
use function Flow\Types\DSL\type_instance_of;
use function Flow\Types\DSL\type_list;
@@ -93,13 +92,11 @@ public function eval(Rows $rows, Backend $backend): Column
type_list(type_instance_of(DOMNode::class)),
];
- if (class_exists('\Dom\Element')) {
- $types[] = type_instance_of(Element::class);
- $types[] = type_list(type_instance_of(Element::class));
- }
+ $types[] = type_instance_of(Element::class);
+ $types[] = type_list(type_instance_of(Element::class));
- $nodes = (new Parameter($this->domElement))->asTypes($rows, $backend, ...$types);
- $attributeNames = (new Parameter($this->attribute))->asStrings($rows, $backend);
+ $nodes = new Parameter($this->domElement)->asTypes($rows, $backend, ...$types);
+ $attributeNames = new Parameter($this->attribute)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -112,7 +109,7 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
/**
@@ -146,7 +143,6 @@ public function namespaceValue(mixed $node, ?string $attributeName): ?string
$document = $node->ownerDocument;
- // @mago-expect analysis:unavailable-class-like
$xpath = $document instanceof Document ? new XPath($document) : new DOMXPath($document);
foreach ($xpath->query('namespace::*') ?: [] as $nsNode) {
diff --git a/src/core/etl/src/Flow/ETL/Functions/DOMElementNextSibling.php b/src/core/etl/src/Flow/ETL/Functions/DOMElementNextSibling.php
index ec071200c5..b20e4ae95e 100644
--- a/src/core/etl/src/Flow/ETL/Functions/DOMElementNextSibling.php
+++ b/src/core/etl/src/Flow/ETL/Functions/DOMElementNextSibling.php
@@ -21,7 +21,6 @@
use Flow\Types\Type;
use SensitiveParameter;
-use function class_exists;
use function Flow\Types\DSL\type_instance_of;
use function Flow\Types\DSL\type_optional;
use function Flow\Types\DSL\type_xml_element;
@@ -80,12 +79,10 @@ public function eval(Rows $rows, Backend $backend): Column
type_instance_of(DOMNode::class),
];
- if (class_exists('\Dom\HTMLElement')) {
- $types[] = type_instance_of(CharacterData::class);
- $types[] = type_instance_of(HTMLElement::class);
- }
+ $types[] = type_instance_of(CharacterData::class);
+ $types[] = type_instance_of(HTMLElement::class);
- $nodes = (new Parameter($this->element))->asTypes($rows, $backend, ...$types);
+ $nodes = new Parameter($this->element)->asTypes($rows, $backend, ...$types);
$results = [];
$i = 0;
@@ -110,6 +107,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/DOMElementParent.php b/src/core/etl/src/Flow/ETL/Functions/DOMElementParent.php
index fdc2d3b3a7..159dd13399 100644
--- a/src/core/etl/src/Flow/ETL/Functions/DOMElementParent.php
+++ b/src/core/etl/src/Flow/ETL/Functions/DOMElementParent.php
@@ -20,7 +20,6 @@
use Flow\Types\Type;
use SensitiveParameter;
-use function class_exists;
use function Flow\Types\DSL\type_instance_of;
use function Flow\Types\DSL\type_optional;
use function Flow\Types\DSL\type_xml_element;
@@ -79,11 +78,9 @@ public function eval(Rows $rows, Backend $backend): Column
type_instance_of(DOMNode::class),
];
- if (class_exists('\Dom\HTMLElement')) {
- $types[] = type_instance_of(HTMLElement::class);
- }
+ $types[] = type_instance_of(HTMLElement::class);
- $nodes = (new Parameter($this->element))->asTypes($rows, $backend, ...$types);
+ $nodes = new Parameter($this->element)->asTypes($rows, $backend, ...$types);
$results = [];
$i = 0;
@@ -110,6 +107,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/DOMElementPreviousSibling.php b/src/core/etl/src/Flow/ETL/Functions/DOMElementPreviousSibling.php
index b4b859b28f..e54af40c03 100644
--- a/src/core/etl/src/Flow/ETL/Functions/DOMElementPreviousSibling.php
+++ b/src/core/etl/src/Flow/ETL/Functions/DOMElementPreviousSibling.php
@@ -21,7 +21,6 @@
use Flow\Types\Type;
use SensitiveParameter;
-use function class_exists;
use function Flow\Types\DSL\type_instance_of;
use function Flow\Types\DSL\type_optional;
use function Flow\Types\DSL\type_xml_element;
@@ -80,12 +79,10 @@ public function eval(Rows $rows, Backend $backend): Column
type_instance_of(DOMNode::class),
];
- if (class_exists('\Dom\HTMLElement')) {
- $types[] = type_instance_of(CharacterData::class);
- $types[] = type_instance_of(HTMLElement::class);
- }
+ $types[] = type_instance_of(CharacterData::class);
+ $types[] = type_instance_of(HTMLElement::class);
- $nodes = (new Parameter($this->element))->asTypes($rows, $backend, ...$types);
+ $nodes = new Parameter($this->element)->asTypes($rows, $backend, ...$types);
$results = [];
$i = 0;
@@ -110,6 +107,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/DOMElementValue.php b/src/core/etl/src/Flow/ETL/Functions/DOMElementValue.php
index 2cf7e2fa92..743f8f70f7 100644
--- a/src/core/etl/src/Flow/ETL/Functions/DOMElementValue.php
+++ b/src/core/etl/src/Flow/ETL/Functions/DOMElementValue.php
@@ -20,7 +20,6 @@
use Flow\Types\Type;
use SensitiveParameter;
-use function class_exists;
use function count;
use function Flow\Types\DSL\type_instance_of;
use function Flow\Types\DSL\type_list;
@@ -84,13 +83,11 @@ public function eval(Rows $rows, Backend $backend): Column
type_list(type_instance_of(DOMNode::class)),
];
- if (class_exists('\Dom\HTMLElement')) {
- $types[] = type_instance_of(CharacterData::class);
- $types[] = type_instance_of(HTMLElement::class);
- $types[] = type_list(type_instance_of(HTMLElement::class));
- }
+ $types[] = type_instance_of(CharacterData::class);
+ $types[] = type_instance_of(HTMLElement::class);
+ $types[] = type_list(type_instance_of(HTMLElement::class));
- $nodes = (new Parameter($this->node))->asTypes($rows, $backend, ...$types);
+ $nodes = new Parameter($this->node)->asTypes($rows, $backend, ...$types);
$results = [];
$i = 0;
@@ -122,6 +119,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/DateTimeFormat.php b/src/core/etl/src/Flow/ETL/Functions/DateTimeFormat.php
index 32dcf74067..973eff4226 100644
--- a/src/core/etl/src/Flow/ETL/Functions/DateTimeFormat.php
+++ b/src/core/etl/src/Flow/ETL/Functions/DateTimeFormat.php
@@ -99,16 +99,12 @@ public function eval(Rows $rows, Backend $backend): Column
);
}
- return (new ResultColumn($backend))->of($this, (new TextValues())->dateTimes(
- $type,
- $physicals,
- $format,
- ));
+ return new ResultColumn($backend)->of($this, new TextValues()->dateTimes($type, $physicals, $format));
}
}
- $values = (new Parameter($this->dateTime))->asInstancesOf($rows, $backend, DateTimeInterface::class);
- $formats = (new Parameter($this->format))->asStrings($rows, $backend);
+ $values = new Parameter($this->dateTime)->asInstancesOf($rows, $backend, DateTimeInterface::class);
+ $formats = new Parameter($this->format)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -126,6 +122,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/DenseRank.php b/src/core/etl/src/Flow/ETL/Functions/DenseRank.php
index 62dc6a5ac9..446366e187 100644
--- a/src/core/etl/src/Flow/ETL/Functions/DenseRank.php
+++ b/src/core/etl/src/Flow/ETL/Functions/DenseRank.php
@@ -75,7 +75,7 @@ public function values(Rows $partition, Backend $backend, Progress $progress): a
$rank = 1;
$unreported = 0;
- foreach ((new RowOrder($orderBy))->ties($partition) as $index => $peer) {
+ foreach (new RowOrder($orderBy)->ties($partition) as $index => $peer) {
if ($index > 0 && !$peer) {
$rank++;
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Divide.php b/src/core/etl/src/Flow/ETL/Functions/Divide.php
index d41ba82c4b..fe42aea986 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Divide.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Divide.php
@@ -88,10 +88,10 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $lefts = (new Parameter($this->left))->asNumbers($rows, $backend);
- $rights = (new Parameter($this->right))->asNumbers($rows, $backend);
- $scales = (new Parameter($this->scale))->asInts($rows, $backend);
- $roundings = (new Parameter($this->rounding))->asEnums($rows, $backend, Rounding::class);
+ $lefts = new Parameter($this->left)->asNumbers($rows, $backend);
+ $rights = new Parameter($this->right)->asNumbers($rows, $backend);
+ $scales = new Parameter($this->scale)->asInts($rows, $backend);
+ $roundings = new Parameter($this->rounding)->asEnums($rows, $backend, Rounding::class);
$calculator = new Calculator();
$results = [];
$i = 0;
@@ -114,6 +114,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/EndsWith.php b/src/core/etl/src/Flow/ETL/Functions/EndsWith.php
index 7973abd17e..d43b3b4409 100644
--- a/src/core/etl/src/Flow/ETL/Functions/EndsWith.php
+++ b/src/core/etl/src/Flow/ETL/Functions/EndsWith.php
@@ -66,14 +66,14 @@ public function withChildren(array $children): static
*/
public function returns(): Type
{
- return (new Nullability())->any(type_boolean(), $this->haystack->returns(), $this->needle->returns());
+ return new Nullability()->any(type_boolean(), $this->haystack->returns(), $this->needle->returns());
}
public function eval(Rows $rows, Backend $backend): Column
{
return $backend->endsWith(
- (new Parameter($this->haystack))->asStringColumn($rows, $backend),
- (new Parameter($this->needle))->asStringColumn($rows, $backend),
+ new Parameter($this->haystack)->asStringColumn($rows, $backend),
+ new Parameter($this->needle)->asStringColumn($rows, $backend),
);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/EnsureEnd.php b/src/core/etl/src/Flow/ETL/Functions/EnsureEnd.php
index 618bd960a1..70994485d9 100644
--- a/src/core/etl/src/Flow/ETL/Functions/EnsureEnd.php
+++ b/src/core/etl/src/Flow/ETL/Functions/EnsureEnd.php
@@ -75,8 +75,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
- $suffixes = (new Parameter($this->suffix))->asStrings($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
+ $suffixes = new Parameter($this->suffix)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -100,6 +100,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/EnsureStart.php b/src/core/etl/src/Flow/ETL/Functions/EnsureStart.php
index f38c2fe466..e4ab0e1e6e 100644
--- a/src/core/etl/src/Flow/ETL/Functions/EnsureStart.php
+++ b/src/core/etl/src/Flow/ETL/Functions/EnsureStart.php
@@ -75,8 +75,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
- $prefixes = (new Parameter($this->prefix))->asStrings($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
+ $prefixes = new Parameter($this->prefix)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -100,6 +100,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/EnumName.php b/src/core/etl/src/Flow/ETL/Functions/EnumName.php
index 25f07539d1..e35df23d75 100644
--- a/src/core/etl/src/Flow/ETL/Functions/EnumName.php
+++ b/src/core/etl/src/Flow/ETL/Functions/EnumName.php
@@ -69,7 +69,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $enums = (new Parameter($this->value))->values($rows, $backend);
+ $enums = new Parameter($this->value)->values($rows, $backend);
$results = [];
$i = 0;
@@ -86,6 +86,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/EnumValue.php b/src/core/etl/src/Flow/ETL/Functions/EnumValue.php
index f8a292ffd7..22e16e0101 100644
--- a/src/core/etl/src/Flow/ETL/Functions/EnumValue.php
+++ b/src/core/etl/src/Flow/ETL/Functions/EnumValue.php
@@ -78,14 +78,14 @@ public function returns(): Type
);
}
- $backingType = (new ReflectionEnum($value->class))->getBackingType();
+ $backingType = new ReflectionEnum($value->class)->getBackingType();
return $backingType !== null && $backingType->getName() === 'int' ? type_integer() : type_string();
}
public function eval(Rows $rows, Backend $backend): Column
{
- $enums = (new Parameter($this->value))->values($rows, $backend);
+ $enums = new Parameter($this->value)->values($rows, $backend);
$results = [];
$i = 0;
@@ -102,6 +102,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Evaluation/Filter.php b/src/core/etl/src/Flow/ETL/Functions/Evaluation/Filter.php
index 46d4ecbfa0..6679efbc6f 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Evaluation/Filter.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Evaluation/Filter.php
@@ -76,7 +76,7 @@ public function filter(Rows $rows, Backend $backend): Rows
break;
}
- $truths = array_keys((new Selection($kept))->truths($predicate, $rows, $backend), true, true);
+ $truths = array_keys(new Selection($kept)->truths($predicate, $rows, $backend), true, true);
if (count($kept) === $rows->count()) {
$kept = $truths;
diff --git a/src/core/etl/src/Flow/ETL/Functions/Evaluation/ResultColumn.php b/src/core/etl/src/Flow/ETL/Functions/Evaluation/ResultColumn.php
index 51e1b6124b..d5c886fdca 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Evaluation/ResultColumn.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Evaluation/ResultColumn.php
@@ -71,7 +71,7 @@ public function of(ScalarFunction $function, array $values): Column
*/
public function holdsLosslessly(Type $type): bool
{
- return (new PhysicalFor())->supports($type) && $this->keepsValues($type);
+ return new PhysicalFor()->supports($type) && $this->keepsValues($type);
}
/**
diff --git a/src/core/etl/src/Flow/ETL/Functions/Evaluation/Selection.php b/src/core/etl/src/Flow/ETL/Functions/Evaluation/Selection.php
index 26e4b85fa4..340dd60973 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Evaluation/Selection.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Evaluation/Selection.php
@@ -40,7 +40,7 @@ public function evaluate(ScalarFunction $function, Rows $rows, Backend $backend)
$names = [];
// only the columns $function reads are copied; a reference the batch lacks (e.g. inside on_each()) is not one
- foreach ((new ReferencedColumns())->in($function)->all() as $ref) {
+ foreach (new ReferencedColumns()->in($function)->all() as $ref) {
if ($schema->findDefinition($ref->to()) !== null) {
$names[] = $ref->to();
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Evaluation/TolerantEvaluation.php b/src/core/etl/src/Flow/ETL/Functions/Evaluation/TolerantEvaluation.php
index 16c3d7df6a..b1ca87d4e9 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Evaluation/TolerantEvaluation.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Evaluation/TolerantEvaluation.php
@@ -31,7 +31,7 @@ public function evaluate(ScalarFunction $function, Rows $rows, Backend $backend)
while (true) {
try {
// @mago-ignore analysis:mixed-assignment
- foreach ((new Selection($live))
+ foreach (new Selection($live)
->evaluate($function, $rows, $backend)
->values() as $k => $value) {
$values[$live[$k]] = $value;
diff --git a/src/core/etl/src/Flow/ETL/Functions/Exists.php b/src/core/etl/src/Flow/ETL/Functions/Exists.php
index 8f720ceb92..c6e2260af2 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Exists.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Exists.php
@@ -73,7 +73,7 @@ public function eval(Rows $rows, Backend $backend): Column
$exists = $rows->schema()->findDefinition($this->ref->name()) !== null;
// @mago-ignore analysis:possibly-invalid-argument
- return (new ResultColumn($backend))->of(
+ return new ResultColumn($backend)->of(
$this,
$rows->isEmpty() ? [] : array_fill(0, $rows->count(), $exists),
);
@@ -81,8 +81,8 @@ public function eval(Rows $rows, Backend $backend): Column
// the operand is left unresolved by the gate (children() is empty): a reference the batch lacks stays
// unresolved and throws, which is this function's "no"
- $failed = (new TolerantEvaluation())->evaluate(
- (new ReferenceResolver())->resolve($this->ref, $rows->schema()),
+ $failed = new TolerantEvaluation()->evaluate(
+ new ReferenceResolver()->resolve($this->ref, $rows->schema()),
$rows,
$backend,
)['failed'];
@@ -92,6 +92,6 @@ public function eval(Rows $rows, Backend $backend): Column
$results[] = !array_key_exists($i, $failed);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Greatest.php b/src/core/etl/src/Flow/ETL/Functions/Greatest.php
index a7888743ce..b5a957c84a 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Greatest.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Greatest.php
@@ -76,7 +76,7 @@ public function returns(): Type
// NULL only when every argument is NULL - nulls are skipped otherwise.
return (
- (new StrictUnifier())->unifyAll(
+ new StrictUnifier()->unifyAll(
NullabilityRule::ALL,
...$operands,
) ?? throw InvalidTypeException::noCommonType(...$operands)
@@ -111,6 +111,6 @@ public function eval(Rows $rows, Backend $backend): Column
$results[] = $greatest;
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/HTMLQuerySelector.php b/src/core/etl/src/Flow/ETL/Functions/HTMLQuerySelector.php
index 5c634f7cb3..ae3360cb92 100644
--- a/src/core/etl/src/Flow/ETL/Functions/HTMLQuerySelector.php
+++ b/src/core/etl/src/Flow/ETL/Functions/HTMLQuerySelector.php
@@ -11,7 +11,6 @@
use Flow\ETL\Foundation\Describe\Rebuild;
use Flow\ETL\Foundation\Exception\EvaluationException;
use Flow\ETL\Foundation\Exception\InvalidArgumentException;
-use Flow\ETL\Foundation\Exception\RequiredPHPVersionException;
use Flow\ETL\Functions\Evaluation\ResultColumn;
use Flow\ETL\Values\Column\Backend;
use Flow\ETL\Values\Column\Column;
@@ -19,7 +18,6 @@
use Flow\Types\Type;
use SensitiveParameter;
-use function class_exists;
use function Flow\Types\DSL\type_html_element;
use function Flow\Types\DSL\type_instance_of;
use function Flow\Types\DSL\type_optional;
@@ -33,10 +31,6 @@ final class HTMLQuerySelector implements ScalarFunction
public function __construct(mixed $value, ScalarFunction|string $selector)
{
- if (!class_exists('\Dom\HTMLDocument')) {
- throw new RequiredPHPVersionException('\Dom\HTMLDocument', '8.4');
- }
-
$this->value = $value instanceof ScalarFunction ? $value : new Literal($value);
$this->selector = $selector instanceof ScalarFunction ? $selector : new Literal($selector);
}
@@ -84,13 +78,13 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asTypes(
+ $values = new Parameter($this->value)->asTypes(
$rows,
$backend,
type_instance_of(HTMLDocument::class),
type_instance_of(HTMLElement::class),
);
- $selectors = (new Parameter($this->selector))->asStrings($rows, $backend);
+ $selectors = new Parameter($this->selector)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -112,6 +106,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/HTMLQuerySelectorAll.php b/src/core/etl/src/Flow/ETL/Functions/HTMLQuerySelectorAll.php
index d7f8a41802..e044f5aa0e 100644
--- a/src/core/etl/src/Flow/ETL/Functions/HTMLQuerySelectorAll.php
+++ b/src/core/etl/src/Flow/ETL/Functions/HTMLQuerySelectorAll.php
@@ -4,15 +4,14 @@
namespace Flow\ETL\Functions;
-use DOM\Element;
-use DOM\HTMLDocument;
+use Dom\Element;
+use Dom\HTMLDocument;
use Dom\HTMLElement;
use Exception;
use Flow\ETL\Foundation\Describe\Description;
use Flow\ETL\Foundation\Describe\Rebuild;
use Flow\ETL\Foundation\Exception\EvaluationException;
use Flow\ETL\Foundation\Exception\InvalidArgumentException;
-use Flow\ETL\Foundation\Exception\RequiredPHPVersionException;
use Flow\ETL\Functions\Evaluation\ResultColumn;
use Flow\ETL\Values\Column\Backend;
use Flow\ETL\Values\Column\Column;
@@ -20,7 +19,6 @@
use Flow\Types\Type;
use SensitiveParameter;
-use function class_exists;
use function Flow\Types\DSL\type_html_element;
use function Flow\Types\DSL\type_instance_of;
use function Flow\Types\DSL\type_list;
@@ -35,10 +33,6 @@ final class HTMLQuerySelectorAll implements ScalarFunction
public function __construct(mixed $value, ScalarFunction|string $selector)
{
- if (!class_exists('\Dom\HTMLDocument')) {
- throw new RequiredPHPVersionException('\Dom\HTMLDocument', '8.4');
- }
-
$this->value = $value instanceof ScalarFunction ? $value : new Literal($value);
$this->selector = $selector instanceof ScalarFunction ? $selector : new Literal($selector);
}
@@ -86,13 +80,13 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asTypes(
+ $values = new Parameter($this->value)->asTypes(
$rows,
$backend,
type_instance_of(HTMLDocument::class),
type_instance_of(HTMLElement::class),
);
- $selectors = (new Parameter($this->selector))->asStrings($rows, $backend);
+ $selectors = new Parameter($this->selector)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -132,6 +126,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Hash.php b/src/core/etl/src/Flow/ETL/Functions/Hash.php
index 8474acf67e..e42ece5e1d 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Hash.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Hash.php
@@ -110,6 +110,6 @@ private function texts(Column $column, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $texts);
+ return new ResultColumn($backend)->of($this, $texts);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/IndexOf.php b/src/core/etl/src/Flow/ETL/Functions/IndexOf.php
index 365b047f79..204f047dfc 100644
--- a/src/core/etl/src/Flow/ETL/Functions/IndexOf.php
+++ b/src/core/etl/src/Flow/ETL/Functions/IndexOf.php
@@ -88,10 +88,10 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $strings = (new Parameter($this->string))->asStrings($rows, $backend);
- $needles = (new Parameter($this->needle))->asStrings($rows, $backend);
- $offsets = (new Parameter($this->offset))->asTypes($rows, $backend, type_integer());
- $ignoreCases = (new Parameter($this->ignoreCase))->asBooleans($rows, $backend);
+ $strings = new Parameter($this->string)->asStrings($rows, $backend);
+ $needles = new Parameter($this->needle)->asStrings($rows, $backend);
+ $offsets = new Parameter($this->offset)->asTypes($rows, $backend, type_integer());
+ $ignoreCases = new Parameter($this->ignoreCase)->asBooleans($rows, $backend);
$results = [];
$i = 0;
@@ -120,6 +120,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/IndexOfLast.php b/src/core/etl/src/Flow/ETL/Functions/IndexOfLast.php
index 6ab7ea5196..d6933d9324 100644
--- a/src/core/etl/src/Flow/ETL/Functions/IndexOfLast.php
+++ b/src/core/etl/src/Flow/ETL/Functions/IndexOfLast.php
@@ -88,10 +88,10 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $strings = (new Parameter($this->string))->asStrings($rows, $backend);
- $needles = (new Parameter($this->needle))->asStrings($rows, $backend);
- $offsets = (new Parameter($this->offset))->asTypes($rows, $backend, type_integer());
- $ignoreCases = (new Parameter($this->ignoreCase))->asBooleans($rows, $backend);
+ $strings = new Parameter($this->string)->asStrings($rows, $backend);
+ $needles = new Parameter($this->needle)->asStrings($rows, $backend);
+ $offsets = new Parameter($this->offset)->asTypes($rows, $backend, type_integer());
+ $ignoreCases = new Parameter($this->ignoreCase)->asBooleans($rows, $backend);
$results = [];
$i = 0;
@@ -120,6 +120,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/IsEmpty.php b/src/core/etl/src/Flow/ETL/Functions/IsEmpty.php
index 9b25b43653..67eb0af8fb 100644
--- a/src/core/etl/src/Flow/ETL/Functions/IsEmpty.php
+++ b/src/core/etl/src/Flow/ETL/Functions/IsEmpty.php
@@ -64,12 +64,12 @@ public function withChildren(array $children): static
*/
public function returns(): Type
{
- return (new Nullability())->any(type_boolean(), $this->value->returns());
+ return new Nullability()->any(type_boolean(), $this->value->returns());
}
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -87,6 +87,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/IsIn.php b/src/core/etl/src/Flow/ETL/Functions/IsIn.php
index e401ef3e31..a73811aafc 100644
--- a/src/core/etl/src/Flow/ETL/Functions/IsIn.php
+++ b/src/core/etl/src/Flow/ETL/Functions/IsIn.php
@@ -104,7 +104,7 @@ public function returns(): Type
};
if ($declaredElement !== null) {
- (new ValueComparator())->assertComparableTypes($nullability->bare($needle), $declaredElement, '==');
+ new ValueComparator()->assertComparableTypes($nullability->bare($needle), $declaredElement, '==');
}
return $nullability->any(type_boolean(), $haystack, $needle);
@@ -112,9 +112,9 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- return (new ResultColumn($backend))->of($this, (new ValueEquality())->in(
+ return new ResultColumn($backend)->of($this, new ValueEquality()->in(
$this->needle->eval($rows, $backend),
- (new Parameter($this->haystack))->arraysOf($this->haystack->eval($rows, $backend)),
+ new Parameter($this->haystack)->arraysOf($this->haystack->eval($rows, $backend)),
$this->needle instanceof Reference ? $this->needle->to() : 'needle',
$this->haystack instanceof Reference ? $this->haystack->to() : 'haystack',
));
diff --git a/src/core/etl/src/Flow/ETL/Functions/IsNotNumeric.php b/src/core/etl/src/Flow/ETL/Functions/IsNotNumeric.php
index a1295c4636..502795e0ba 100644
--- a/src/core/etl/src/Flow/ETL/Functions/IsNotNumeric.php
+++ b/src/core/etl/src/Flow/ETL/Functions/IsNotNumeric.php
@@ -64,12 +64,12 @@ public function withChildren(array $children): static
*/
public function returns(): Type
{
- return (new Nullability())->any(type_boolean(), $this->value->returns());
+ return new Nullability()->any(type_boolean(), $this->value->returns());
}
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->values($rows, $backend);
+ $values = new Parameter($this->value)->values($rows, $backend);
$results = [];
$i = 0;
@@ -88,6 +88,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/IsNumeric.php b/src/core/etl/src/Flow/ETL/Functions/IsNumeric.php
index 08a06eaa73..4f452cdf9e 100644
--- a/src/core/etl/src/Flow/ETL/Functions/IsNumeric.php
+++ b/src/core/etl/src/Flow/ETL/Functions/IsNumeric.php
@@ -64,12 +64,12 @@ public function withChildren(array $children): static
*/
public function returns(): Type
{
- return (new Nullability())->any(type_boolean(), $this->value->returns());
+ return new Nullability()->any(type_boolean(), $this->value->returns());
}
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->values($rows, $backend);
+ $values = new Parameter($this->value)->values($rows, $backend);
$results = [];
$i = 0;
@@ -88,6 +88,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/IsType.php b/src/core/etl/src/Flow/ETL/Functions/IsType.php
index 37eae47296..f21032def8 100644
--- a/src/core/etl/src/Flow/ETL/Functions/IsType.php
+++ b/src/core/etl/src/Flow/ETL/Functions/IsType.php
@@ -87,7 +87,7 @@ public function withChildren(array $children): static
*/
public function returns(): Type
{
- return (new Nullability())->any(type_boolean(), $this->value->returns());
+ return new Nullability()->any(type_boolean(), $this->value->returns());
}
public function eval(Rows $rows, Backend $backend): Column
@@ -95,7 +95,7 @@ public function eval(Rows $rows, Backend $backend): Column
$results = [];
// @mago-ignore analysis:mixed-assignment
- foreach ((new Parameter($this->value))->values($rows, $backend) as $value) {
+ foreach (new Parameter($this->value)->values($rows, $backend) as $value) {
// A NULL operand is unknowable, even against type_null() - ->isNull() is the null test.
if ($value === null) {
$results[] = null;
@@ -114,6 +114,6 @@ public function eval(Rows $rows, Backend $backend): Column
$results[] = false;
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/IsUtf8.php b/src/core/etl/src/Flow/ETL/Functions/IsUtf8.php
index b1d345ed3c..aeec624131 100644
--- a/src/core/etl/src/Flow/ETL/Functions/IsUtf8.php
+++ b/src/core/etl/src/Flow/ETL/Functions/IsUtf8.php
@@ -64,12 +64,12 @@ public function withChildren(array $children): static
*/
public function returns(): Type
{
- return (new Nullability())->any(type_boolean(), $this->string->returns());
+ return new Nullability()->any(type_boolean(), $this->string->returns());
}
public function eval(Rows $rows, Backend $backend): Column
{
- $strings = (new Parameter($this->string))->asStrings($rows, $backend);
+ $strings = new Parameter($this->string)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -87,6 +87,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Join/Condition/Equal.php b/src/core/etl/src/Flow/ETL/Functions/Join/Condition/Equal.php
index f7adfaa495..0d7ef397e8 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Join/Condition/Equal.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Join/Condition/Equal.php
@@ -29,7 +29,7 @@ public function compare(Rows $left, Rows $right): array
$equal = [];
// SQL semantics - null never equals anything, including null
- foreach ((new ValueEquality())->equal(
+ foreach (new ValueEquality()->equal(
$left->column($this->left()[0]->base()),
$right->column($this->right()[0]->base()),
$this->left()[0]->name(),
diff --git a/src/core/etl/src/Flow/ETL/Functions/Join/Condition/Identical.php b/src/core/etl/src/Flow/ETL/Functions/Join/Condition/Identical.php
index e175c81993..7ea37f937b 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Join/Condition/Identical.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Join/Condition/Identical.php
@@ -30,7 +30,7 @@ public function compare(Rows $left, Rows $right): array
$result = [];
// SQL semantics - null never equals anything, including null
- foreach ((new ValueEquality())->identical(
+ foreach (new ValueEquality()->identical(
$leftColumn,
$right->column($this->right()[0]->base()),
) as $i => $identical) {
diff --git a/src/core/etl/src/Flow/ETL/Functions/JsonDecode.php b/src/core/etl/src/Flow/ETL/Functions/JsonDecode.php
index 8c21a02151..2fea1e4141 100644
--- a/src/core/etl/src/Flow/ETL/Functions/JsonDecode.php
+++ b/src/core/etl/src/Flow/ETL/Functions/JsonDecode.php
@@ -79,8 +79,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->values($rows, $backend);
- $flagsList = (new Parameter($this->flags))->asInts($rows, $backend);
+ $values = new Parameter($this->value)->values($rows, $backend);
+ $flagsList = new Parameter($this->flags)->asInts($rows, $backend);
$results = [];
$i = 0;
@@ -130,6 +130,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/JsonEncode.php b/src/core/etl/src/Flow/ETL/Functions/JsonEncode.php
index 182cb87426..afe938d838 100644
--- a/src/core/etl/src/Flow/ETL/Functions/JsonEncode.php
+++ b/src/core/etl/src/Flow/ETL/Functions/JsonEncode.php
@@ -97,8 +97,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->values($rows, $backend);
- $flagsList = (new Parameter($this->flags))->asInts($rows, $backend);
+ $values = new Parameter($this->value)->values($rows, $backend);
+ $flagsList = new Parameter($this->flags)->asInts($rows, $backend);
$results = [];
$i = 0;
@@ -137,6 +137,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Least.php b/src/core/etl/src/Flow/ETL/Functions/Least.php
index 7cd6c78b6d..ac806a78a1 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Least.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Least.php
@@ -76,7 +76,7 @@ public function returns(): Type
// NULL only when every argument is NULL - nulls are skipped otherwise.
return (
- (new StrictUnifier())->unifyAll(
+ new StrictUnifier()->unifyAll(
NullabilityRule::ALL,
...$operands,
) ?? throw InvalidTypeException::noCommonType(...$operands)
@@ -111,6 +111,6 @@ public function eval(Rows $rows, Backend $backend): Column
$results[] = $least;
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/ListSelect.php b/src/core/etl/src/Flow/ETL/Functions/ListSelect.php
index 7eb13ff4c3..904436547a 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ListSelect.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ListSelect.php
@@ -126,7 +126,7 @@ public function returns(): Type
}
$elements[] = $element instanceof MapType
- ? structure_element($selected->name(), (new TypeWidener())->nullable($element->value()))
+ ? structure_element($selected->name(), new TypeWidener()->nullable($element->value()))
: structure_element($selected->name(), type_null());
}
@@ -137,7 +137,7 @@ public function eval(Rows $rows, Backend $backend): Column
{
if ($rows->schema()->findDefinition($this->ref->base()) === null) {
// @mago-ignore analysis:possibly-invalid-argument
- return (new ResultColumn($backend))->of($this, $rows->isEmpty() ? [] : array_fill(0, $rows->count(), null));
+ return new ResultColumn($backend)->of($this, $rows->isEmpty() ? [] : array_fill(0, $rows->count(), null));
}
$results = [];
@@ -168,6 +168,6 @@ public function eval(Rows $rows, Backend $backend): Column
$results[] = $output;
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Literal.php b/src/core/etl/src/Flow/ETL/Functions/Literal.php
index dcfb41761b..57e6e3b9c6 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Literal.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Literal.php
@@ -65,7 +65,7 @@ public function __construct(
public static function fromDescription(#[SensitiveParameter] array $data, Rebuild $rebuild): static
{
- return new self((new LiteralValue())->decode(type_array()->assert($data['value'] ?? null)));
+ return new self(new LiteralValue()->decode(type_array()->assert($data['value'] ?? null)));
}
/**
@@ -81,7 +81,7 @@ public function children(): array
*/
public function describe(): ?Description
{
- $value = (new LiteralValue())->encode($this->value);
+ $value = new LiteralValue()->encode($this->value);
return $value === null ? null : new Description(self::class, ['value' => $value]);
}
@@ -101,7 +101,7 @@ public function withChildren(array $children): static
public function returns(): Type
{
// lit(null) is a nullable null column - a bare NullType would count as NOT NULL.
- return $this->value === null ? type_optional(type_null()) : (new TypeDetector())->detectType($this->value);
+ return $this->value === null ? type_optional(type_null()) : new TypeDetector()->detectType($this->value);
}
public function eval(Rows $rows, Backend $backend): Column
@@ -115,7 +115,7 @@ public function eval(Rows $rows, Backend $backend): Column
$type = $type instanceof NullType ? $type : type_optional($type);
// @mago-ignore analysis:possibly-invalid-argument
- return $this->column = (new ResultColumn($backend))->holdsLosslessly($type)
+ return $this->column = new ResultColumn($backend)->holdsLosslessly($type)
? $backend->constant(Definitions::of('value', $type), $this->value, $rows->count())
: new ValueColumn($rows->isEmpty() ? [] : array_fill(0, $rows->count(), $this->value));
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/LiteralValue.php b/src/core/etl/src/Flow/ETL/Functions/LiteralValue.php
index 412606d840..ca2ed91628 100644
--- a/src/core/etl/src/Flow/ETL/Functions/LiteralValue.php
+++ b/src/core/etl/src/Flow/ETL/Functions/LiteralValue.php
@@ -177,7 +177,7 @@ public function decode(array $encoded): mixed
public function encode(mixed $value): ?array
{
try {
- $type = (new TypeDetector())->detectType($value);
+ $type = new TypeDetector()->detectType($value);
} catch (Throwable) {
return null;
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/MatchCases.php b/src/core/etl/src/Flow/ETL/Functions/MatchCases.php
index c3d1ddd28e..e51f71e657 100644
--- a/src/core/etl/src/Flow/ETL/Functions/MatchCases.php
+++ b/src/core/etl/src/Flow/ETL/Functions/MatchCases.php
@@ -109,7 +109,7 @@ public function returns(): Type
}
return (
- (new PromotingUnifier())->unifyAll(
+ new PromotingUnifier()->unifyAll(
NullabilityRule::ANY,
...$branches,
) ?? throw InvalidTypeException::noCommonType(...$branches)
@@ -139,7 +139,7 @@ public function eval(Rows $rows, Backend $backend): Column
if ($taken !== []) {
// @mago-ignore analysis:mixed-assignment
- foreach ((new Selection($taken))
+ foreach (new Selection($taken)
->evaluate($case, $rows, $backend)
->values() as $k => $value) {
$values[$taken[$k]] = $value;
@@ -161,7 +161,7 @@ public function eval(Rows $rows, Backend $backend): Column
}
// @mago-ignore analysis:mixed-assignment
- foreach ((new Selection($pending))
+ foreach (new Selection($pending)
->evaluate($this->default, $rows, $backend)
->values() as $k => $value) {
$values[$pending[$k]] = $value;
@@ -174,6 +174,6 @@ public function eval(Rows $rows, Backend $backend): Column
$results[] = $values[$i] ?? null;
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/MatchCases/MatchCondition.php b/src/core/etl/src/Flow/ETL/Functions/MatchCases/MatchCondition.php
index e5ef3ac18a..d29c08a9f7 100644
--- a/src/core/etl/src/Flow/ETL/Functions/MatchCases/MatchCondition.php
+++ b/src/core/etl/src/Flow/ETL/Functions/MatchCases/MatchCondition.php
@@ -109,7 +109,7 @@ public function eval(Rows $rows, Backend $backend): Column
*/
public function valid(Rows $rows, array $indices, Backend $backend): array
{
- $column = (new Selection($indices))->evaluate($this->condition, $rows, $backend);
+ $column = new Selection($indices)->evaluate($this->condition, $rows, $backend);
$valid = [];
// @mago-ignore analysis:mixed-assignment
diff --git a/src/core/etl/src/Flow/ETL/Functions/Minus.php b/src/core/etl/src/Flow/ETL/Functions/Minus.php
index c6599f5033..858812bc58 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Minus.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Minus.php
@@ -98,13 +98,13 @@ public function eval(Rows $rows, Backend $backend): Column
{
if (!$this->exact) {
return $backend->subtract(
- (new Parameter($this->left))->asNumberColumn($rows, $backend),
- (new Parameter($this->right))->asNumberColumn($rows, $backend),
+ new Parameter($this->left)->asNumberColumn($rows, $backend),
+ new Parameter($this->right)->asNumberColumn($rows, $backend),
);
}
- $lefts = (new Parameter($this->left))->asNumbers($rows, $backend);
- $rights = (new Parameter($this->right))->asNumbers($rows, $backend);
+ $lefts = new Parameter($this->left)->asNumbers($rows, $backend);
+ $rights = new Parameter($this->right)->asNumbers($rows, $backend);
$calculator = new Calculator();
$results = [];
$i = 0;
@@ -123,6 +123,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Mod.php b/src/core/etl/src/Flow/ETL/Functions/Mod.php
index f07c869210..199aebb35b 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Mod.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Mod.php
@@ -71,8 +71,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
return $backend->modulo(
- (new Parameter($this->left))->asIntegerColumn($rows, $backend),
- (new Parameter($this->right))->asIntegerColumn($rows, $backend),
+ new Parameter($this->left)->asIntegerColumn($rows, $backend),
+ new Parameter($this->right)->asIntegerColumn($rows, $backend),
);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/ModifyDateTime.php b/src/core/etl/src/Flow/ETL/Functions/ModifyDateTime.php
index 3165395c9c..2366846a5d 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ModifyDateTime.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ModifyDateTime.php
@@ -82,8 +82,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->reference))->asInstancesOf($rows, $backend, DateTimeInterface::class);
- $modifiers = (new Parameter($this->modifier))->asStrings($rows, $backend);
+ $values = new Parameter($this->reference)->asInstancesOf($rows, $backend, DateTimeInterface::class);
+ $modifiers = new Parameter($this->modifier)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -104,6 +104,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Multiply.php b/src/core/etl/src/Flow/ETL/Functions/Multiply.php
index 6e44125317..23948034cf 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Multiply.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Multiply.php
@@ -98,13 +98,13 @@ public function eval(Rows $rows, Backend $backend): Column
{
if (!$this->exact) {
return $backend->multiply(
- (new Parameter($this->left))->asNumberColumn($rows, $backend),
- (new Parameter($this->right))->asNumberColumn($rows, $backend),
+ new Parameter($this->left)->asNumberColumn($rows, $backend),
+ new Parameter($this->right)->asNumberColumn($rows, $backend),
);
}
- $lefts = (new Parameter($this->left))->asNumbers($rows, $backend);
- $rights = (new Parameter($this->right))->asNumbers($rows, $backend);
+ $lefts = new Parameter($this->left)->asNumbers($rows, $backend);
+ $rights = new Parameter($this->right)->asNumbers($rows, $backend);
$calculator = new Calculator();
$results = [];
$i = 0;
@@ -123,6 +123,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Not.php b/src/core/etl/src/Flow/ETL/Functions/Not.php
index 9553b2a334..3f9c7b7610 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Not.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Not.php
@@ -58,7 +58,7 @@ public function withChildren(array $children): static
*/
public function returns(): Type
{
- return (new Nullability())->any(type_boolean(), $this->value->returns());
+ return new Nullability()->any(type_boolean(), $this->value->returns());
}
public function eval(Rows $rows, Backend $backend): Column
@@ -66,11 +66,11 @@ public function eval(Rows $rows, Backend $backend): Column
$results = [];
// @mago-ignore analysis:mixed-assignment
- foreach ((new Parameter($this->value))->values($rows, $backend) as $value) {
+ foreach (new Parameter($this->value)->values($rows, $backend) as $value) {
// SQL NOT NULL is NULL - the row must drop, not flip to true.
$results[] = $value === null ? null : !$value;
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Now.php b/src/core/etl/src/Flow/ETL/Functions/Now.php
index a8bbd86ffb..4b88cc4057 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Now.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Now.php
@@ -81,7 +81,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $tzes = (new Parameter($this->timeZone))->asInstancesOf($rows, $backend, DateTimeZone::class);
+ $tzes = new Parameter($this->timeZone)->asInstancesOf($rows, $backend, DateTimeZone::class);
$results = [];
$i = 0;
@@ -97,6 +97,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/NumberFormat.php b/src/core/etl/src/Flow/ETL/Functions/NumberFormat.php
index 9662be8fed..96f2dc4ca5 100644
--- a/src/core/etl/src/Flow/ETL/Functions/NumberFormat.php
+++ b/src/core/etl/src/Flow/ETL/Functions/NumberFormat.php
@@ -91,10 +91,10 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asNumbers($rows, $backend);
- $decimalsList = (new Parameter($this->decimals))->asInts($rows, $backend);
- $decimalSeparators = (new Parameter($this->decimalSeparator))->asStrings($rows, $backend);
- $thousandsSeparators = (new Parameter($this->thousandsSeparator))->asStrings($rows, $backend);
+ $values = new Parameter($this->value)->asNumbers($rows, $backend);
+ $decimalsList = new Parameter($this->decimals)->asInts($rows, $backend);
+ $decimalSeparators = new Parameter($this->decimalSeparator)->asStrings($rows, $backend);
+ $thousandsSeparators = new Parameter($this->thousandsSeparator)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -119,6 +119,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/OnEach.php b/src/core/etl/src/Flow/ETL/Functions/OnEach.php
index b272c847af..d6270832d0 100644
--- a/src/core/etl/src/Flow/ETL/Functions/OnEach.php
+++ b/src/core/etl/src/Flow/ETL/Functions/OnEach.php
@@ -48,7 +48,7 @@ public function __construct(
private readonly bool $preserveKeys = true,
private readonly OnEachElementSchema $elementSchema = new OnEachElementSchema(),
) {
- (new ExpandingFunctions())->refuse($function, 'onEach');
+ new ExpandingFunctions()->refuse($function, 'onEach');
$this->array = $array instanceof ScalarFunction ? $array : new Literal($array);
}
@@ -102,7 +102,7 @@ public function bound(): array
$arrayType = type_bare($this->array->returns());
$schema = $this->elementSchema->of($arrayType);
- $body = (new ReferenceResolver())->bind($this->function, $schema, 'onEach');
+ $body = new ReferenceResolver()->bind($this->function, $schema, 'onEach');
$this->bound = [$schema, $body, type_optional($this->typeOver($arrayType, $body))];
}
@@ -151,7 +151,7 @@ public function typeOver(Type $arrayType, ScalarFunction $body): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $arrays = (new Parameter($this->array))->asArrays($rows, $backend);
+ $arrays = new Parameter($this->array)->asArrays($rows, $backend);
$elements = [];
/** @var list $rowOf the row of $rows every element comes from */
@@ -172,8 +172,8 @@ public function eval(Rows $rows, Backend $backend): Column
[$elementSchema, $body, $type] = $this->bound();
try {
- $results = (new Parameter($body))->values(
- (new RowsBuilder($elementSchema, $backend))
+ $results = new Parameter($body)->values(
+ new RowsBuilder($elementSchema, $backend)
->appendRecords($elements)
->finish(),
$backend,
@@ -199,6 +199,6 @@ public function eval(Rows $rows, Backend $backend): Column
$output[] = $values;
}
- return (new ResultColumn($backend))->typed($type, $output);
+ return new ResultColumn($backend)->typed($type, $output);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Optional.php b/src/core/etl/src/Flow/ETL/Functions/Optional.php
index 134d464e60..e79d8b03d3 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Optional.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Optional.php
@@ -64,13 +64,13 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $evaluated = (new TolerantEvaluation())->evaluate($this->function, $rows, $backend);
+ $evaluated = new TolerantEvaluation()->evaluate($this->function, $rows, $backend);
$results = [];
for ($i = 0, $count = $rows->count(); $i < $count; $i++) {
$results[] = array_key_exists($i, $evaluated['failed']) ? null : $evaluated['values'][$i];
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Plus.php b/src/core/etl/src/Flow/ETL/Functions/Plus.php
index 25a6c515bd..1cbee72d76 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Plus.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Plus.php
@@ -98,13 +98,13 @@ public function eval(Rows $rows, Backend $backend): Column
{
if (!$this->exact) {
return $backend->add(
- (new Parameter($this->left))->asNumberColumn($rows, $backend),
- (new Parameter($this->right))->asNumberColumn($rows, $backend),
+ new Parameter($this->left)->asNumberColumn($rows, $backend),
+ new Parameter($this->right)->asNumberColumn($rows, $backend),
);
}
- $lefts = (new Parameter($this->left))->asNumbers($rows, $backend);
- $rights = (new Parameter($this->right))->asNumbers($rows, $backend);
+ $lefts = new Parameter($this->left)->asNumbers($rows, $backend);
+ $rights = new Parameter($this->right)->asNumbers($rows, $backend);
$calculator = new Calculator();
$results = [];
$i = 0;
@@ -123,6 +123,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Power.php b/src/core/etl/src/Flow/ETL/Functions/Power.php
index ee30aff979..1eb76f0f12 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Power.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Power.php
@@ -98,8 +98,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $lefts = (new Parameter($this->left))->asNumbers($rows, $backend);
- $rights = (new Parameter($this->right))->asInts($rows, $backend);
+ $lefts = new Parameter($this->left)->asNumbers($rows, $backend);
+ $rights = new Parameter($this->right)->asInts($rows, $backend);
$calculator = new Calculator();
$results = [];
$i = 0;
@@ -134,6 +134,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Prepend.php b/src/core/etl/src/Flow/ETL/Functions/Prepend.php
index 94c620ad55..936eea6aeb 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Prepend.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Prepend.php
@@ -75,8 +75,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
- $prefixes = (new Parameter($this->prefix))->asStrings($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
+ $prefixes = new Parameter($this->prefix)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -100,6 +100,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/RandomString.php b/src/core/etl/src/Flow/ETL/Functions/RandomString.php
index 065708d939..ecc62e9ea3 100644
--- a/src/core/etl/src/Flow/ETL/Functions/RandomString.php
+++ b/src/core/etl/src/Flow/ETL/Functions/RandomString.php
@@ -92,7 +92,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $lengths = (new Parameter($this->length))->asInts($rows, $backend);
+ $lengths = new Parameter($this->length)->asInts($rows, $backend);
$results = [];
$i = 0;
@@ -108,6 +108,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Rank.php b/src/core/etl/src/Flow/ETL/Functions/Rank.php
index bfd7a43fa4..3923f7a263 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Rank.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Rank.php
@@ -75,7 +75,7 @@ public function values(Rows $partition, Backend $backend, Progress $progress): a
$rank = 1;
$unreported = 0;
- foreach ((new RowOrder($orderBy))->ties($partition) as $index => $peer) {
+ foreach (new RowOrder($orderBy)->ties($partition) as $index => $peer) {
if ($index > 0 && !$peer) {
$rank = $index + 1;
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Reference/References.php b/src/core/etl/src/Flow/ETL/Functions/Reference/References.php
index fe0d75fbf8..28ee305f1c 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Reference/References.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Reference/References.php
@@ -51,7 +51,7 @@ public function __construct(string|Reference ...$references)
public static function fromDescription(#[SensitiveParameter] array $data, Rebuild $rebuild): static
{
- return (new self(...$rebuild->all($data['refs'] ?? null, Reference::class)))->without(
+ return new self(...$rebuild->all($data['refs'] ?? null, Reference::class))->without(
...type_list(type_string())->assert($data['without'] ?? null),
);
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/ReferenceResolver.php b/src/core/etl/src/Flow/ETL/Functions/ReferenceResolver.php
index 7fc3ac91c9..4e5f872832 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ReferenceResolver.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ReferenceResolver.php
@@ -59,7 +59,7 @@ public function resolve(FunctionTree $function, Schema $schema): FunctionTree
// @mago-ignore analysis:less-specific-return-statement - withChildren(): static preserves
// the node's class, which the analyzer cannot unify with T.
- return (new TemporalStringCoercion())->coerce(
+ return new TemporalStringCoercion()->coerce(
$resolved === $children ? $function : $function->withChildren($resolved),
);
}
@@ -82,7 +82,7 @@ public function bind(FunctionTree $function, Schema $schema, string $method, ?Ty
{
$resolved = $this->resolve($function, $schema);
$this->assertResolved($resolved, $schema);
- (new ExpandingFunctions())->refuse($resolved, $method);
+ new ExpandingFunctions()->refuse($resolved, $method);
// type_bare() keeps the gate blind to nullability - a null-propagating predicate declares ?boolean
if (
diff --git a/src/core/etl/src/Flow/ETL/Functions/Regex.php b/src/core/etl/src/Flow/ETL/Functions/Regex.php
index 66ee44441d..0cdfeb0b77 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Regex.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Regex.php
@@ -97,9 +97,9 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $patterns = (new Parameter($this->pattern))->asStrings($rows, $backend);
- $subjects = (new Parameter($this->subject))->asStrings($rows, $backend);
- $offsets = (new Parameter($this->offset))->asInts($rows, $backend);
+ $patterns = new Parameter($this->pattern)->asStrings($rows, $backend);
+ $subjects = new Parameter($this->subject)->asStrings($rows, $backend);
+ $offsets = new Parameter($this->offset)->asInts($rows, $backend);
$results = [];
$i = 0;
@@ -135,6 +135,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/RegexAll.php b/src/core/etl/src/Flow/ETL/Functions/RegexAll.php
index 297413abdb..cec0aaca76 100644
--- a/src/core/etl/src/Flow/ETL/Functions/RegexAll.php
+++ b/src/core/etl/src/Flow/ETL/Functions/RegexAll.php
@@ -101,9 +101,9 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $patterns = (new Parameter($this->pattern))->asStrings($rows, $backend);
- $subjects = (new Parameter($this->subject))->asStrings($rows, $backend);
- $offsets = (new Parameter($this->offset))->asInts($rows, $backend);
+ $patterns = new Parameter($this->pattern)->asStrings($rows, $backend);
+ $subjects = new Parameter($this->subject)->asStrings($rows, $backend);
+ $offsets = new Parameter($this->offset)->asInts($rows, $backend);
$results = [];
$i = 0;
@@ -145,6 +145,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/RegexMatch.php b/src/core/etl/src/Flow/ETL/Functions/RegexMatch.php
index 0f78db432c..3cfad27064 100644
--- a/src/core/etl/src/Flow/ETL/Functions/RegexMatch.php
+++ b/src/core/etl/src/Flow/ETL/Functions/RegexMatch.php
@@ -85,7 +85,7 @@ public function withChildren(array $children): static
*/
public function returns(): Type
{
- return (new Nullability())->any(
+ return new Nullability()->any(
type_boolean(),
$this->pattern->returns(),
$this->subject->returns(),
@@ -96,10 +96,10 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $patterns = (new Parameter($this->pattern))->asStrings($rows, $backend);
- $subjects = (new Parameter($this->subject))->asStrings($rows, $backend);
- $flagsList = (new Parameter($this->flags))->asInts($rows, $backend);
- $offsets = (new Parameter($this->offset))->asInts($rows, $backend);
+ $patterns = new Parameter($this->pattern)->asStrings($rows, $backend);
+ $subjects = new Parameter($this->subject)->asStrings($rows, $backend);
+ $flagsList = new Parameter($this->flags)->asInts($rows, $backend);
+ $offsets = new Parameter($this->offset)->asInts($rows, $backend);
$results = [];
$i = 0;
@@ -121,6 +121,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/RegexMatchAll.php b/src/core/etl/src/Flow/ETL/Functions/RegexMatchAll.php
index 0e22832832..d00277aa8e 100644
--- a/src/core/etl/src/Flow/ETL/Functions/RegexMatchAll.php
+++ b/src/core/etl/src/Flow/ETL/Functions/RegexMatchAll.php
@@ -85,7 +85,7 @@ public function withChildren(array $children): static
*/
public function returns(): Type
{
- return (new Nullability())->any(
+ return new Nullability()->any(
type_boolean(),
$this->pattern->returns(),
$this->subject->returns(),
@@ -96,10 +96,10 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $patterns = (new Parameter($this->pattern))->asStrings($rows, $backend);
- $subjects = (new Parameter($this->subject))->asStrings($rows, $backend);
- $flagsList = (new Parameter($this->flags))->asInts($rows, $backend);
- $offsets = (new Parameter($this->offset))->asInts($rows, $backend);
+ $patterns = new Parameter($this->pattern)->asStrings($rows, $backend);
+ $subjects = new Parameter($this->subject)->asStrings($rows, $backend);
+ $flagsList = new Parameter($this->flags)->asInts($rows, $backend);
+ $offsets = new Parameter($this->offset)->asInts($rows, $backend);
$results = [];
$i = 0;
@@ -122,6 +122,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/RegexReplace.php b/src/core/etl/src/Flow/ETL/Functions/RegexReplace.php
index f888299f53..4aaa862167 100644
--- a/src/core/etl/src/Flow/ETL/Functions/RegexReplace.php
+++ b/src/core/etl/src/Flow/ETL/Functions/RegexReplace.php
@@ -100,10 +100,10 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $patterns = (new Parameter($this->pattern))->asStrings($rows, $backend);
- $replacements = (new Parameter($this->replacement))->asStrings($rows, $backend);
- $subjects = (new Parameter($this->subject))->asStrings($rows, $backend);
- $limits = (new Parameter($this->limit))->asInts($rows, $backend);
+ $patterns = new Parameter($this->pattern)->asStrings($rows, $backend);
+ $replacements = new Parameter($this->replacement)->asStrings($rows, $backend);
+ $subjects = new Parameter($this->subject)->asStrings($rows, $backend);
+ $limits = new Parameter($this->limit)->asInts($rows, $backend);
$results = [];
$i = 0;
@@ -137,6 +137,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Repeat.php b/src/core/etl/src/Flow/ETL/Functions/Repeat.php
index 3cadaa8877..7e5077a22b 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Repeat.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Repeat.php
@@ -75,8 +75,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
- $timesList = (new Parameter($this->times))->asInts($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
+ $timesList = new Parameter($this->times)->asInts($rows, $backend);
$results = [];
$i = 0;
@@ -98,6 +98,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Reverse.php b/src/core/etl/src/Flow/ETL/Functions/Reverse.php
index 2d03b269c9..f8d68c623f 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Reverse.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Reverse.php
@@ -69,7 +69,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -85,6 +85,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Round.php b/src/core/etl/src/Flow/ETL/Functions/Round.php
index 028ed7026d..45558c8b01 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Round.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Round.php
@@ -82,9 +82,9 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asNumbers($rows, $backend);
- $precisions = (new Parameter($this->precision))->asInts($rows, $backend);
- $modes = (new Parameter($this->mode))->asInts($rows, $backend);
+ $values = new Parameter($this->value)->asNumbers($rows, $backend);
+ $precisions = new Parameter($this->precision)->asInts($rows, $backend);
+ $modes = new Parameter($this->mode)->asInts($rows, $backend);
$results = [];
$i = 0;
@@ -110,6 +110,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Sanitize.php b/src/core/etl/src/Flow/ETL/Functions/Sanitize.php
index c23757bf6b..34f40afd75 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Sanitize.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Sanitize.php
@@ -86,9 +86,9 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $vals = (new Parameter($this->value))->asStrings($rows, $backend);
- $placeholders = (new Parameter($this->placeholder))->asStrings($rows, $backend);
- $skipCharactersList = (new Parameter($this->skipCharacters))->asInts($rows, $backend);
+ $vals = new Parameter($this->value)->asStrings($rows, $backend);
+ $placeholders = new Parameter($this->placeholder)->asStrings($rows, $backend);
+ $skipCharactersList = new Parameter($this->skipCharacters)->asInts($rows, $backend);
$results = [];
$i = 0;
@@ -120,6 +120,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Size.php b/src/core/etl/src/Flow/ETL/Functions/Size.php
index b5edd530bb..4b79712147 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Size.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Size.php
@@ -72,7 +72,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->values($rows, $backend);
+ $values = new Parameter($this->value)->values($rows, $backend);
$results = [];
$i = 0;
@@ -97,6 +97,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Slug.php b/src/core/etl/src/Flow/ETL/Functions/Slug.php
index b2b4d5b170..1af7ef9924 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Slug.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Slug.php
@@ -90,10 +90,10 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $strings = (new Parameter($this->string))->asStrings($rows, $backend);
- $separators = (new Parameter($this->separator))->asStrings($rows, $backend, '-');
- $locales = (new Parameter($this->locale))->asStrings($rows, $backend);
- $symbolsMaps = (new Parameter($this->symbolsMap))->asArrays($rows, $backend);
+ $strings = new Parameter($this->string)->asStrings($rows, $backend);
+ $separators = new Parameter($this->separator)->asStrings($rows, $backend, '-');
+ $locales = new Parameter($this->locale)->asStrings($rows, $backend);
+ $symbolsMaps = new Parameter($this->symbolsMap)->asArrays($rows, $backend);
$results = [];
$i = 0;
@@ -107,7 +107,7 @@ public function eval(Rows $rows, Backend $backend): Column
throw new InvalidArgumentException('Slug function requires non-null value');
}
- $results[] = (new AsciiSlugger(symbolsMap: $symbolsMap))
+ $results[] = new AsciiSlugger(symbolsMap: $symbolsMap)
->slug($string, $separator, $locale)
->toString();
}
@@ -115,6 +115,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Split.php b/src/core/etl/src/Flow/ETL/Functions/Split.php
index f1b543a592..3b93d6b1e5 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Split.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Split.php
@@ -85,9 +85,9 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
- $separators = (new Parameter($this->separator))->asStrings($rows, $backend);
- $limits = (new Parameter($this->limit))->asInts($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
+ $separators = new Parameter($this->separator)->asStrings($rows, $backend);
+ $limits = new Parameter($this->limit)->asInts($rows, $backend);
$results = [];
$i = 0;
@@ -115,6 +115,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Sprintf.php b/src/core/etl/src/Flow/ETL/Functions/Sprintf.php
index 4b184697cd..b850175c0d 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Sprintf.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Sprintf.php
@@ -88,8 +88,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $formats = (new Parameter($this->format))->asStrings($rows, $backend);
- $arguments = array_map(static fn(ScalarFunction $value): array => (new Parameter($value))->values(
+ $formats = new Parameter($this->format)->asStrings($rows, $backend);
+ $arguments = array_map(static fn(ScalarFunction $value): array => new Parameter($value)->values(
$rows,
$backend,
), $this->values);
@@ -116,6 +116,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/StartsWith.php b/src/core/etl/src/Flow/ETL/Functions/StartsWith.php
index 5aca19c674..568602bee3 100644
--- a/src/core/etl/src/Flow/ETL/Functions/StartsWith.php
+++ b/src/core/etl/src/Flow/ETL/Functions/StartsWith.php
@@ -66,14 +66,14 @@ public function withChildren(array $children): static
*/
public function returns(): Type
{
- return (new Nullability())->any(type_boolean(), $this->haystack->returns(), $this->needle->returns());
+ return new Nullability()->any(type_boolean(), $this->haystack->returns(), $this->needle->returns());
}
public function eval(Rows $rows, Backend $backend): Column
{
return $backend->startsWith(
- (new Parameter($this->haystack))->asStringColumn($rows, $backend),
- (new Parameter($this->needle))->asStringColumn($rows, $backend),
+ new Parameter($this->haystack)->asStringColumn($rows, $backend),
+ new Parameter($this->needle)->asStringColumn($rows, $backend),
);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/StrPad.php b/src/core/etl/src/Flow/ETL/Functions/StrPad.php
index 5e57026940..413daa7d8b 100644
--- a/src/core/etl/src/Flow/ETL/Functions/StrPad.php
+++ b/src/core/etl/src/Flow/ETL/Functions/StrPad.php
@@ -87,10 +87,10 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
- $lengths = (new Parameter($this->length))->asInts($rows, $backend);
- $padStrings = (new Parameter($this->padString))->asStrings($rows, $backend);
- $types = (new Parameter($this->type))->asInts($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
+ $lengths = new Parameter($this->length)->asInts($rows, $backend);
+ $padStrings = new Parameter($this->padString)->asStrings($rows, $backend);
+ $types = new Parameter($this->type)->asInts($rows, $backend);
$results = [];
$i = 0;
@@ -114,6 +114,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/StrReplace.php b/src/core/etl/src/Flow/ETL/Functions/StrReplace.php
index 33c531e881..c92fa0f237 100644
--- a/src/core/etl/src/Flow/ETL/Functions/StrReplace.php
+++ b/src/core/etl/src/Flow/ETL/Functions/StrReplace.php
@@ -89,9 +89,9 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
- $searches = (new Parameter($this->search))->asTypes($rows, $backend, type_string(), type_array());
- $replaces = (new Parameter($this->replace))->asTypes($rows, $backend, type_string(), type_array());
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
+ $searches = new Parameter($this->search)->asTypes($rows, $backend, type_string(), type_array());
+ $replaces = new Parameter($this->replace)->asTypes($rows, $backend, type_string(), type_array());
$results = [];
$i = 0;
@@ -118,6 +118,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/String/StringStyles.php b/src/core/etl/src/Flow/ETL/Functions/String/StringStyles.php
index 12b20254d9..28244cbea0 100644
--- a/src/core/etl/src/Flow/ETL/Functions/String/StringStyles.php
+++ b/src/core/etl/src/Flow/ETL/Functions/String/StringStyles.php
@@ -8,7 +8,6 @@
use Symfony\Component\String\Slugger\AsciiSlugger;
use Symfony\Component\String\UnicodeString;
-use function function_exists;
use function implode;
use function mb_internal_encoding;
use function mb_strlen;
@@ -89,21 +88,14 @@ private function kebab(string $value): string
private function slug(string $string): string
{
- return (new AsciiSlugger())
+ return new AsciiSlugger()
->slug($string)
->toString();
}
private function ucFirst(string $string): string
{
- // Available from PHP 8.4+
- if (function_exists('mb_ucfirst')) {
- return mb_ucfirst($string);
- }
-
- $encoding = mb_internal_encoding();
-
- return mb_strtoupper(mb_substr($string, 0, 1, $encoding), $encoding) . mb_substr($string, 1, null, $encoding);
+ return mb_ucfirst($string);
}
private function ucWords(string $string): string
diff --git a/src/core/etl/src/Flow/ETL/Functions/StringAfter.php b/src/core/etl/src/Flow/ETL/Functions/StringAfter.php
index 2ccc2ec0e7..dbc54a5070 100644
--- a/src/core/etl/src/Flow/ETL/Functions/StringAfter.php
+++ b/src/core/etl/src/Flow/ETL/Functions/StringAfter.php
@@ -84,9 +84,9 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $strings = (new Parameter($this->string))->asStrings($rows, $backend);
- $needles = (new Parameter($this->needle))->asStrings($rows, $backend);
- $includeNeedles = (new Parameter($this->includeNeedle))->asBooleans($rows, $backend);
+ $strings = new Parameter($this->string)->asStrings($rows, $backend);
+ $needles = new Parameter($this->needle)->asStrings($rows, $backend);
+ $includeNeedles = new Parameter($this->includeNeedle)->asBooleans($rows, $backend);
$results = [];
$i = 0;
@@ -103,6 +103,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/StringAfterLast.php b/src/core/etl/src/Flow/ETL/Functions/StringAfterLast.php
index f8f62ca63d..64c593a219 100644
--- a/src/core/etl/src/Flow/ETL/Functions/StringAfterLast.php
+++ b/src/core/etl/src/Flow/ETL/Functions/StringAfterLast.php
@@ -84,9 +84,9 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $strings = (new Parameter($this->string))->asStrings($rows, $backend);
- $needles = (new Parameter($this->needle))->asStrings($rows, $backend);
- $includeNeedles = (new Parameter($this->includeNeedle))->asBooleans($rows, $backend);
+ $strings = new Parameter($this->string)->asStrings($rows, $backend);
+ $needles = new Parameter($this->needle)->asStrings($rows, $backend);
+ $includeNeedles = new Parameter($this->includeNeedle)->asBooleans($rows, $backend);
$results = [];
$i = 0;
@@ -103,6 +103,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/StringBefore.php b/src/core/etl/src/Flow/ETL/Functions/StringBefore.php
index 286c157fdd..0d27d1bac3 100644
--- a/src/core/etl/src/Flow/ETL/Functions/StringBefore.php
+++ b/src/core/etl/src/Flow/ETL/Functions/StringBefore.php
@@ -84,9 +84,9 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $strings = (new Parameter($this->string))->asStrings($rows, $backend);
- $needles = (new Parameter($this->needle))->asStrings($rows, $backend);
- $includeNeedles = (new Parameter($this->includeNeedle))->asBooleans($rows, $backend);
+ $strings = new Parameter($this->string)->asStrings($rows, $backend);
+ $needles = new Parameter($this->needle)->asStrings($rows, $backend);
+ $includeNeedles = new Parameter($this->includeNeedle)->asBooleans($rows, $backend);
$results = [];
$i = 0;
@@ -103,6 +103,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/StringBeforeLast.php b/src/core/etl/src/Flow/ETL/Functions/StringBeforeLast.php
index 3dfc4e8773..2bd423dbcf 100644
--- a/src/core/etl/src/Flow/ETL/Functions/StringBeforeLast.php
+++ b/src/core/etl/src/Flow/ETL/Functions/StringBeforeLast.php
@@ -84,9 +84,9 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $strings = (new Parameter($this->string))->asStrings($rows, $backend);
- $needles = (new Parameter($this->needle))->asStrings($rows, $backend);
- $includeNeedles = (new Parameter($this->includeNeedle))->asBooleans($rows, $backend);
+ $strings = new Parameter($this->string)->asStrings($rows, $backend);
+ $needles = new Parameter($this->needle)->asStrings($rows, $backend);
+ $includeNeedles = new Parameter($this->includeNeedle)->asBooleans($rows, $backend);
$results = [];
$i = 0;
@@ -103,6 +103,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/StringContainsAny.php b/src/core/etl/src/Flow/ETL/Functions/StringContainsAny.php
index 5995e4dc9a..80da722eb9 100644
--- a/src/core/etl/src/Flow/ETL/Functions/StringContainsAny.php
+++ b/src/core/etl/src/Flow/ETL/Functions/StringContainsAny.php
@@ -77,13 +77,13 @@ public function withChildren(array $children): static
*/
public function returns(): Type
{
- return (new Nullability())->any(type_boolean(), $this->value->returns(), $this->needles->returns());
+ return new Nullability()->any(type_boolean(), $this->value->returns(), $this->needles->returns());
}
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
- $needlesList = (new Parameter($this->needles))->asArrays($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
+ $needlesList = new Parameter($this->needles)->asArrays($rows, $backend);
$results = [];
$i = 0;
@@ -109,6 +109,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/StringEqualsTo.php b/src/core/etl/src/Flow/ETL/Functions/StringEqualsTo.php
index acbdf68770..940d947254 100644
--- a/src/core/etl/src/Flow/ETL/Functions/StringEqualsTo.php
+++ b/src/core/etl/src/Flow/ETL/Functions/StringEqualsTo.php
@@ -70,13 +70,13 @@ public function withChildren(array $children): static
*/
public function returns(): Type
{
- return (new Nullability())->any(type_boolean(), $this->value->returns(), $this->string->returns());
+ return new Nullability()->any(type_boolean(), $this->value->returns(), $this->string->returns());
}
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
- $strings = (new Parameter($this->string))->asStrings($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
+ $strings = new Parameter($this->string)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -96,6 +96,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/StringFold.php b/src/core/etl/src/Flow/ETL/Functions/StringFold.php
index d06504805f..77a478bdb9 100644
--- a/src/core/etl/src/Flow/ETL/Functions/StringFold.php
+++ b/src/core/etl/src/Flow/ETL/Functions/StringFold.php
@@ -69,7 +69,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $strings = (new Parameter($this->string))->asStrings($rows, $backend);
+ $strings = new Parameter($this->string)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -85,6 +85,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/StringMatch.php b/src/core/etl/src/Flow/ETL/Functions/StringMatch.php
index 0c8c04d4e7..a823a10fec 100644
--- a/src/core/etl/src/Flow/ETL/Functions/StringMatch.php
+++ b/src/core/etl/src/Flow/ETL/Functions/StringMatch.php
@@ -77,8 +77,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $haystacks = (new Parameter($this->haystack))->asStrings($rows, $backend);
- $patterns = (new Parameter($this->pattern))->asStrings($rows, $backend);
+ $haystacks = new Parameter($this->haystack)->asStrings($rows, $backend);
+ $patterns = new Parameter($this->pattern)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -107,6 +107,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/StringMatchAll.php b/src/core/etl/src/Flow/ETL/Functions/StringMatchAll.php
index cd4a53b052..d95697dbdb 100644
--- a/src/core/etl/src/Flow/ETL/Functions/StringMatchAll.php
+++ b/src/core/etl/src/Flow/ETL/Functions/StringMatchAll.php
@@ -77,8 +77,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $haystacks = (new Parameter($this->haystack))->asStrings($rows, $backend);
- $patterns = (new Parameter($this->pattern))->asStrings($rows, $backend);
+ $haystacks = new Parameter($this->haystack)->asStrings($rows, $backend);
+ $patterns = new Parameter($this->pattern)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -112,6 +112,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/StringNormalize.php b/src/core/etl/src/Flow/ETL/Functions/StringNormalize.php
index b249053cf0..5bc2ee8812 100644
--- a/src/core/etl/src/Flow/ETL/Functions/StringNormalize.php
+++ b/src/core/etl/src/Flow/ETL/Functions/StringNormalize.php
@@ -76,8 +76,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
- $forms = (new Parameter($this->form))->asInts($rows, $backend, Normalizer::NFC);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
+ $forms = new Parameter($this->form)->asInts($rows, $backend, Normalizer::NFC);
$results = [];
$i = 0;
@@ -95,6 +95,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/StringStyle.php b/src/core/etl/src/Flow/ETL/Functions/StringStyle.php
index 0d43996747..621c7c2852 100644
--- a/src/core/etl/src/Flow/ETL/Functions/StringStyle.php
+++ b/src/core/etl/src/Flow/ETL/Functions/StringStyle.php
@@ -76,13 +76,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $strings = (new Parameter($this->string))->asStrings($rows, $backend);
- $styles = (new Parameter($this->style))->asTypes(
- $rows,
- $backend,
- type_string(),
- type_enum(StringStyles::class),
- );
+ $strings = new Parameter($this->string)->asStrings($rows, $backend);
+ $styles = new Parameter($this->style)->asTypes($rows, $backend, type_string(), type_enum(StringStyles::class));
$results = [];
$i = 0;
@@ -108,6 +103,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/StringTitle.php b/src/core/etl/src/Flow/ETL/Functions/StringTitle.php
index 5aca2d6b9e..5fa20af4de 100644
--- a/src/core/etl/src/Flow/ETL/Functions/StringTitle.php
+++ b/src/core/etl/src/Flow/ETL/Functions/StringTitle.php
@@ -75,8 +75,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $strings = (new Parameter($this->string))->asStrings($rows, $backend);
- $allWordsList = (new Parameter($this->allWords))->asBooleans($rows, $backend);
+ $strings = new Parameter($this->string)->asStrings($rows, $backend);
+ $allWordsList = new Parameter($this->allWords)->asBooleans($rows, $backend);
$results = [];
$i = 0;
@@ -96,6 +96,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/StringWidth.php b/src/core/etl/src/Flow/ETL/Functions/StringWidth.php
index 8f0fb33d1f..297423d2ef 100644
--- a/src/core/etl/src/Flow/ETL/Functions/StringWidth.php
+++ b/src/core/etl/src/Flow/ETL/Functions/StringWidth.php
@@ -69,7 +69,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -85,6 +85,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Structure.php b/src/core/etl/src/Flow/ETL/Functions/Structure.php
index a85b8c9836..ffe768eff9 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Structure.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Structure.php
@@ -107,7 +107,7 @@ public function eval(Rows $rows, Backend $backend): Column
$elements = [];
foreach ($this->elements as $name => $element) {
- $elements[$name] = (new Parameter($element))->values($rows, $backend);
+ $elements[$name] = new Parameter($element)->values($rows, $backend);
}
$results = [];
@@ -122,6 +122,6 @@ public function eval(Rows $rows, Backend $backend): Column
$results[] = $values;
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/StructureSelect.php b/src/core/etl/src/Flow/ETL/Functions/StructureSelect.php
index 3cd7984073..b950f8688c 100644
--- a/src/core/etl/src/Flow/ETL/Functions/StructureSelect.php
+++ b/src/core/etl/src/Flow/ETL/Functions/StructureSelect.php
@@ -125,7 +125,7 @@ public function eval(Rows $rows, Backend $backend): Column
{
if ($rows->schema()->findDefinition($this->ref->base()) === null) {
// @mago-ignore analysis:possibly-invalid-argument
- return (new ResultColumn($backend))->of($this, $rows->isEmpty() ? [] : array_fill(0, $rows->count(), null));
+ return new ResultColumn($backend)->of($this, $rows->isEmpty() ? [] : array_fill(0, $rows->count(), null));
}
$results = [];
@@ -151,6 +151,6 @@ public function eval(Rows $rows, Backend $backend): Column
$results[] = $output;
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/StructureValues.php b/src/core/etl/src/Flow/ETL/Functions/StructureValues.php
index 0843bcb926..e3ffa61aa0 100644
--- a/src/core/etl/src/Flow/ETL/Functions/StructureValues.php
+++ b/src/core/etl/src/Flow/ETL/Functions/StructureValues.php
@@ -23,7 +23,7 @@
public static function type(string $function, StructureType $structure): Type
{
return (
- (new PromotingUnifier())->unifyAll(NullabilityRule::ANY, ...array_map(
+ new PromotingUnifier()->unifyAll(NullabilityRule::ANY, ...array_map(
static fn(StructureElement $element): Type => $element->type,
$structure->elements(),
)) ?? throw SchemaNotDerivableException::function(
diff --git a/src/core/etl/src/Flow/ETL/Functions/Sum.php b/src/core/etl/src/Flow/ETL/Functions/Sum.php
index 531e783885..82f81f6681 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Sum.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Sum.php
@@ -148,7 +148,7 @@ public function frameValues(Rows $partition, array $bounds, Backend $backend, Pr
public function values(Rows $partition, Backend $backend, Progress $progress): array
{
- return (new FrameAccumulation($this->window()->frame()))->values($this, $partition, $backend, $progress);
+ return new FrameAccumulation($this->window()->frame())->values($this, $partition, $backend, $progress);
}
public function over(Window $window): static
diff --git a/src/core/etl/src/Flow/ETL/Functions/ToDate.php b/src/core/etl/src/Flow/ETL/Functions/ToDate.php
index ebe363adc8..f6ed6920ca 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ToDate.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ToDate.php
@@ -88,9 +88,9 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->values($rows, $backend);
- $formats = (new Parameter($this->format))->asStrings($rows, $backend);
- $timeZones = (new Parameter($this->timeZone))->asInstancesOf($rows, $backend, DateTimeZone::class);
+ $values = new Parameter($this->value)->values($rows, $backend);
+ $formats = new Parameter($this->format)->asStrings($rows, $backend);
+ $timeZones = new Parameter($this->timeZone)->asInstancesOf($rows, $backend, DateTimeZone::class);
$results = [];
$i = 0;
@@ -136,6 +136,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/ToDateTime.php b/src/core/etl/src/Flow/ETL/Functions/ToDateTime.php
index 3a4c65577d..6c8d359906 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ToDateTime.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ToDateTime.php
@@ -110,7 +110,7 @@ public function withChildren(array $children): static
*/
public function deterministic(): bool
{
- if ($this->pattern === null || (new PatternCoverage($this->pattern))->fillsFromClock()) {
+ if ($this->pattern === null || new PatternCoverage($this->pattern)->fillsFromClock()) {
return false;
}
@@ -133,9 +133,9 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->values($rows, $backend);
- $formats = (new Parameter($this->format))->asStrings($rows, $backend);
- $timeZones = (new Parameter($this->timeZone))->asInstancesOf($rows, $backend, DateTimeZone::class);
+ $values = new Parameter($this->value)->values($rows, $backend);
+ $formats = new Parameter($this->format)->asStrings($rows, $backend);
+ $timeZones = new Parameter($this->timeZone)->asInstancesOf($rows, $backend, DateTimeZone::class);
$results = [];
$i = 0;
@@ -187,6 +187,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/ToLower.php b/src/core/etl/src/Flow/ETL/Functions/ToLower.php
index 616214800f..e6430c1bc1 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ToLower.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ToLower.php
@@ -69,7 +69,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -85,6 +85,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/ToTimeZone.php b/src/core/etl/src/Flow/ETL/Functions/ToTimeZone.php
index f129516cd8..0c617171bb 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ToTimeZone.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ToTimeZone.php
@@ -99,7 +99,7 @@ public function eval(Rows $rows, Backend $backend): Column
$i = 0;
try {
- foreach ((new Parameter($this->value))->asInstancesOf(
+ foreach (new Parameter($this->value)->asInstancesOf(
$rows,
$backend,
DateTimeInterface::class,
@@ -114,6 +114,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/ToUpper.php b/src/core/etl/src/Flow/ETL/Functions/ToUpper.php
index 55844db42a..8c76fb20ca 100644
--- a/src/core/etl/src/Flow/ETL/Functions/ToUpper.php
+++ b/src/core/etl/src/Flow/ETL/Functions/ToUpper.php
@@ -69,7 +69,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -85,6 +85,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Trim.php b/src/core/etl/src/Flow/ETL/Functions/Trim.php
index da0c7b111d..eed204fadb 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Trim.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Trim.php
@@ -87,9 +87,9 @@ public function returns(): FlowType
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
- $types = (new Parameter($this->type))->asEnums($rows, $backend, Type::class);
- $charactersList = (new Parameter($this->characters))->asStrings($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
+ $types = new Parameter($this->type)->asEnums($rows, $backend, Type::class);
+ $charactersList = new Parameter($this->characters)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -116,6 +116,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Truncate.php b/src/core/etl/src/Flow/ETL/Functions/Truncate.php
index be08884721..8789d6ffe5 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Truncate.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Truncate.php
@@ -82,9 +82,9 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
- $lengths = (new Parameter($this->length))->asInts($rows, $backend);
- $ellipsisList = (new Parameter($this->ellipsis))->asStrings($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
+ $lengths = new Parameter($this->length)->asInts($rows, $backend);
+ $ellipsisList = new Parameter($this->ellipsis)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -109,6 +109,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Ulid.php b/src/core/etl/src/Flow/ETL/Functions/Ulid.php
index 933e065990..f667b9f4b8 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Ulid.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Ulid.php
@@ -87,7 +87,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $refs = (new Parameter($this->ref))->asStrings($rows, $backend);
+ $refs = new Parameter($this->ref)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -110,12 +110,12 @@ public function eval(Rows $rows, Backend $backend): Column
}
}
- $results[] = (new SymfonyUlid())->toBase32();
+ $results[] = new SymfonyUlid()->toBase32();
}
} catch (Exception $e) {
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/UnicodeLength.php b/src/core/etl/src/Flow/ETL/Functions/UnicodeLength.php
index 0f6cf6b09b..34449c0764 100644
--- a/src/core/etl/src/Flow/ETL/Functions/UnicodeLength.php
+++ b/src/core/etl/src/Flow/ETL/Functions/UnicodeLength.php
@@ -69,7 +69,7 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -85,6 +85,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Uuid.php b/src/core/etl/src/Flow/ETL/Functions/Uuid.php
index c78caa8e0f..6c41d77169 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Uuid.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Uuid.php
@@ -114,10 +114,10 @@ public function eval(Rows $rows, Backend $backend): Column
$results[] = new FlowUuid($this->generateV4());
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
- $params = (new Parameter($this->value))->asTypes(
+ $params = new Parameter($this->value)->asTypes(
$rows,
$backend,
type_string(),
@@ -137,7 +137,7 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
private function generateV4(): UuidV4|UuidInterface
diff --git a/src/core/etl/src/Flow/ETL/Functions/When.php b/src/core/etl/src/Flow/ETL/Functions/When.php
index 69473dccfb..71237ab966 100644
--- a/src/core/etl/src/Flow/ETL/Functions/When.php
+++ b/src/core/etl/src/Flow/ETL/Functions/When.php
@@ -89,7 +89,7 @@ public function returns(): Type
$branches[] = $this->else->returns();
}
- $result = (new PromotingUnifier())->unifyAll(
+ $result = new PromotingUnifier()->unifyAll(
NullabilityRule::ANY,
...$branches,
) ?? throw InvalidTypeException::noCommonType(...$branches);
@@ -103,7 +103,7 @@ public function eval(Rows $rows, Backend $backend): Column
$then = [];
$else = [];
- foreach ((new Parameter($this->condition))->asBooleans($rows, $backend) as $i => $condition) {
+ foreach (new Parameter($this->condition)->asBooleans($rows, $backend) as $i => $condition) {
if ($condition) {
$then[] = $i;
} else {
@@ -114,7 +114,7 @@ public function eval(Rows $rows, Backend $backend): Column
$values = [];
if ($then !== []) {
- $column = (new Selection($then))->evaluate($this->then, $rows, $backend);
+ $column = new Selection($then)->evaluate($this->then, $rows, $backend);
// @mago-ignore analysis:mixed-assignment
foreach ($column->values() as $k => $value) {
@@ -123,7 +123,7 @@ public function eval(Rows $rows, Backend $backend): Column
}
if ($else !== [] && $this->else !== null) {
- $column = (new Selection($else))->evaluate($this->else, $rows, $backend);
+ $column = new Selection($else)->evaluate($this->else, $rows, $backend);
// @mago-ignore analysis:mixed-assignment
foreach ($column->values() as $k => $value) {
@@ -137,6 +137,6 @@ public function eval(Rows $rows, Backend $backend): Column
$results[] = $values[$i] ?? null;
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/Window/PeerFrame.php b/src/core/etl/src/Flow/ETL/Functions/Window/PeerFrame.php
index 752d401065..841f3eae6c 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Window/PeerFrame.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Window/PeerFrame.php
@@ -56,7 +56,7 @@ public function bounds(int $index, Rows $partition): array
public function ends(Rows $partition): array
{
if (!$this->ends->offsetExists($partition)) {
- $peers = (new RowOrder($this->orderBy))->ties($partition);
+ $peers = new RowOrder($this->orderBy)->ties($partition);
$ends = [];
$end = $partition->count() - 1;
diff --git a/src/core/etl/src/Flow/ETL/Functions/Wordwrap.php b/src/core/etl/src/Flow/ETL/Functions/Wordwrap.php
index af4e963964..e14b8d99bf 100644
--- a/src/core/etl/src/Flow/ETL/Functions/Wordwrap.php
+++ b/src/core/etl/src/Flow/ETL/Functions/Wordwrap.php
@@ -88,10 +88,10 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asStrings($rows, $backend);
- $breaks = (new Parameter($this->break))->asStrings($rows, $backend);
- $widths = (new Parameter($this->width))->asTypes($rows, $backend, type_integer());
- $cuts = (new Parameter($this->cut))->asBooleans($rows, $backend);
+ $values = new Parameter($this->value)->asStrings($rows, $backend);
+ $breaks = new Parameter($this->break)->asStrings($rows, $backend);
+ $widths = new Parameter($this->width)->asTypes($rows, $backend, type_integer());
+ $cuts = new Parameter($this->cut)->asBooleans($rows, $backend);
$results = [];
$i = 0;
@@ -124,6 +124,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Functions/XPath.php b/src/core/etl/src/Flow/ETL/Functions/XPath.php
index dbb17d8929..d03ab4ef02 100644
--- a/src/core/etl/src/Flow/ETL/Functions/XPath.php
+++ b/src/core/etl/src/Flow/ETL/Functions/XPath.php
@@ -82,8 +82,8 @@ public function returns(): Type
public function eval(Rows $rows, Backend $backend): Column
{
- $values = (new Parameter($this->value))->asInstancesOf($rows, $backend, DOMNode::class);
- $paths = (new Parameter($this->path))->asStrings($rows, $backend);
+ $values = new Parameter($this->value)->asInstancesOf($rows, $backend, DOMNode::class);
+ $paths = new Parameter($this->path)->asStrings($rows, $backend);
$results = [];
$i = 0;
@@ -111,7 +111,7 @@ public function eval(Rows $rows, Backend $backend): Column
}
/** @var DOMNodeList|false $result */
- $result = (new DOMXPath($value))->query($path);
+ $result = new DOMXPath($value)->query($path);
if ($result === false || $result->length === 0) {
$results[] = null;
@@ -136,6 +136,6 @@ public function eval(Rows $rows, Backend $backend): Column
throw EvaluationException::at($i, $e);
}
- return (new ResultColumn($backend))->of($this, $results);
+ return new ResultColumn($backend)->of($this, $results);
}
}
diff --git a/src/core/etl/src/Flow/ETL/IO/Extractor/ArrayExtractor.php b/src/core/etl/src/Flow/ETL/IO/Extractor/ArrayExtractor.php
index 85e827f3fe..84bb936de2 100644
--- a/src/core/etl/src/Flow/ETL/IO/Extractor/ArrayExtractor.php
+++ b/src/core/etl/src/Flow/ETL/IO/Extractor/ArrayExtractor.php
@@ -184,7 +184,7 @@ private function describe(): Schema
$inPlace = $this->inPlace();
if ($inPlace !== null) {
- return $this->derivedSchema = (new SchemaInferrer($this->inference))->infer(
+ return $this->derivedSchema = new SchemaInferrer($this->inference)->infer(
new InMemoryRows($inPlace),
$this->inferenceProgress,
)->schema;
@@ -197,11 +197,11 @@ private function describe(): Schema
);
// SpilledRows writes every row, so the inference reads every row
- return $this->derivedSchema = (new SchemaInferrer(
- (new SchemaInference(types: $this->inference->types, unionByName: $this->inference->unionByName))
+ return $this->derivedSchema = new SchemaInferrer(
+ new SchemaInference(types: $this->inference->types, unionByName: $this->inference->unionByName)
->everyRow()
->everySource(),
- ))->infer($this->source, $this->inferenceProgress)->schema;
+ )->infer($this->source, $this->inferenceProgress)->schema;
}
public function statistics(): Statistics
diff --git a/src/core/etl/src/Flow/ETL/IO/Extractor/Criteria.php b/src/core/etl/src/Flow/ETL/IO/Extractor/Criteria.php
index 25b56cbd2b..a97210d987 100644
--- a/src/core/etl/src/Flow/ETL/IO/Extractor/Criteria.php
+++ b/src/core/etl/src/Flow/ETL/IO/Extractor/Criteria.php
@@ -85,7 +85,7 @@ public function withFilter(ScalarFunction $filter): self
$this->limit,
$this->offset,
$this->pathFilter,
- [...$this->conjuncts, ...(new Conjuncts())->of($filter)],
+ [...$this->conjuncts, ...new Conjuncts()->of($filter)],
$this->split,
$this->columns,
);
diff --git a/src/core/etl/src/Flow/ETL/IO/Extractor/File/DerivedSchema.php b/src/core/etl/src/Flow/ETL/IO/Extractor/File/DerivedSchema.php
index 07e6ca2760..23ca33f03c 100644
--- a/src/core/etl/src/Flow/ETL/IO/Extractor/File/DerivedSchema.php
+++ b/src/core/etl/src/Flow/ETL/IO/Extractor/File/DerivedSchema.php
@@ -45,7 +45,7 @@ public function normalize(): array
*/
public function refuseDivergence(string $source, Schema $schema): void
{
- $validation = (new StrictValidator())->validate($this->derived, $schema);
+ $validation = new StrictValidator()->validate($this->derived, $schema);
if (!$validation->isValid()) {
throw InferredSchemaException::filesDiverge($source, $this->derivedFrom, $validation->toString());
diff --git a/src/core/etl/src/Flow/ETL/IO/Extractor/File/FileColumns.php b/src/core/etl/src/Flow/ETL/IO/Extractor/File/FileColumns.php
index e501551c4f..617c838a48 100644
--- a/src/core/etl/src/Flow/ETL/IO/Extractor/File/FileColumns.php
+++ b/src/core/etl/src/Flow/ETL/IO/Extractor/File/FileColumns.php
@@ -117,7 +117,7 @@ public function partitions(Schema $declared): Schema
}
// only the partition block: $declared may already carry the metadata column declare() adds
- return (new self($this->partitionNames, $this->partitionTypes, false))
+ return new self($this->partitionNames, $this->partitionTypes, false)
->declare($declared)
->keep(...array_keys($this->partitionNames));
}
diff --git a/src/core/etl/src/Flow/ETL/IO/Extractor/File/FileRead.php b/src/core/etl/src/Flow/ETL/IO/Extractor/File/FileRead.php
index 62d75e21b9..7d62b08103 100644
--- a/src/core/etl/src/Flow/ETL/IO/Extractor/File/FileRead.php
+++ b/src/core/etl/src/Flow/ETL/IO/Extractor/File/FileRead.php
@@ -66,7 +66,7 @@ public function normalize(): array
*/
public function scan(Backend $backend, Criteria $criteria, FileBatches $batches): Generator
{
- yield from (new FileReadLoop($this, $criteria))->read(
+ yield from new FileReadLoop($this, $criteria)->read(
$this->files->of($criteria),
$batches,
$backend,
diff --git a/src/core/etl/src/Flow/ETL/IO/Extractor/File/SourceFiles.php b/src/core/etl/src/Flow/ETL/IO/Extractor/File/SourceFiles.php
index 6a9eacf9c1..c12541dde1 100644
--- a/src/core/etl/src/Flow/ETL/IO/Extractor/File/SourceFiles.php
+++ b/src/core/etl/src/Flow/ETL/IO/Extractor/File/SourceFiles.php
@@ -44,7 +44,7 @@ public function statuses(Criteria $criteria = new Criteria()): array
{
if ($criteria->split !== null) {
return iterator_to_array(
- (new FileListing($this->filesystem))->list(
+ new FileListing($this->filesystem)->list(
$criteria->split->path,
new VisibleFiles($criteria->split->path->staticPart()),
),
@@ -53,7 +53,7 @@ public function statuses(Criteria $criteria = new Criteria()): array
}
$this->statuses ??= iterator_to_array(
- (new FileListing($this->filesystem))->list($this->path, new VisibleFiles($this->path->staticPart())),
+ new FileListing($this->filesystem)->list($this->path, new VisibleFiles($this->path->staticPart())),
false,
);
diff --git a/src/core/etl/src/Flow/ETL/IO/Extractor/FileListingExtractor.php b/src/core/etl/src/Flow/ETL/IO/Extractor/FileListingExtractor.php
index f27f85b511..36d2de19cd 100644
--- a/src/core/etl/src/Flow/ETL/IO/Extractor/FileListingExtractor.php
+++ b/src/core/etl/src/Flow/ETL/IO/Extractor/FileListingExtractor.php
@@ -64,7 +64,7 @@ public function isRepeatable(): bool
*/
public function extract(Backend $backend, Criteria $criteria): Generator
{
- return (new ListingScan($this->files, $this->fileColumns->columns(), $this->row))->scan(
+ return new ListingScan($this->files, $this->fileColumns->columns(), $this->row)->scan(
$backend,
$criteria,
$this->schema(),
diff --git a/src/core/etl/src/Flow/ETL/IO/Extractor/Grid/RecordDecoder.php b/src/core/etl/src/Flow/ETL/IO/Extractor/Grid/RecordDecoder.php
index 6da577be72..e93df124c2 100644
--- a/src/core/etl/src/Flow/ETL/IO/Extractor/Grid/RecordDecoder.php
+++ b/src/core/etl/src/Flow/ETL/IO/Extractor/Grid/RecordDecoder.php
@@ -58,7 +58,7 @@ public function decode(array $cells): array|string|null
}
if ($this->headers === null) {
- $this->headers = (new HeaderNames())->of($this->withHeader ? $cells : array_fill(0, count($cells), null));
+ $this->headers = new HeaderNames()->of($this->withHeader ? $cells : array_fill(0, count($cells), null));
if ($this->withHeader) {
return null;
diff --git a/src/core/etl/src/Flow/ETL/IO/Extractor/Memory/SpilledRows.php b/src/core/etl/src/Flow/ETL/IO/Extractor/Memory/SpilledRows.php
index 89bc50a1c6..1a8c246a08 100644
--- a/src/core/etl/src/Flow/ETL/IO/Extractor/Memory/SpilledRows.php
+++ b/src/core/etl/src/Flow/ETL/IO/Extractor/Memory/SpilledRows.php
@@ -199,7 +199,7 @@ public function sniff(int $unit, ?int $rowBudget, Progress $progress): Sample
// InMemoryRows owns the raw-row naming; keeping a second copy here would put the "same names array_to_rows()
// gives" invariant in two places.
- return (new InMemoryRows($spilling()))->sniff(0, null, $progress);
+ return new InMemoryRows($spilling())->sniff(0, null, $progress);
}
public function parts(int $unit, int $targetBytes): array
diff --git a/src/core/etl/src/Flow/ETL/IO/Extractor/SequenceExtractor.php b/src/core/etl/src/Flow/ETL/IO/Extractor/SequenceExtractor.php
index cb0ff003b0..f254b4ac94 100644
--- a/src/core/etl/src/Flow/ETL/IO/Extractor/SequenceExtractor.php
+++ b/src/core/etl/src/Flow/ETL/IO/Extractor/SequenceExtractor.php
@@ -146,7 +146,7 @@ private function describe(): Schema
// no spill: generate() is re-runnable
// no seeded name: PHP re-keys integer names
- return $this->derivedSchema = (new SchemaInferrer($this->inference))->infer(
+ return $this->derivedSchema = new SchemaInferrer($this->inference)->infer(
new InMemoryRows($items()),
$this->inferenceProgress,
)->schema;
diff --git a/src/core/etl/src/Flow/ETL/IO/Filesystem/ScalarFunctionFilter.php b/src/core/etl/src/Flow/ETL/IO/Filesystem/ScalarFunctionFilter.php
index 89e50d0903..d58471f580 100644
--- a/src/core/etl/src/Flow/ETL/IO/Filesystem/ScalarFunctionFilter.php
+++ b/src/core/etl/src/Flow/ETL/IO/Filesystem/ScalarFunctionFilter.php
@@ -29,7 +29,7 @@ public function __construct(
// are both in hand - a filter reaching a Read any other way is gated too.
// resolved() guards it: files() and from_path_partitions() declare no partition columns, so
// their reference never resolves and returns() would throw instead of answering.
- $this->resolved = (new ReferenceResolver())->resolve($function, $partitions);
+ $this->resolved = new ReferenceResolver()->resolve($function, $partitions);
if ($this->resolved->resolved()) {
$this->resolved->returns();
@@ -70,9 +70,9 @@ public function accept(FileStatus $status): bool
// an undeclared partition column resolves against the file's own path value (a str column)
// @mago-ignore analysis:mixed-operand
- return (bool) (new ReferenceResolver())
+ return (bool) new ReferenceResolver()
->resolve($this->resolved, $schema)
- ->eval((new RowsBuilder($schema, $this->backend))->appendRecords([$values])->finish(), $this->backend)
+ ->eval(new RowsBuilder($schema, $this->backend)->appendRecords([$values])->finish(), $this->backend)
->value(0);
}
}
diff --git a/src/core/etl/src/Flow/ETL/IO/Floe/FloeExtractor.php b/src/core/etl/src/Flow/ETL/IO/Floe/FloeExtractor.php
index 1e88aa76d7..650702a5bc 100644
--- a/src/core/etl/src/Flow/ETL/IO/Floe/FloeExtractor.php
+++ b/src/core/etl/src/Flow/ETL/IO/Floe/FloeExtractor.php
@@ -223,7 +223,7 @@ private function files(): Generator
$stream = $this->filesystem->readFrom($source->path);
try {
- yield new FloeSourceFile((new FooterReader())->read($stream, $this->codec)->footer, $source);
+ yield new FloeSourceFile(new FooterReader()->read($stream, $this->codec)->footer, $source);
} finally {
$stream->close();
}
diff --git a/src/core/etl/src/Flow/ETL/IO/Floe/FloeLoader.php b/src/core/etl/src/Flow/ETL/IO/Floe/FloeLoader.php
index 685c1822dd..19175305d0 100644
--- a/src/core/etl/src/Flow/ETL/IO/Floe/FloeLoader.php
+++ b/src/core/etl/src/Flow/ETL/IO/Floe/FloeLoader.php
@@ -74,7 +74,7 @@ public function __construct(
public static function fromDescription(#[SensitiveParameter] array $data, Rebuild $rebuild): static
{
- $loader = (new self(
+ $loader = new self(
Path::fromArray(type_array()->assert($data['path'] ?? null)),
($data['metadata'] ?? null) === null
? null
@@ -87,7 +87,7 @@ public static function fromDescription(#[SensitiveParameter] array $data, Rebuil
))->assert($data['metadata'])),
new Options(type_integer()->assert($data['buffer_size'] ?? null)),
$rebuild->of($data['filesystem'] ?? null, ConfiguredFilesystem::class)->filesystem(),
- ))->saveMode(type_enum(SaveMode::class)->assert(constant(
+ )->saveMode(type_enum(SaveMode::class)->assert(constant(
SaveMode::class . '::' . type_string()->assert($data['save_mode'] ?? null),
)));
@@ -174,12 +174,7 @@ public function partitioning(): Partitioning
public function inTask(Part $task): static
{
- $loader = (new self(
- $this->path,
- $this->metadata,
- $this->options,
- $this->filesystem,
- ))->saveMode($this->saveMode);
+ $loader = new self($this->path, $this->metadata, $this->options, $this->filesystem)->saveMode($this->saveMode);
if ($this->schema !== null) {
$loader->withSchema($this->schema);
diff --git a/src/core/etl/src/Flow/ETL/IO/Formatter/ASCII/ASCIIValue.php b/src/core/etl/src/Flow/ETL/IO/Formatter/ASCII/ASCIIValue.php
index dae4e30acf..107d4132cc 100644
--- a/src/core/etl/src/Flow/ETL/IO/Formatter/ASCII/ASCIIValue.php
+++ b/src/core/etl/src/Flow/ETL/IO/Formatter/ASCII/ASCIIValue.php
@@ -111,7 +111,7 @@ private function stringValue(): string
{
if ($this->stringValue === null) {
try {
- $this->stringValue = (new TypedValueFormatter())->format($this->type, $this->value);
+ $this->stringValue = new TypedValueFormatter()->format($this->type, $this->value);
} catch (TypesException) {
$this->stringValue = '{...}';
diff --git a/src/core/etl/src/Flow/ETL/IO/Formatter/Row/ASCIISchemaFormatter.php b/src/core/etl/src/Flow/ETL/IO/Formatter/Row/ASCIISchemaFormatter.php
index e88fcebb75..f37a012f81 100644
--- a/src/core/etl/src/Flow/ETL/IO/Formatter/Row/ASCIISchemaFormatter.php
+++ b/src/core/etl/src/Flow/ETL/IO/Formatter/Row/ASCIISchemaFormatter.php
@@ -34,7 +34,7 @@ public function __construct(
public function format(Schema $schema): string
{
if ($this->asTable) {
- return (new AsciiTableFormatter())->format($this->table($schema), false);
+ return new AsciiTableFormatter()->format($this->table($schema), false);
}
/** @var array $buffer */
@@ -77,7 +77,7 @@ private function table(Schema $schema): Rows
$columns[] = new StringDefinition('metadata');
}
- return (new RowsBuilder(new Schema(...$columns), new AdaptiveBackend()))
+ return new RowsBuilder(new Schema(...$columns), new AdaptiveBackend())
->appendRows($rows)
->finish();
}
diff --git a/src/core/etl/src/Flow/ETL/IO/Formatter/Schema/PHPSchemaFormatter.php b/src/core/etl/src/Flow/ETL/IO/Formatter/Schema/PHPSchemaFormatter.php
index 1bd6531a1a..2f2a51a04b 100644
--- a/src/core/etl/src/Flow/ETL/IO/Formatter/Schema/PHPSchemaFormatter.php
+++ b/src/core/etl/src/Flow/ETL/IO/Formatter/Schema/PHPSchemaFormatter.php
@@ -51,7 +51,7 @@ public function format(Schema $schema): string
{
return sprintf(
"\%s(%s);",
- (new ReflectionFunction("\Flow\ETL\DSL\schema"))->getName(),
+ new ReflectionFunction("\Flow\ETL\DSL\schema")->getName(),
$this->formatSchema($schema),
);
}
@@ -69,7 +69,7 @@ private function dateTimeType(Definition $definition): string
return sprintf(
'\%s("%s", nullable: %s, metadata: %s, zone: "%s")',
- (new ReflectionFunction('\Flow\ETL\DSL\datetime_schema'))->getName(),
+ new ReflectionFunction('\Flow\ETL\DSL\datetime_schema')->getName(),
$definition->name(),
$definition->isNullable() ? 'true' : 'false',
$this->formatMetadata($definition->metadata()),
@@ -86,7 +86,7 @@ private function enumType(Definition $definition): string
return sprintf(
'\%s("%s", type: \%s::class, nullable: %s, metadata: %s)',
- (new ReflectionFunction("\Flow\ETL\DSL\\enum_schema"))->getName(),
+ new ReflectionFunction("\Flow\ETL\DSL\\enum_schema")->getName(),
$definition->name(),
$type->class,
$definition->isNullable() ? 'true' : 'false',
@@ -101,7 +101,7 @@ private function floatType(Definition $definition): string
{
return sprintf(
'\%s("%s", nullable: %s, metadata: %s)',
- (new ReflectionFunction("\Flow\ETL\DSL\\float_schema"))->getName(),
+ new ReflectionFunction("\Flow\ETL\DSL\\float_schema")->getName(),
$definition->name(),
$definition->isNullable() ? 'true' : 'false',
$this->formatMetadata($definition->metadata()),
@@ -171,7 +171,7 @@ private function listType(Definition $definition): string
return sprintf(
'\%s("%s", type: %s, nullable: %s, metadata: %s)',
- (new ReflectionFunction("\Flow\ETL\DSL\\list_schema"))->getName(),
+ new ReflectionFunction("\Flow\ETL\DSL\\list_schema")->getName(),
$definition->name(),
$this->typeFormatter->format($type),
$definition->isNullable() ? 'true' : 'false',
@@ -189,7 +189,7 @@ private function mapType(Definition $definition): string
return sprintf(
'\%s("%s", type: %s, nullable: %s, metadata: %s)',
- (new ReflectionFunction("\Flow\ETL\DSL\\map_schema"))->getName(),
+ new ReflectionFunction("\Flow\ETL\DSL\\map_schema")->getName(),
$definition->name(),
$this->typeFormatter->format($type),
$definition->isNullable() ? 'true' : 'false',
@@ -204,7 +204,7 @@ private function numericStringType(Definition $definition): string
{
return sprintf(
'\%s("%s", type: %s, nullable: %s, metadata: %s)',
- (new ReflectionFunction("\Flow\ETL\DSL\\definition_from_type"))->getName(),
+ new ReflectionFunction("\Flow\ETL\DSL\\definition_from_type")->getName(),
$definition->name(),
$this->typeFormatter->format($definition->type()),
$definition->isNullable() ? 'true' : 'false',
@@ -253,7 +253,7 @@ private function structureType(Definition $definition): string
return sprintf(
'\%s("%s", type: %s, nullable: %s, metadata: %s)',
- (new ReflectionFunction("\Flow\ETL\DSL\\structure_schema"))->getName(),
+ new ReflectionFunction("\Flow\ETL\DSL\\structure_schema")->getName(),
$definition->name(),
$this->typeFormatter->format($type),
$definition->isNullable() ? 'true' : 'false',
diff --git a/src/core/etl/src/Flow/ETL/IO/Inference/InferredTypes.php b/src/core/etl/src/Flow/ETL/IO/Inference/InferredTypes.php
index 8d7ddd3768..71e4b438f2 100644
--- a/src/core/etl/src/Flow/ETL/IO/Inference/InferredTypes.php
+++ b/src/core/etl/src/Flow/ETL/IO/Inference/InferredTypes.php
@@ -95,7 +95,7 @@ public static function fromArray(array $data): self
}
/**
- * Every rung but html and xml: no engine infers markup, HTMLType::cast() throws below PHP 8.4, and isXML()
+ * Every rung but html and xml: no engine infers markup, and isXML()
* builds a DOMDocument per cell.
*
* type_enum(UnitEnum::class) is the family marker, not a rung: no text source ever climbs to an enum, but a
diff --git a/src/core/etl/src/Flow/ETL/IO/Loader/File/FileCommit.php b/src/core/etl/src/Flow/ETL/IO/Loader/File/FileCommit.php
index cb62d9b52b..59e1330650 100644
--- a/src/core/etl/src/Flow/ETL/IO/Loader/File/FileCommit.php
+++ b/src/core/etl/src/Flow/ETL/IO/Loader/File/FileCommit.php
@@ -74,7 +74,7 @@ public function __construct(
}
if (
- (new Part(0, 1, $run, false))->fill($destination)->isPattern()
+ new Part(0, 1, $run, false)->fill($destination)->isPattern()
&& [] === $destination->partitionPlaceholders()
) {
throw new RuntimeException("Destination path can't be pattern, given: " . $destination->uri());
diff --git a/src/core/etl/src/Flow/ETL/IO/Loader/File/PartitionRouter.php b/src/core/etl/src/Flow/ETL/IO/Loader/File/PartitionRouter.php
index 4b714d24e8..9d687b4fc2 100644
--- a/src/core/etl/src/Flow/ETL/IO/Loader/File/PartitionRouter.php
+++ b/src/core/etl/src/Flow/ETL/IO/Loader/File/PartitionRouter.php
@@ -62,7 +62,7 @@ public function route(Rows $rows): Generator
$stripped = $this->dropped === [] ? $schema : $schema->gracefulRemove(...$this->partitioning->by->names());
- foreach (KeyGrouping::indices((new KeyEncoder($this->partitioning->by->names()))->of($rows)) as $indices) {
+ foreach (KeyGrouping::indices(new KeyEncoder($this->partitioning->by->names())->of($rows)) as $indices) {
$group = $rows->gather($indices);
yield [
diff --git a/src/core/etl/src/Flow/ETL/Kernels/HashJoin/JoinKeys.php b/src/core/etl/src/Flow/ETL/Kernels/HashJoin/JoinKeys.php
index f3304642a0..16ecbe9fd2 100644
--- a/src/core/etl/src/Flow/ETL/Kernels/HashJoin/JoinKeys.php
+++ b/src/core/etl/src/Flow/ETL/Kernels/HashJoin/JoinKeys.php
@@ -94,7 +94,7 @@ public function types(?Schema $left, ?Schema $right): array
$rightDefinition = $right?->findDefinition($this->right[$position]);
if ($leftDefinition !== null && $rightDefinition !== null) {
- $types[$position] = (new ValueEquality())->type($leftDefinition->type(), $rightDefinition->type());
+ $types[$position] = new ValueEquality()->type($leftDefinition->type(), $rightDefinition->type());
}
}
diff --git a/src/core/etl/src/Flow/ETL/Kernels/Join/JoinSchema.php b/src/core/etl/src/Flow/ETL/Kernels/Join/JoinSchema.php
index 80cfa51a89..37887e3f63 100644
--- a/src/core/etl/src/Flow/ETL/Kernels/Join/JoinSchema.php
+++ b/src/core/etl/src/Flow/ETL/Kernels/Join/JoinSchema.php
@@ -27,7 +27,7 @@ public function __construct(
public function cross(Schema $left, Schema $right): Schema
{
- return (new self($this->prefix, $this->dropLeft, $this->dropRight))->output($left, $right);
+ return new self($this->prefix, $this->dropLeft, $this->dropRight)->output($left, $right);
}
public function merger(Schema $left, Schema $right): RowMerger
diff --git a/src/core/etl/src/Flow/ETL/Kernels/Sort/ExternalSort.php b/src/core/etl/src/Flow/ETL/Kernels/Sort/ExternalSort.php
index 3efe93445a..2ccbbdcb11 100644
--- a/src/core/etl/src/Flow/ETL/Kernels/Sort/ExternalSort.php
+++ b/src/core/etl/src/Flow/ETL/Kernels/Sort/ExternalSort.php
@@ -283,7 +283,7 @@ public function merge(array $streams, Backend $backend, MemoryBudget $budget, Ba
}
// held in a variable, so the keys are still alive when the second measurement runs
- $_keys = (new RowOrder($this->columns))->keys($first);
+ $_keys = new RowOrder($this->columns)->keys($first);
$perFrame = $full - $budget->remaining();
// a merge round copies the held rows twice more
$remaining = intdiv($full, 2);
@@ -304,7 +304,7 @@ function (array $group) use ($merger, &$mergedIndex): Generator {
);
}
- yield from (new KWayMerge($this->columns, $backend, $output))->merge($streams);
+ yield from new KWayMerge($this->columns, $backend, $output)->merge($streams);
return;
}
@@ -313,7 +313,7 @@ function (array $group) use ($merger, &$mergedIndex): Generator {
? self::MERGE_CURSOR_ROWS
: min(self::MERGE_CURSOR_ROWS, $frames * max(1, $first->count()));
- yield from (new KWayMerge($this->columns, $backend, $output))->merge(array_map(
+ yield from new KWayMerge($this->columns, $backend, $output)->merge(array_map(
static fn(Generator $stream): Generator => self::coalesced($stream, $cursorRows, $backend),
$streams,
));
diff --git a/src/core/etl/src/Flow/ETL/Operators/Constraint/UniqueConstraint.php b/src/core/etl/src/Flow/ETL/Operators/Constraint/UniqueConstraint.php
index e9458e0cbe..2055a34066 100644
--- a/src/core/etl/src/Flow/ETL/Operators/Constraint/UniqueConstraint.php
+++ b/src/core/etl/src/Flow/ETL/Operators/Constraint/UniqueConstraint.php
@@ -39,7 +39,7 @@ public function firstViolation(Rows $rows): ?int
return null;
}
- $new = $this->seen->add((new KeyEncoder($this->reference->names()))->of($rows));
+ $new = $this->seen->add(new KeyEncoder($this->reference->names())->of($rows));
// rows 0..n-1 all bring a new key until the first that does not
foreach ($new as $position => $row) {
diff --git a/src/core/etl/src/Flow/ETL/Operators/Join/CrossJoin.php b/src/core/etl/src/Flow/ETL/Operators/Join/CrossJoin.php
index 67c72873b7..af8ae5fac2 100644
--- a/src/core/etl/src/Flow/ETL/Operators/Join/CrossJoin.php
+++ b/src/core/etl/src/Flow/ETL/Operators/Join/CrossJoin.php
@@ -23,7 +23,7 @@ public function __construct(
*/
public function bind(Schema $left, Schema $right): BoundStep
{
- return new BoundStep($this, (new JoinSchema($this->prefix))->cross($left, $right));
+ return new BoundStep($this, new JoinSchema($this->prefix)->cross($left, $right));
}
/**
diff --git a/src/core/etl/src/Flow/ETL/Operators/Join/HashJoin.php b/src/core/etl/src/Flow/ETL/Operators/Join/HashJoin.php
index f0bf52d280..8e18bea77a 100644
--- a/src/core/etl/src/Flow/ETL/Operators/Join/HashJoin.php
+++ b/src/core/etl/src/Flow/ETL/Operators/Join/HashJoin.php
@@ -213,14 +213,14 @@ public function join(Generator $left, Generator $right, Backend $backend): Gener
// right rows with a null join key can never match, they only surface in right join output
if ($equalityKeys !== null && $this->type->dropsNullKeys(Side::right)) {
- $rightRows = (new NullKeyFilter($equalityKeys->right))->rows($rightRows);
+ $rightRows = new NullKeyFilter($equalityKeys->right)->rows($rightRows);
}
/** @var null|list $held the build side, when all of it fits under the memory limit */
$held = null;
if (!$resident) {
- [$read, $fits] = (new BoundedRead($budget))->read($rightRows);
+ [$read, $fits] = new BoundedRead($budget)->read($rightRows);
if ($fits) {
$held = $read;
@@ -233,7 +233,7 @@ public function join(Generator $left, Generator $right, Backend $backend): Gener
// left rows with a null join key can never match, they only surface in left/left_anti output
if ($equalityKeys !== null && $this->type->dropsNullKeys(Side::left)) {
- $leftRows = (new NullKeyFilter($equalityKeys->left))->rows($leftRows);
+ $leftRows = new NullKeyFilter($equalityKeys->left)->rows($leftRows);
}
// the right buckets key in the type both sides compare in, so an undeclared left side shows its first batch
diff --git a/src/core/etl/src/Flow/ETL/Operators/Processor/BoundExpansion.php b/src/core/etl/src/Flow/ETL/Operators/Processor/BoundExpansion.php
index 7337264097..48c34e88fe 100644
--- a/src/core/etl/src/Flow/ETL/Operators/Processor/BoundExpansion.php
+++ b/src/core/etl/src/Flow/ETL/Operators/Processor/BoundExpansion.php
@@ -55,7 +55,7 @@ public static function of(
$resolver = new ReferenceResolver();
$resolved = $resolver->resolve($function, $input);
$resolver->assertResolved($resolved, $input);
- (new ExpandingFunctions())->refuseNested($resolved);
+ new ExpandingFunctions()->refuseNested($resolved);
$expansion = Expansion::of($resolved, $input) ?? throw InvalidLogicException::because(
'%s holds no array_expand(), it is not an expansion',
@@ -70,7 +70,7 @@ public static function of(
if ($root instanceof UnpackResults) {
$written = [];
- foreach ((new UnpackedColumns())
+ foreach (new UnpackedColumns()
->declared($root)
->names() as $unpacked) {
$written[] = $name . '.' . $unpacked;
@@ -92,7 +92,7 @@ public static function of(
}
}
- $rootReads = array_diff((new ReferencedColumns())->in($root)->names(), $synthesizedNames);
+ $rootReads = array_diff(new ReferencedColumns()->in($root)->names(), $synthesizedNames);
$gathered = [];
foreach ($input->definitions() as $definition) {
diff --git a/src/core/etl/src/Flow/ETL/Operators/Processor/CountingProcessor.php b/src/core/etl/src/Flow/ETL/Operators/Processor/CountingProcessor.php
index 00ce8e4e6a..b95bdb5149 100644
--- a/src/core/etl/src/Flow/ETL/Operators/Processor/CountingProcessor.php
+++ b/src/core/etl/src/Flow/ETL/Operators/Processor/CountingProcessor.php
@@ -54,7 +54,7 @@ public function process(Generator $rows, Backend $backend): Generator
*/
public static function rows(int $count, Backend $backend): Rows
{
- return (new RowsBuilder(self::schema(), $backend))->appendRecords([['count' => $count]])->finish();
+ return new RowsBuilder(self::schema(), $backend)->appendRecords([['count' => $count]])->finish();
}
public static function schema(): Schema
diff --git a/src/core/etl/src/Flow/ETL/Operators/Processor/GroupByAggregationProcessor.php b/src/core/etl/src/Flow/ETL/Operators/Processor/GroupByAggregationProcessor.php
index fd74c39a6b..0868b6bc35 100644
--- a/src/core/etl/src/Flow/ETL/Operators/Processor/GroupByAggregationProcessor.php
+++ b/src/core/etl/src/Flow/ETL/Operators/Processor/GroupByAggregationProcessor.php
@@ -133,18 +133,18 @@ public function distribution(): ?Distribution
$this->shape->input,
$partial->aggregations()->resolved($this->shape->input),
);
- $partialStep = (new self(
+ $partialStep = new self(
$partial,
$this->config,
$this->random,
progress: $this->progress,
- ))->bind($this->shape->input)->step;
- $finalStep = (new self(
+ )->bind($this->shape->input)->step;
+ $finalStep = new self(
new GroupBy($this->groupBy->refs(), new Aggregators(...$merged)),
$this->config,
$this->random,
progress: $this->progress,
- ))->bind($partialSchema)->step;
+ )->bind($partialSchema)->step;
$keys = $this->groupBy->refs()->names();
@@ -233,7 +233,7 @@ public function process(Generator $rows, Backend $backend): Generator
// SQL scalar aggregate: no input still yields one row
if ($shape !== null && $this->groupBy->isGlobal()) {
- yield (new AggregatedGroups($this->groupBy, $shape, $backend, $this->progress))->noInputRow($backend);
+ yield new AggregatedGroups($this->groupBy, $shape, $backend, $this->progress)->noInputRow($backend);
}
$this->progress->done();
diff --git a/src/core/etl/src/Flow/ETL/Operators/Processor/RepartitionProcessor.php b/src/core/etl/src/Flow/ETL/Operators/Processor/RepartitionProcessor.php
index 870a17bb88..f74b872d5e 100644
--- a/src/core/etl/src/Flow/ETL/Operators/Processor/RepartitionProcessor.php
+++ b/src/core/etl/src/Flow/ETL/Operators/Processor/RepartitionProcessor.php
@@ -93,7 +93,7 @@ public function process(Generator $rows, Backend $backend): Generator
$rows->valid();
$budget = MemoryBudget::of($backend, $this->config->memoryLimit);
$buckets = new Buckets($this->config->spilling($backend, $budget));
- [$read, $fits] = (new BoundedRead($budget))->read($rows);
+ [$read, $fits] = new BoundedRead($budget)->read($rows);
try {
if ($fits) {
@@ -108,12 +108,12 @@ public function process(Generator $rows, Backend $backend): Generator
return;
}
- foreach ((new HashBucketing(
+ foreach (new HashBucketing(
new KeyEncoder($this->by->names()),
$this->config->bucketsCount,
$this->random,
'repartition',
- ))->bucketize(BoundedRead::followedBy($read, $rows), $buckets->storage(), $backend) as $bucket) {
+ )->bucketize(BoundedRead::followedBy($read, $rows), $buckets->storage(), $backend) as $bucket) {
$buckets->add($bucket);
}
diff --git a/src/core/etl/src/Flow/ETL/Operators/Processor/RequiredColumns.php b/src/core/etl/src/Flow/ETL/Operators/Processor/RequiredColumns.php
index 9e4fc24ba8..480f9ee85b 100644
--- a/src/core/etl/src/Flow/ETL/Operators/Processor/RequiredColumns.php
+++ b/src/core/etl/src/Flow/ETL/Operators/Processor/RequiredColumns.php
@@ -64,7 +64,7 @@ public function union(self $other): self
public function beforeWriting(string $name, ScalarFunction $function): self
{
- $read = (new ReferencedColumns())->in($function)->names();
+ $read = new ReferencedColumns()->in($function)->names();
// an unpack writes "name.*", known only once bound: keep the demand, add what it reads
return $function instanceof UnpackResults ? $this->with(...$read) : $this->without($name)->with(...$read);
diff --git a/src/core/etl/src/Flow/ETL/Operators/Processor/WindowProcessor.php b/src/core/etl/src/Flow/ETL/Operators/Processor/WindowProcessor.php
index 0315e6c946..b79a1fcd36 100644
--- a/src/core/etl/src/Flow/ETL/Operators/Processor/WindowProcessor.php
+++ b/src/core/etl/src/Flow/ETL/Operators/Processor/WindowProcessor.php
@@ -117,7 +117,7 @@ public function process(Generator $rows, Backend $backend): Generator
*/
private function boundTo(Schema $input): BoundWindow
{
- $resolved = (new ReferenceResolver())->bind($this->function, $input, 'over');
+ $resolved = new ReferenceResolver()->bind($this->function, $input, 'over');
self::assertWindowReferences($resolved, $input);
$derived = $this->column instanceof Definition
diff --git a/src/core/etl/src/Flow/ETL/Operators/Transformer/DerivedColumns.php b/src/core/etl/src/Flow/ETL/Operators/Transformer/DerivedColumns.php
index fae7aade6a..5ee707dce1 100644
--- a/src/core/etl/src/Flow/ETL/Operators/Transformer/DerivedColumns.php
+++ b/src/core/etl/src/Flow/ETL/Operators/Transformer/DerivedColumns.php
@@ -26,7 +26,7 @@
*/
public function stored(Definition $derived, Column $column, Backend $backend): Column
{
- (new ColumnRetyping())->notNull($derived, $column);
+ new ColumnRetyping()->notNull($derived, $column);
if (type_bare($column->type())->normalize() === type_bare($derived->type())->normalize()) {
return $backend->adopt($derived, $column->withType($derived->type()));
diff --git a/src/core/etl/src/Flow/ETL/Operators/Transformer/DuplicateRowTransformer.php b/src/core/etl/src/Flow/ETL/Operators/Transformer/DuplicateRowTransformer.php
index 9b1bb7c3bb..88ff77d868 100644
--- a/src/core/etl/src/Flow/ETL/Operators/Transformer/DuplicateRowTransformer.php
+++ b/src/core/etl/src/Flow/ETL/Operators/Transformer/DuplicateRowTransformer.php
@@ -22,7 +22,7 @@
use Flow\Types\Type\Unifier\PromotingUnifier;
use SensitiveParameter;
-use function array_key_last;
+use function array_last;
use function Flow\Types\DSL\type_equals;
use function Flow\Types\DSL\type_instance_of;
@@ -71,7 +71,7 @@ public function transform(Rows $rows, Backend $backend): Rows
$output = $this->output ?? $this->declare($rows->schema(), $steps);
$duplicated = [];
- foreach ((new Parameter($condition))->asBooleans($rows, $backend) as $position => $duplicate) {
+ foreach (new Parameter($condition)->asBooleans($rows, $backend) as $position => $duplicate) {
if ($duplicate ?? false) {
$duplicated[] = $position;
}
@@ -119,7 +119,7 @@ private function steps(Schema $input): array
$schema = $input;
foreach ($this->columns as $column) {
- (new ExpandingFunctions())->refuse($column->function, 'duplicateRow');
+ new ExpandingFunctions()->refuse($column->function, 'duplicateRow');
$step = $column->bind($schema);
$steps[] = $step;
$schema = $step->output;
@@ -135,7 +135,7 @@ private function steps(Schema $input): array
*/
private function declare(Schema $input, array $steps): Schema
{
- $duplicated = $steps === [] ? $input : $steps[array_key_last($steps)]->output;
+ $duplicated = $steps === [] ? $input : array_last($steps)->output;
$output = $input;
foreach ($duplicated->definitions() as $name => $definition) {
@@ -155,7 +155,7 @@ private function declare(Schema $input, array $steps): Schema
$output = $output->replace($name, Definitions::of(
$name,
- (new PromotingUnifier())->unifyAll(
+ new PromotingUnifier()->unifyAll(
NullabilityRule::ALL,
$existing->type(),
$definition->type(),
@@ -172,6 +172,6 @@ private function resolve(Schema $input): mixed
return $this->condition;
}
- return (new ReferenceResolver())->bind($this->condition, $input, 'duplicateRow');
+ return new ReferenceResolver()->bind($this->condition, $input, 'duplicateRow');
}
}
diff --git a/src/core/etl/src/Flow/ETL/Operators/Transformer/Expansion.php b/src/core/etl/src/Flow/ETL/Operators/Transformer/Expansion.php
index 0ebc9a5da9..63a5a54d1b 100644
--- a/src/core/etl/src/Flow/ETL/Operators/Transformer/Expansion.php
+++ b/src/core/etl/src/Flow/ETL/Operators/Transformer/Expansion.php
@@ -49,7 +49,7 @@ public static function of(ScalarFunction $resolved, Schema $input): ?self
{
$distinct = [];
- foreach ((new ExpandingFunctions())->in($resolved) as $expand) {
+ foreach (new ExpandingFunctions()->in($resolved) as $expand) {
$distinct[spl_object_id($expand)] = $expand;
}
@@ -69,7 +69,7 @@ public static function of(ScalarFunction $resolved, Schema $input): ?self
$name = "\0expand:" . $suffix++;
} while ($input->findDefinition($name) !== null);
- $type = $pads ? (new TypeWidener())->nullable($expand->returns()) : $expand->returns();
+ $type = $pads ? new TypeWidener()->nullable($expand->returns()) : $expand->returns();
$references[$id] = new ResolvedReference($name, $type);
$expandDefinitions[$name] = Definitions::of(
$name,
@@ -114,7 +114,7 @@ public function positions(Rows $rows, Backend $backend): array
$lists = [];
foreach ($this->expands as $name => $expand) {
- $lists[$name] = (new Parameter($expand))->values($rows, $backend);
+ $lists[$name] = new Parameter($expand)->values($rows, $backend);
}
$sources = [];
diff --git a/src/core/etl/src/Flow/ETL/Operators/Transformer/JoinEachRowsTransformer.php b/src/core/etl/src/Flow/ETL/Operators/Transformer/JoinEachRowsTransformer.php
index e5f7b83fd7..48d5999f88 100644
--- a/src/core/etl/src/Flow/ETL/Operators/Transformer/JoinEachRowsTransformer.php
+++ b/src/core/etl/src/Flow/ETL/Operators/Transformer/JoinEachRowsTransformer.php
@@ -103,7 +103,7 @@ public function transform(Rows $rows, Backend $backend): Rows
$schema->output($rows->schema(), $rightRows->schema()),
$backend,
...iterator_to_array(
- (new Joiner($this->type, $schema, $this->expression->keys(), $this->expression, $backend))->join(
+ new Joiner($this->type, $schema, $this->expression->keys(), $this->expression, $backend)->join(
JoinSide::of($single($rows), $rows->schema()),
JoinSide::of($single($rightRows), $rightRows->schema()),
),
diff --git a/src/core/etl/src/Flow/ETL/Operators/Transformer/ScalarFunctionTransformer.php b/src/core/etl/src/Flow/ETL/Operators/Transformer/ScalarFunctionTransformer.php
index b90a09c807..72a834c818 100644
--- a/src/core/etl/src/Flow/ETL/Operators/Transformer/ScalarFunctionTransformer.php
+++ b/src/core/etl/src/Flow/ETL/Operators/Transformer/ScalarFunctionTransformer.php
@@ -120,7 +120,7 @@ private function derived(ScalarFunction $source): Definition
*/
private function resolve(Schema $input): ScalarFunction
{
- return (new ReferenceResolver())->bind($this->function, $input, 'transform');
+ return new ReferenceResolver()->bind($this->function, $input, 'transform');
}
public function columnName(): string
diff --git a/src/core/etl/src/Flow/ETL/Operators/Transformer/UnserializeTransformer.php b/src/core/etl/src/Flow/ETL/Operators/Transformer/UnserializeTransformer.php
index 2c74488b6c..d41b0d7af8 100644
--- a/src/core/etl/src/Flow/ETL/Operators/Transformer/UnserializeTransformer.php
+++ b/src/core/etl/src/Flow/ETL/Operators/Transformer/UnserializeTransformer.php
@@ -33,7 +33,7 @@ public function __construct(
public function bind(Schema $input): BoundStep
{
- return new BoundStep($this, (new UnpackedColumns())->of($input, $this->mergePrefix, $this->target));
+ return new BoundStep($this, new UnpackedColumns()->of($input, $this->mergePrefix, $this->target));
}
public static function fromDescription(#[SensitiveParameter] array $data, Rebuild $rebuild): static
diff --git a/src/core/etl/src/Flow/ETL/Operators/Transformer/UntilTransformer.php b/src/core/etl/src/Flow/ETL/Operators/Transformer/UntilTransformer.php
index 8faadc7e1a..b53079a176 100644
--- a/src/core/etl/src/Flow/ETL/Operators/Transformer/UntilTransformer.php
+++ b/src/core/etl/src/Flow/ETL/Operators/Transformer/UntilTransformer.php
@@ -79,6 +79,6 @@ public function reached(): bool
*/
private function resolve(Schema $input): ScalarFunction
{
- return (new ReferenceResolver())->bind($this->function, $input, 'until', type_boolean());
+ return new ReferenceResolver()->bind($this->function, $input, 'until', type_boolean());
}
}
diff --git a/src/core/etl/src/Flow/ETL/Planning/Logical/Explain.php b/src/core/etl/src/Flow/ETL/Planning/Logical/Explain.php
index 5beb3a9a4f..71c1bfc73d 100644
--- a/src/core/etl/src/Flow/ETL/Planning/Logical/Explain.php
+++ b/src/core/etl/src/Flow/ETL/Planning/Logical/Explain.php
@@ -17,7 +17,7 @@
public function of(LogicalPlan $plan, Format $format = Format::tree): string
{
return $this->render(
- (new LogicalOutline(declarations: $format === Format::declarations))->of($plan->root),
+ new LogicalOutline(declarations: $format === Format::declarations)->of($plan->root),
$format,
);
}
@@ -27,7 +27,7 @@ public function of(LogicalPlan $plan, Format $format = Format::tree): string
*/
public function physical(PhysicalPlan $plan, Format $format = Format::tree): string
{
- return $this->render((new PhysicalOutline())->of($plan), $format);
+ return $this->render(new PhysicalOutline()->of($plan), $format);
}
public function render(RenderedNode $root, Format $format): string
diff --git a/src/core/etl/src/Flow/ETL/Planning/Logical/LogicalPlan.php b/src/core/etl/src/Flow/ETL/Planning/Logical/LogicalPlan.php
index f910b332ff..82bd27c8b4 100644
--- a/src/core/etl/src/Flow/ETL/Planning/Logical/LogicalPlan.php
+++ b/src/core/etl/src/Flow/ETL/Planning/Logical/LogicalPlan.php
@@ -145,7 +145,7 @@ public function consumerInputs(): array
*/
public function transformUp(Rewrite $rewrite): self
{
- $root = (new TransformUp())->of($this->root, $rewrite);
+ $root = new TransformUp()->of($this->root, $rewrite);
return $root === $this->root ? $this : new self($root);
}
diff --git a/src/core/etl/src/Flow/ETL/Planning/Logical/Node/Filter.php b/src/core/etl/src/Flow/ETL/Planning/Logical/Node/Filter.php
index b51718f8c0..8cbcc5baea 100644
--- a/src/core/etl/src/Flow/ETL/Planning/Logical/Node/Filter.php
+++ b/src/core/etl/src/Flow/ETL/Planning/Logical/Node/Filter.php
@@ -49,6 +49,6 @@ public function redefines(): Redefined
public function requiredInputColumns(RequiredColumns $output): RequiredColumns
{
- return $output->with(...(new ReferencedColumns())->in($this->function)->names());
+ return $output->with(...new ReferencedColumns()->in($this->function)->names());
}
}
diff --git a/src/core/etl/src/Flow/ETL/Planning/Logical/Plan.php b/src/core/etl/src/Flow/ETL/Planning/Logical/Plan.php
index b006e3066a..f720b2ed15 100644
--- a/src/core/etl/src/Flow/ETL/Planning/Logical/Plan.php
+++ b/src/core/etl/src/Flow/ETL/Planning/Logical/Plan.php
@@ -28,10 +28,10 @@ public static function of(LogicalPlan $logical, Planner $planner): self
public function toString(Stage $stage = Stage::optimized, Format $format = Format::tree): string
{
if ($stage === Stage::physical) {
- return (new Explain())->physical($this->planner->plan($this->logical), $format);
+ return new Explain()->physical($this->planner->plan($this->logical), $format);
}
- return (new Explain())->of(match ($stage) {
+ return new Explain()->of(match ($stage) {
Stage::unoptimized => $this->logical,
Stage::optimized => $this->planner->optimize($this->logical),
}, $format);
diff --git a/src/core/etl/src/Flow/ETL/Planning/Optimizer/Rule/PushFilterIntoSource.php b/src/core/etl/src/Flow/ETL/Planning/Optimizer/Rule/PushFilterIntoSource.php
index 34f72eaf26..de775b8e57 100644
--- a/src/core/etl/src/Flow/ETL/Planning/Optimizer/Rule/PushFilterIntoSource.php
+++ b/src/core/etl/src/Flow/ETL/Planning/Optimizer/Rule/PushFilterIntoSource.php
@@ -143,7 +143,7 @@ public function predicateAtLeaf(Node\Filter $filter, Read $leaf, ScalarFunction
}
$below = $redefined->aliasOf($name);
- $renamed = $below === null ? null : (new ReferenceRename($name, $below))->in($predicate);
+ $renamed = $below === null ? null : new ReferenceRename($name, $below)->in($predicate);
if (!$renamed instanceof ScalarFunction) {
return null;
diff --git a/src/core/etl/src/Flow/ETL/Planning/Physical/WritePlanner.php b/src/core/etl/src/Flow/ETL/Planning/Physical/WritePlanner.php
index abbcbb6736..71a741585e 100644
--- a/src/core/etl/src/Flow/ETL/Planning/Physical/WritePlanner.php
+++ b/src/core/etl/src/Flow/ETL/Planning/Physical/WritePlanner.php
@@ -14,7 +14,7 @@
use SplObjectStorage;
use function array_key_exists;
-use function array_key_last;
+use function array_last;
use function array_reverse;
use function array_slice;
use function count;
@@ -54,7 +54,7 @@ public function attach(Writes $writes, SplObjectStorage $onSpine): SplObjectStor
foreach ($root instanceof Transaction ? $root->children() : [$root] as $write) {
$chain = $this->chain($write, $onSpine);
- $bottom = $chain[array_key_last($chain)]->children()[0];
+ $bottom = array_last($chain)->children()[0];
if ($at !== null && $bottom !== $at) {
throw InvalidLogicException::because('Every write of one transaction must attach to the same node');
@@ -262,7 +262,7 @@ public function write(array $group, Node $host): Loader|BranchPipeline
$rest[] = [...$leaf, 'path' => array_slice($leaf['path'], count($shared))];
}
- return $this->branch($shared, $this->writes($rest, $shared[array_key_last($shared)]), $host);
+ return $this->branch($shared, $this->writes($rest, array_last($shared)), $host);
}
/**
diff --git a/src/core/etl/src/Flow/ETL/Runtime/Executor/Executor.php b/src/core/etl/src/Flow/ETL/Runtime/Executor/Executor.php
index 869ac29cf1..5aff19e5fe 100644
--- a/src/core/etl/src/Flow/ETL/Runtime/Executor/Executor.php
+++ b/src/core/etl/src/Flow/ETL/Runtime/Executor/Executor.php
@@ -216,7 +216,7 @@ private function run(
$started = false;
// the root of the source's `yield from` chain: a throw() into a delegate inside the chain is lost
$batches = $runner->started(
- $launch->rows ?? (new AdoptedBatches($context->backend()))->of($source->extract(
+ $launch->rows ?? new AdoptedBatches($context->backend())->of($source->extract(
$context->backend(),
$criteria,
)),
diff --git a/src/core/etl/src/Flow/ETL/Runtime/Executor/StepRunner.php b/src/core/etl/src/Flow/ETL/Runtime/Executor/StepRunner.php
index 63cbba2185..0d2af70f9f 100644
--- a/src/core/etl/src/Flow/ETL/Runtime/Executor/StepRunner.php
+++ b/src/core/etl/src/Flow/ETL/Runtime/Executor/StepRunner.php
@@ -339,7 +339,7 @@ private function loadRejects(Loader $rejects, array $records, FlowContext $conte
{
$this->load(
$rejects,
- (new RowsBuilder(
+ new RowsBuilder(
new Schema(
new StringDefinition('uri', nullable: true),
new IntegerDefinition('offset'),
@@ -349,7 +349,7 @@ private function loadRejects(Loader $rejects, array $records, FlowContext $conte
new ListDefinition('fields', type_list(type_string()), nullable: true),
),
$context->backend(),
- ))
+ )
->appendRecords($records)
->finish(),
$context,
@@ -515,9 +515,9 @@ public function unwind(Generator $input, Throwable $failure, FlowContext $contex
}
if ($input->valid()) {
- $function = (new ReflectionGenerator(
- (new ReflectionGenerator($input))->getExecutingGenerator(),
- ))->getFunction();
+ $function = new ReflectionGenerator(
+ new ReflectionGenerator($input)->getExecutingGenerator(),
+ )->getFunction();
$context
->telemetry()
->logger()
diff --git a/src/core/etl/src/Flow/ETL/Runtime/Executor/TransactionLoader.php b/src/core/etl/src/Flow/ETL/Runtime/Executor/TransactionLoader.php
index fe03ff8e8c..aaa316daa8 100644
--- a/src/core/etl/src/Flow/ETL/Runtime/Executor/TransactionLoader.php
+++ b/src/core/etl/src/Flow/ETL/Runtime/Executor/TransactionLoader.php
@@ -52,7 +52,7 @@ public function load(Rows $rows): LoadingError|TransformationError|null
$this->writes->offsetGet($child)->advanced($rows->count());
}
- (new StepTelemetry())->load($child, $rows, $this->context);
+ new StepTelemetry()->load($child, $rows, $this->context);
} else {
$error = $child->load($rows);
}
diff --git a/src/core/etl/src/Flow/ETL/Runtime/Executor/WholeOutputHasher.php b/src/core/etl/src/Flow/ETL/Runtime/Executor/WholeOutputHasher.php
index c7ef549d12..ae4f3ce224 100644
--- a/src/core/etl/src/Flow/ETL/Runtime/Executor/WholeOutputHasher.php
+++ b/src/core/etl/src/Flow/ETL/Runtime/Executor/WholeOutputHasher.php
@@ -60,13 +60,13 @@ public function absorb(DatasetHash $partial): void
public function hash(): DatasetHash
{
- return (new DatasetHash(
+ return new DatasetHash(
new Hash(
$this->rows,
type_string()->assert($this->hasher?->hashes()->physicals()[0] ?? MultisetDigest::empty()->hex()),
),
[],
$this->algorithm,
- ))->plus($this->absorbed);
+ )->plus($this->absorbed);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Runtime/Metrics/Statistics/Column.php b/src/core/etl/src/Flow/ETL/Runtime/Metrics/Statistics/Column.php
index 05933478bd..d75f0b2eb3 100644
--- a/src/core/etl/src/Flow/ETL/Runtime/Metrics/Statistics/Column.php
+++ b/src/core/etl/src/Flow/ETL/Runtime/Metrics/Statistics/Column.php
@@ -96,7 +96,7 @@ public function add(Definition $definition, ColumnData $column): void
};
// every non-null value of the batch, typed: -0.0 is 0.0, NaN is NaN, datetimes keep their microseconds
- $keys = (new KeyEncoder([$definition->name()]))->of(Rows::fromColumns(
+ $keys = new KeyEncoder([$definition->name()])->of(Rows::fromColumns(
new Schema($definition),
[$definition->name() => $column],
$column->count(),
diff --git a/src/core/etl/src/Flow/ETL/Storage/Floe/FloeFiles.php b/src/core/etl/src/Flow/ETL/Storage/Floe/FloeFiles.php
index a8f21d0470..ec943e0cb0 100644
--- a/src/core/etl/src/Flow/ETL/Storage/Floe/FloeFiles.php
+++ b/src/core/etl/src/Flow/ETL/Storage/Floe/FloeFiles.php
@@ -53,7 +53,7 @@ public function append(Path $path, Schema $schema, ?Metadata $metadata = null):
return $this->create($path, $schema, $metadata);
}
- $location = (new FooterReader())->read($source, $this->options->codec);
+ $location = new FooterReader()->read($source, $this->options->codec);
$source->close();
return FloeStreamWriter::resume(
diff --git a/src/core/etl/src/Flow/ETL/Storage/Floe/FloeMerger.php b/src/core/etl/src/Flow/ETL/Storage/Floe/FloeMerger.php
index dbf3d8f9fa..ffc0e72734 100644
--- a/src/core/etl/src/Flow/ETL/Storage/Floe/FloeMerger.php
+++ b/src/core/etl/src/Flow/ETL/Storage/Floe/FloeMerger.php
@@ -107,7 +107,7 @@ private function reconcile(array $sources): array
}
if ($merged !== null) {
- $validation = (new EvolvingValidator())->validate($merged, $schema);
+ $validation = new EvolvingValidator()->validate($merged, $schema);
if (!$validation->isValid()) {
throw new IncompatibleSchemaException(sprintf(
@@ -211,14 +211,14 @@ private function mergeSplice(array $sources, array $layouts, ?Schema $merged, Pa
$schema = $merged?->normalize() ?? [];
$frameWriter->footer(
- (new Footer(
+ new Footer(
Format::VERSION,
FloeStreamWriter::writerVersion(),
$schema,
$sections,
new FooterStatistics($totalRows, $frameWriter->position() - Format::HEADER_LENGTH),
$mergedMetadata->merge($metadata),
- ))->toJson(),
+ )->toJson(),
);
$frameWriter->close();
}
@@ -235,7 +235,7 @@ private function readLayout(Path $source): FooterLocation
$stream = $this->filesystem->readFrom($source);
try {
- return (new FooterReader())->read($stream, $this->codec);
+ return new FooterReader()->read($stream, $this->codec);
} finally {
$stream->close();
}
diff --git a/src/core/etl/src/Flow/ETL/Storage/Floe/FloeStreamReader.php b/src/core/etl/src/Flow/ETL/Storage/Floe/FloeStreamReader.php
index 6f45ff3bc8..e366aadbd3 100644
--- a/src/core/etl/src/Flow/ETL/Storage/Floe/FloeStreamReader.php
+++ b/src/core/etl/src/Flow/ETL/Storage/Floe/FloeStreamReader.php
@@ -51,7 +51,7 @@ public function close(): void
*/
public function footer(): Footer
{
- return $this->footer ??= (new FooterReader())->read($this->source, $this->codec)->footer;
+ return $this->footer ??= new FooterReader()->read($this->source, $this->codec)->footer;
}
/**
diff --git a/src/core/etl/src/Flow/ETL/Storage/Floe/FloeStreamWriter.php b/src/core/etl/src/Flow/ETL/Storage/Floe/FloeStreamWriter.php
index bf09e8933e..a27cc5410b 100644
--- a/src/core/etl/src/Flow/ETL/Storage/Floe/FloeStreamWriter.php
+++ b/src/core/etl/src/Flow/ETL/Storage/Floe/FloeStreamWriter.php
@@ -143,14 +143,14 @@ public function close(): void
$schema = $this->sessionSchema->normalize();
$this->frameWriter->footer(
- (new Footer(
+ new Footer(
Format::VERSION,
self::writerVersion(),
$schema,
$this->sections,
new FooterStatistics($this->totalRows, $this->frameWriter->position() - Format::HEADER_LENGTH),
$this->metadata,
- ))->toJson(),
+ )->toJson(),
);
$this->frameWriter->close();
$this->closed = true;
@@ -208,7 +208,7 @@ private function assertBatchFitsSession(Schema $batch): void
}
}
- $validation = (new EvolvingValidator())->validate($this->sessionSchema, $batch);
+ $validation = new EvolvingValidator()->validate($this->sessionSchema, $batch);
if (!$validation->isValid()) {
throw new IncompatibleSchemaException(sprintf(self::BATCH_MISMATCH, $validation->toString()));
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/CanonicalEncoding.php b/src/core/etl/src/Flow/ETL/Values/Column/CanonicalEncoding.php
index ab84f36801..8fbd1aa656 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/CanonicalEncoding.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/CanonicalEncoding.php
@@ -300,13 +300,10 @@ private function writer(Type $type): Closure
$base instanceof EnumType => $this->text(self::ENUM),
$base instanceof XMLType => $this->text(self::XML),
$base instanceof HTMLType => $this->text(self::HTML),
- $base instanceof XMLElementType => $this->element(
- self::XML_ELEMENT,
- (new XmlElementPhysical())->markup(...),
- ),
+ $base instanceof XMLElementType => $this->element(self::XML_ELEMENT, new XmlElementPhysical()->markup(...)),
$base instanceof HTMLElementType => $this->element(
self::HTML_ELEMENT,
- (new HtmlElementPhysical())->markup(...),
+ new HtmlElementPhysical()->markup(...),
),
$base instanceof TimeZoneType => $this->text(self::TIMEZONE),
$base instanceof UuidType => static fn(string $physical): string => self::UUID . $physical,
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/ComparableValues.php b/src/core/etl/src/Flow/ETL/Values/Column/ComparableValues.php
index 987e71af05..e5259adb13 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/ComparableValues.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/ComparableValues.php
@@ -112,7 +112,7 @@ public function equalities(Type $type, array $physicals): array
}
return $element instanceof HTMLElementType || $element instanceof XMLElementType
- ? (new TextValues())->of($type, $physicals)
+ ? new TextValues()->of($type, $physicals)
: $physicals;
}
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/Layout/BufferLayout.php b/src/core/etl/src/Flow/ETL/Values/Column/Layout/BufferLayout.php
index 4dbe26eaf8..d969c4cb8b 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/Layout/BufferLayout.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/Layout/BufferLayout.php
@@ -82,7 +82,7 @@ public function bufferCount(Type $type): int
return $buffers;
}
- return (new PhysicalFor())->layout($type) instanceof Utf8Layout ? 3 : 2;
+ return new PhysicalFor()->layout($type) instanceof Utf8Layout ? 3 : 2;
}
/**
@@ -158,7 +158,7 @@ public function nodes(Type $type, int $length, int $nullCount, array $buffers):
$childLength,
($childType instanceof OptionalType ? $childType->base() : $childType) instanceof NullType
? $childLength
- : (new Validity())->nullCount($childBuffers[0], $childLength),
+ : new Validity()->nullCount($childBuffers[0], $childLength),
$childBuffers,
));
}
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/MultisetDigest.php b/src/core/etl/src/Flow/ETL/Values/Column/MultisetDigest.php
index 0cccf8dce1..385e19ba37 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/MultisetDigest.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/MultisetDigest.php
@@ -46,7 +46,7 @@ public static function fromHex(string $hex): self
*/
public static function ofHalfSums(int $lowLow, int $lowHigh, int $highLow, int $highHigh): self
{
- return (new self($lowLow, $highLow))->plus(new self($lowHigh << 32, $highHigh << 32));
+ return new self($lowLow, $highLow)->plus(new self($lowHigh << 32, $highHigh << 32));
}
public function plus(self $other): self
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/Php/ColumnDecoder.php b/src/core/etl/src/Flow/ETL/Values/Column/Php/ColumnDecoder.php
index 824aa7e26e..963dafeb7c 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/Php/ColumnDecoder.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/Php/ColumnDecoder.php
@@ -80,7 +80,7 @@ public function decode(Type $type, Buffers $buffers, int $count, int $nullCount)
}
if ($base instanceof ListType) {
- $offsets = (new Offsets())->unpack($own->next(), $count, 'List');
+ $offsets = new Offsets()->unpack($own->next(), $count, 'List');
$element = $base->element();
[$length, $nulls] = $nodes[1];
@@ -101,7 +101,7 @@ public function decode(Type $type, Buffers $buffers, int $count, int $nullCount)
}
if ($base instanceof MapType) {
- $offsets = (new Offsets())->unpack($own->next(), $count, 'Map');
+ $offsets = new Offsets()->unpack($own->next(), $count, 'Map');
$own->next();
$key = $base->key();
$value = $base->value();
@@ -148,8 +148,8 @@ public function decode(Type $type, Buffers $buffers, int $count, int $nullCount)
return new ScalarColumn(
$type,
- (new PhysicalFor())->physical($type),
- (new PhysicalFor())
+ new PhysicalFor()->physical($type),
+ new PhysicalFor()
->layout($type)
->decode($own, $count, $valid),
$derived,
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/Php/ConstantColumn.php b/src/core/etl/src/Flow/ETL/Values/Column/Php/ConstantColumn.php
index e36948cc6b..4aaffb0701 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/Php/ConstantColumn.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/Php/ConstantColumn.php
@@ -66,7 +66,7 @@ public function expand(): Column
return $this;
}
- $builder = (new PhysicalFor())->builder($this->type);
+ $builder = new PhysicalFor()->builder($this->type);
$builder->appendPhysicals($this->physicals());
return $builder->finish();
@@ -121,8 +121,8 @@ public function values(): array
public function withType(Type $type): Column
{
- (new Retype())->assert($this->type, $type, $this->nullCount());
+ new Retype()->assert($this->type, $type, $this->nullCount());
- return new self($type, (new PhysicalFor())->physical($type), $this->physicalValue, $this->count);
+ return new self($type, new PhysicalFor()->physical($type), $this->physicalValue, $this->count);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/Php/ListColumn.php b/src/core/etl/src/Flow/ETL/Values/Column/Php/ListColumn.php
index 8884f4419e..3aa131ca44 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/Php/ListColumn.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/Php/ListColumn.php
@@ -80,8 +80,8 @@ public function count(): int
public function encode(): array
{
return [
- (new Validity())->fromNulls($this->nulls, $this->count()),
- (new Offsets())->pack($this->offsets),
+ new Validity()->fromNulls($this->nulls, $this->count()),
+ new Offsets()->pack($this->offsets),
...$this->element->encode(),
];
}
@@ -166,7 +166,7 @@ public function values(): array
public function withType(Type $type): Column
{
- (new Retype())->assert($this->type, $type, count($this->nulls));
+ new Retype()->assert($this->type, $type, count($this->nulls));
$list = $type instanceof OptionalType ? $type->base() : $type;
assert($list instanceof ListType);
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/Php/MapColumn.php b/src/core/etl/src/Flow/ETL/Values/Column/Php/MapColumn.php
index e9e96d7131..f97cac6902 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/Php/MapColumn.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/Php/MapColumn.php
@@ -95,8 +95,8 @@ public function count(): int
public function encode(): array
{
return [
- (new Validity())->fromNulls($this->nulls, $this->count()),
- (new Offsets())->pack($this->offsets),
+ new Validity()->fromNulls($this->nulls, $this->count()),
+ new Offsets()->pack($this->offsets),
'',
...$this->keys->encode(),
...$this->values->encode(),
@@ -212,7 +212,7 @@ public function values(): array
public function withType(Type $type): Column
{
- (new Retype())->assert($this->type, $type, count($this->nulls));
+ new Retype()->assert($this->type, $type, count($this->nulls));
$map = $type instanceof OptionalType ? $type->base() : $type;
assert($map instanceof MapType);
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/Php/PhpGroupedCounts.php b/src/core/etl/src/Flow/ETL/Values/Column/Php/PhpGroupedCounts.php
index ff943f7849..24c854dca6 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/Php/PhpGroupedCounts.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/Php/PhpGroupedCounts.php
@@ -48,7 +48,7 @@ public function add(Column $values, Column $ids): void
public function counts(): Column
{
- return new ScalarColumn(type_integer(), (new PhysicalFor())->physical(type_integer()), $this->counts, 0);
+ return new ScalarColumn(type_integer(), new PhysicalFor()->physical(type_integer()), $this->counts, 0);
}
public function partials(): array
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/Php/PhpGroupedMultisetHashes.php b/src/core/etl/src/Flow/ETL/Values/Column/Php/PhpGroupedMultisetHashes.php
index 28dbbd689d..e8e9de71a1 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/Php/PhpGroupedMultisetHashes.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/Php/PhpGroupedMultisetHashes.php
@@ -75,7 +75,7 @@ public function hashes(): Column
{
return new ScalarColumn(
type_string(),
- (new PhysicalFor())->physical(type_string()),
+ new PhysicalFor()->physical(type_string()),
array_map(static fn(MultisetDigest $digest): string => $digest->hex(), $this->digests),
0,
);
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/Php/PhpGroupedTotals.php b/src/core/etl/src/Flow/ETL/Values/Column/Php/PhpGroupedTotals.php
index 64aa35daa4..8f98378868 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/Php/PhpGroupedTotals.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/Php/PhpGroupedTotals.php
@@ -57,7 +57,7 @@ public function sums(): Column
$sums[] = is_float($sum) && is_finite($sum) ? $sum + $this->compensations[$id] : (float) $sum;
}
- return new ScalarColumn(type_float(), (new PhysicalFor())->physical(type_float()), $sums, $nulls);
+ return new ScalarColumn(type_float(), new PhysicalFor()->physical(type_float()), $sums, $nulls);
}
public function absorbEarlier(GroupedTotals $earlier, array $into): void
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/Php/ScalarColumn.php b/src/core/etl/src/Flow/ETL/Values/Column/Php/ScalarColumn.php
index 972159c98f..b96366cc8d 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/Php/ScalarColumn.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/Php/ScalarColumn.php
@@ -61,8 +61,8 @@ public function count(): int
public function encode(): array
{
return [
- (new Validity())->fromValues($this->values),
- ...(new PhysicalFor())
+ new Validity()->fromValues($this->values),
+ ...new PhysicalFor()
->layout($this->type)
->encode($this->values),
];
@@ -91,7 +91,7 @@ public function slice(int $offset, int $length): Column
$this->type,
$this->physical,
$values,
- $this->nullCount === 0 ? 0 : (new NullCount())->of($values),
+ $this->nullCount === 0 ? 0 : new NullCount()->of($values),
);
}
@@ -107,7 +107,7 @@ public function take(array $indices): Column
$this->type,
$this->physical,
$values,
- $this->nullCount === 0 ? 0 : (new NullCount())->of($values),
+ $this->nullCount === 0 ? 0 : new NullCount()->of($values),
);
}
@@ -128,8 +128,8 @@ public function values(): array
public function withType(Type $type): Column
{
- (new Retype())->assert($this->type, $type, $this->nullCount);
+ new Retype()->assert($this->type, $type, $this->nullCount);
- return new self($type, (new PhysicalFor())->physical($type), $this->values, $this->nullCount);
+ return new self($type, new PhysicalFor()->physical($type), $this->values, $this->nullCount);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/Php/StructColumn.php b/src/core/etl/src/Flow/ETL/Values/Column/Php/StructColumn.php
index c39717e0c5..ffec0bef5a 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/Php/StructColumn.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/Php/StructColumn.php
@@ -12,8 +12,8 @@
use Flow\Types\Type\Logical\OptionalType;
use Flow\Types\Type\Logical\StructureType;
+use function array_first;
use function array_key_exists;
-use function array_key_first;
use function assert;
use function count;
use function range;
@@ -90,12 +90,12 @@ public function concat(Column ...$others): Column
public function count(): int
{
- return $this->children[array_key_first($this->children)]->count();
+ return array_first($this->children)->count();
}
public function encode(): array
{
- $buffers = [(new Validity())->fromNulls($this->nulls, $this->count())];
+ $buffers = [new Validity()->fromNulls($this->nulls, $this->count())];
foreach ($this->children as $child) {
foreach ($child->encode() as $buffer) {
@@ -255,7 +255,7 @@ public function values(): array
public function withType(Type $type): Column
{
- (new Retype())->assert($this->type, $type, count($this->nulls));
+ new Retype()->assert($this->type, $type, count($this->nulls));
$structure = $type instanceof OptionalType ? $type->base() : $type;
assert($structure instanceof StructureType);
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/PhpBackend.php b/src/core/etl/src/Flow/ETL/Values/Column/PhpBackend.php
index c020f4067f..ac85b87167 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/PhpBackend.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/PhpBackend.php
@@ -96,14 +96,14 @@ public function builder(Definition $definition): ColumnBuilder
{
return new CastingColumnBuilder(
$definition,
- (new PhysicalFor())->definition($definition),
- (new PhysicalFor())->builder($definition->type()),
+ new PhysicalFor()->definition($definition),
+ new PhysicalFor()->builder($definition->type()),
);
}
public function constant(Definition $definition, mixed $value, int $count): Column
{
- $physical = (new PhysicalFor())->definition($definition);
+ $physical = new PhysicalFor()->definition($definition);
if ($value === null) {
if (!$definition->isNullable() && !$definition instanceof NullDefinition) {
@@ -128,7 +128,7 @@ public function constant(Definition $definition, mixed $value, int $count): Colu
public function decode(Definition $definition, array $buffers, int $count, int $nullCount): Column
{
$cursor = new Buffers($buffers);
- $column = (new ColumnDecoder())->decode($definition->type(), $cursor, $count, $nullCount);
+ $column = new ColumnDecoder()->decode($definition->type(), $cursor, $count, $nullCount);
if ($cursor->remaining() !== 0) {
throw new InvalidArgumentException(sprintf(
@@ -370,8 +370,8 @@ public function compare(
$order = new ValueOrder($left->type(), $right->type());
$comparable = new ComparableValues();
$results = match ($operator) {
- Operator::EQUAL, Operator::NOT_EQUAL => (new ValueEquality())->equal($left, $right, $leftName, $rightName),
- Operator::IDENTICAL, Operator::NOT_IDENTICAL => (new ValueEquality())->identical($left, $right),
+ Operator::EQUAL, Operator::NOT_EQUAL => new ValueEquality()->equal($left, $right, $leftName, $rightName),
+ Operator::IDENTICAL, Operator::NOT_IDENTICAL => new ValueEquality()->identical($left, $right),
Operator::GREATER_THAN => $order->lessThan(...$comparable->orderings($right, $left)),
Operator::GREATER_THAN_EQUAL => $order->lessThanOrEqual(...$comparable->orderings($right, $left)),
Operator::LESS_THAN => $order->lessThan(...$comparable->orderings($left, $right)),
@@ -391,7 +391,7 @@ public function compare(
return new ScalarColumn(
$definition->type(),
- (new PhysicalFor())->definition($definition),
+ new PhysicalFor()->definition($definition),
$results,
count(array_keys($results, null, true)),
);
@@ -537,7 +537,7 @@ public function modulo(Column $left, Column $right): Column
$definition = Definitions::of('value', type_integer());
- return new ScalarColumn($definition->type(), (new PhysicalFor())->definition($definition), $results, 0);
+ return new ScalarColumn($definition->type(), new PhysicalFor()->definition($definition), $results, 0);
}
public function startsWith(Column $haystack, Column $needle): Column
@@ -645,7 +645,7 @@ public function orderedBytes(Column $column): int
return ($perRow * $column->count())
+ match (true) {
- (new ComparableValues())->equalByPhysical($column->type()) => 0,
+ new ComparableValues()->equalByPhysical($column->type()) => 0,
// values() builds a PHP array per row: packed (8 slots at least) for a list, hashed for a map or a structure
$column instanceof ListColumn => (192 * $column->count())
+ (32 * $column->element->count())
@@ -675,10 +675,10 @@ public function rowHashes(array $columns, int $count): Column
{
return new ScalarColumn(
type_string(),
- (new PhysicalFor())->physical(type_string()),
+ new PhysicalFor()->physical(type_string()),
array_map(
static fn(string $bytes): string => hash(HashAlgorithm::xxh128->value, $bytes),
- (new CanonicalEncoding())->named($columns, $count),
+ new CanonicalEncoding()->named($columns, $count),
),
0,
);
@@ -690,7 +690,7 @@ public function hash(Column $strings, HashAlgorithm $algorithm): Column
return new ScalarColumn(
$definition->type(),
- (new PhysicalFor())->definition($definition),
+ new PhysicalFor()->definition($definition),
array_map(static fn(?string $text): ?string => $text === null
? null
: hash($algorithm->value, $text), $strings->physicals()),
@@ -800,7 +800,7 @@ private function arithmeticResult(Column $left, Column $right, array $results):
: type_float(),
);
- return new ScalarColumn($definition->type(), (new PhysicalFor())->definition($definition), $results, 0);
+ return new ScalarColumn($definition->type(), new PhysicalFor()->definition($definition), $results, 0);
}
/**
@@ -812,7 +812,7 @@ private function booleans(array $results): Column
return new ScalarColumn(
$definition->type(),
- (new PhysicalFor())->definition($definition),
+ new PhysicalFor()->definition($definition),
$results,
count(array_keys($results, null, true)),
);
@@ -833,6 +833,6 @@ private function nullTest(Column $column, bool $isNull): Column
$definition = Definitions::of('value', type_boolean());
- return new ScalarColumn($definition->type(), (new PhysicalFor())->definition($definition), $results, 0);
+ return new ScalarColumn($definition->type(), new PhysicalFor()->definition($definition), $results, 0);
}
}
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/Physical/DatePhysical.php b/src/core/etl/src/Flow/ETL/Values/Column/Physical/DatePhysical.php
index 1590bb50ff..8219ceb4ad 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/Physical/DatePhysical.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/Physical/DatePhysical.php
@@ -42,7 +42,7 @@ public function fromPhysical(mixed $physical): mixed
{
assert(is_int($physical));
- return (new DateTimeImmutable('@' . ($physical * 86_400)))->setTimezone($this->utc);
+ return new DateTimeImmutable('@' . ($physical * 86_400))->setTimezone($this->utc);
}
public function fromPhysicalAll(array $physicals): array
@@ -58,7 +58,7 @@ public function fromPhysicalAll(array $physicals): array
}
assert(is_int($physical));
- $values[] = (new DateTimeImmutable('@' . ($physical * 86_400)))->setTimezone($this->utc);
+ $values[] = new DateTimeImmutable('@' . ($physical * 86_400))->setTimezone($this->utc);
}
return $values;
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/Physical/DateTimePhysical.php b/src/core/etl/src/Flow/ETL/Values/Column/Physical/DateTimePhysical.php
index 4fc2db678e..ed9efea73e 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/Physical/DateTimePhysical.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/Physical/DateTimePhysical.php
@@ -9,14 +9,10 @@
use DateTimeZone;
use Flow\Types\Exception\CastingException;
-use function abs;
use function assert;
use function Flow\Types\DSL\type_datetime;
use function intdiv;
use function is_int;
-use function sprintf;
-
-use const PHP_VERSION_ID;
final readonly class DateTimePhysical implements Physical
{
@@ -47,34 +43,20 @@ public function fromPhysical(mixed $physical): mixed
{
assert(is_int($physical));
- if (PHP_VERSION_ID >= 80400) {
- $seconds = intdiv($physical, 1_000_000);
- $micros = $physical % 1_000_000;
-
- if ($micros < 0) {
- $micros += 1_000_000;
- $seconds--;
- }
-
- // @mago-ignore analysis:unavailable-method
- $instant = DateTimeImmutable::createFromTimestamp($seconds);
+ $seconds = intdiv($physical, 1_000_000);
+ $micros = $physical % 1_000_000;
- // @mago-ignore analysis:unavailable-method
- return $instant->setMicrosecond($micros)->setTimezone($this->zone);
+ if ($micros < 0) {
+ $micros += 1_000_000;
+ $seconds--;
}
- return (new DateTimeImmutable(sprintf(
- '@%s%d.%06d',
- $physical < 0 ? '-' : '',
- intdiv(abs($physical), 1_000_000),
- abs($physical) % 1_000_000,
- )))->setTimezone($this->zone);
+ return DateTimeImmutable::createFromTimestamp($seconds)->setMicrosecond($micros)->setTimezone($this->zone);
}
public function fromPhysicalAll(array $physicals): array
{
$values = [];
- $modern = PHP_VERSION_ID >= 80400;
// @mago-ignore analysis:mixed-assignment
foreach ($physicals as $physical) {
@@ -86,29 +68,17 @@ public function fromPhysicalAll(array $physicals): array
assert(is_int($physical));
- if ($modern) {
- $seconds = intdiv($physical, 1_000_000);
- $micros = $physical % 1_000_000;
-
- if ($micros < 0) {
- $micros += 1_000_000;
- $seconds--;
- }
-
- // @mago-ignore analysis:unavailable-method
- $instant = DateTimeImmutable::createFromTimestamp($seconds);
- // @mago-ignore analysis:unavailable-method
- $values[] = $instant->setMicrosecond($micros)->setTimezone($this->zone);
+ $seconds = intdiv($physical, 1_000_000);
+ $micros = $physical % 1_000_000;
- continue;
+ if ($micros < 0) {
+ $micros += 1_000_000;
+ $seconds--;
}
- $values[] = (new DateTimeImmutable(sprintf(
- '@%s%d.%06d',
- $physical < 0 ? '-' : '',
- intdiv(abs($physical), 1_000_000),
- abs($physical) % 1_000_000,
- )))->setTimezone($this->zone);
+ $values[] = DateTimeImmutable::createFromTimestamp($seconds)
+ ->setMicrosecond($micros)
+ ->setTimezone($this->zone);
}
return $values;
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/Physical/HtmlDocumentPhysical.php b/src/core/etl/src/Flow/ETL/Values/Column/Physical/HtmlDocumentPhysical.php
index f9ffe38bf5..19c6eb4705 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/Physical/HtmlDocumentPhysical.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/Physical/HtmlDocumentPhysical.php
@@ -5,10 +5,8 @@
namespace Flow\ETL\Values\Column\Physical;
use Dom\HTMLDocument;
-use Flow\ETL\Foundation\Exception\InvalidArgumentException;
use function assert;
-use function class_exists;
use function is_object;
use function is_string;
@@ -21,7 +19,6 @@ public function toPhysical(mixed $value): mixed
assert(is_object($value));
/** @var \Dom\HTMLDocument $value */
- // @mago-ignore analysis:unavailable-method
return $value->saveHtml();
}
@@ -29,11 +26,6 @@ public function fromPhysical(mixed $physical): mixed
{
assert(is_string($physical));
- if (!class_exists('\Dom\HTMLDocument')) {
- throw new InvalidArgumentException('Floe cannot restore HTML values, \Dom\HTMLDocument requires PHP 8.4+');
- }
-
- // @mago-expect analysis:unavailable-method
return HTMLDocument::createFromString($physical, LIBXML_NOERROR);
}
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/Physical/HtmlElementPhysical.php b/src/core/etl/src/Flow/ETL/Values/Column/Physical/HtmlElementPhysical.php
index ff1a01e130..4c8664265d 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/Physical/HtmlElementPhysical.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/Physical/HtmlElementPhysical.php
@@ -8,7 +8,6 @@
use Flow\ETL\Foundation\Exception\InvalidArgumentException;
use function assert;
-use function class_exists;
use function is_object;
use function is_string;
use function sprintf;
@@ -53,20 +52,14 @@ public function fromPhysical(mixed $physical): mixed
{
assert(is_string($physical));
- if (!class_exists('\Dom\HTMLDocument')) {
- throw new InvalidArgumentException('Floe cannot restore HTML values, \Dom\HTMLDocument requires PHP 8.4+');
- }
-
$path = $this->position->pathOf($physical);
- // @mago-expect analysis:unavailable-method
$element = $path === null
? HTMLDocument::createFromString(
'' . $physical . '',
LIBXML_NOERROR,
)->body?->firstElementChild
: $this->position->element(
- // @mago-expect analysis:unavailable-method
HTMLDocument::createFromString(
$this->position->documentOf($physical),
LIBXML_HTML_NOIMPLIED | LIBXML_NOERROR,
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/Physical/XmlDocumentPhysical.php b/src/core/etl/src/Flow/ETL/Values/Column/Physical/XmlDocumentPhysical.php
index 0b89736f70..8700368fab 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/Physical/XmlDocumentPhysical.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/Physical/XmlDocumentPhysical.php
@@ -56,7 +56,7 @@ public function toPhysical(mixed $value): mixed
throw new InvalidArgumentException('Floe failed to convert DOMDocument to XML string');
}
- return (new XmlCharacterReferences())->decoded($xml);
+ return new XmlCharacterReferences()->decoded($xml);
}
public function fromPhysical(mixed $physical): mixed
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/Physical/XmlElementPhysical.php b/src/core/etl/src/Flow/ETL/Values/Column/Physical/XmlElementPhysical.php
index e7ea111a6a..041cf7b94e 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/Physical/XmlElementPhysical.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/Physical/XmlElementPhysical.php
@@ -16,7 +16,7 @@
use function sprintf;
/**
- * A \Dom\Element (PHP 8.4) is stored by its markup too and reads back as the DOMElement XMLElementType::cast() builds
+ * A \Dom\Element is stored by its markup too and reads back as the DOMElement XMLElementType::cast() builds
* from a string.
*/
final readonly class XmlElementPhysical implements Physical
@@ -45,7 +45,7 @@ public function toPhysical(mixed $value): mixed
return $this->position->physical(
$path,
$this->canonical($value),
- (new XmlCharacterReferences())->decoded($xml),
+ new XmlCharacterReferences()->decoded($xml),
);
}
@@ -57,7 +57,7 @@ public function toPhysical(mixed $value): mixed
return $this->position->physical(
$path,
$this->canonical($value),
- (new XmlCharacterReferences())->decoded($markup),
+ new XmlCharacterReferences()->decoded($markup),
);
}
@@ -113,7 +113,6 @@ private function rooted(object $element): object
)->assert($document->importNode($element, true))));
}
- // @mago-ignore analysis:unavailable-method
$document = XMLDocument::createEmpty();
return type_instance_of(Element::class)->assert($document->appendChild($document->importNode($element, true)));
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/TextValues.php b/src/core/etl/src/Flow/ETL/Values/Column/TextValues.php
index 9629b8a9d0..a0e3d82af0 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/TextValues.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/TextValues.php
@@ -119,7 +119,7 @@ public function of(Type $type, array $physicals): array
}
if ($bare instanceof XMLType) {
- $nodes = (new PhysicalFor())->physical($bare);
+ $nodes = new PhysicalFor()->physical($bare);
$documents = new XmlDocumentPhysical();
$references = new XmlCharacterReferences();
$values = [];
@@ -344,7 +344,7 @@ public function dateTimes(DateTimeType|DateType $type, array $physicals, string
return $texts;
}
- $values = (new PhysicalFor())->physical($type);
+ $values = new PhysicalFor()->physical($type);
foreach ($physicals as $physical) {
$texts[] = $physical === null
diff --git a/src/core/etl/src/Flow/ETL/Values/Column/ValueEquality.php b/src/core/etl/src/Flow/ETL/Values/Column/ValueEquality.php
index c116b8b4db..c6ddffeae3 100644
--- a/src/core/etl/src/Flow/ETL/Values/Column/ValueEquality.php
+++ b/src/core/etl/src/Flow/ETL/Values/Column/ValueEquality.php
@@ -83,7 +83,7 @@ public function cast(Column $column, Type $type, string $name): Column
);
}
- $builder = (new PhpBackend())->builder(Definitions::of($name, $target, $column->nullCount() > 0));
+ $builder = new PhpBackend()->builder(Definitions::of($name, $target, $column->nullCount() > 0));
$builder->appendMany($values);
return $builder->finish();
@@ -154,7 +154,7 @@ public function in(Column $needles, array $candidates, string $needleName, strin
foreach ($groups as ['type' => $candidateType, 'values' => $values, 'rows' => $rows]) {
$type = $this->type($needles->type(), $candidateType);
$needleRows = array_values(array_unique($rows));
- $builder = (new PhpBackend())->builder(Definitions::of($haystackName, $candidateType, false));
+ $builder = new PhpBackend()->builder(Definitions::of($haystackName, $candidateType, false));
$builder->appendMany($values);
try {
diff --git a/src/core/etl/src/Flow/ETL/Values/Grouping/KeyEncoder.php b/src/core/etl/src/Flow/ETL/Values/Grouping/KeyEncoder.php
index 74bbfdab72..ced7697844 100644
--- a/src/core/etl/src/Flow/ETL/Values/Grouping/KeyEncoder.php
+++ b/src/core/etl/src/Flow/ETL/Values/Grouping/KeyEncoder.php
@@ -64,7 +64,7 @@ public function of(Rows $rows): array
return (
$rows->isEmpty()
? []
- : (new CanonicalEncoding())->ordered($this->columns($rows, new PhpBackend()), $rows->count())
+ : new CanonicalEncoding()->ordered($this->columns($rows, new PhpBackend()), $rows->count())
);
}
@@ -75,7 +75,7 @@ public function of(Rows $rows): array
*/
public static function ofColumns(array $columns, int $count): array
{
- return $count < 1 ? [] : (new CanonicalEncoding())->ordered($columns, $count);
+ return $count < 1 ? [] : new CanonicalEncoding()->ordered($columns, $count);
}
public static function bucketOf(string $key, int $buckets, int $hashOffset): int
diff --git a/src/core/etl/src/Flow/ETL/Values/Grouping/PhpGroupTable.php b/src/core/etl/src/Flow/ETL/Values/Grouping/PhpGroupTable.php
index 9e0d03e020..c9b4cba539 100644
--- a/src/core/etl/src/Flow/ETL/Values/Grouping/PhpGroupTable.php
+++ b/src/core/etl/src/Flow/ETL/Values/Grouping/PhpGroupTable.php
@@ -51,7 +51,7 @@ public function assign(Rows $rows): GroupIds
}
return new GroupIds(
- new ScalarColumn(type_integer(), (new PhysicalFor())->physical(type_integer()), $byRow, 0),
+ new ScalarColumn(type_integer(), new PhysicalFor()->physical(type_integer()), $byRow, 0),
$firstRows,
);
}
@@ -70,7 +70,7 @@ public function lookup(Rows $rows): Column
}
}
- return new ScalarColumn(type_integer(), (new PhysicalFor())->physical(type_integer()), $byRow, $nullCount);
+ return new ScalarColumn(type_integer(), new PhysicalFor()->physical(type_integer()), $byRow, $nullCount);
}
public function count(): int
diff --git a/src/core/etl/src/Flow/ETL/Values/Rows.php b/src/core/etl/src/Flow/ETL/Values/Rows.php
index 52abd4e4f2..e48c01aa4e 100644
--- a/src/core/etl/src/Flow/ETL/Values/Rows.php
+++ b/src/core/etl/src/Flow/ETL/Values/Rows.php
@@ -116,7 +116,7 @@ public function column(string $name): Column
return $this->columns[$name];
}
- $suggestions = (new SimilarNames())->closestTo($name, array_values($this->schema->names()));
+ $suggestions = new SimilarNames()->closestTo($name, $this->schema->names());
throw new InvalidArgumentException(
$suggestions === []
@@ -391,7 +391,7 @@ public function project(Schema $schema, Backend $backend): self
}
}
- return (new self(new Schema(...$definitions), $columns, $this->count))->matchTo($schema, $backend);
+ return new self(new Schema(...$definitions), $columns, $this->count)->matchTo($schema, $backend);
}
/**
diff --git a/src/core/etl/src/Flow/ETL/Values/Rows/ColumnRetyping.php b/src/core/etl/src/Flow/ETL/Values/Rows/ColumnRetyping.php
index cfebec3b4c..f487d9acd3 100644
--- a/src/core/etl/src/Flow/ETL/Values/Rows/ColumnRetyping.php
+++ b/src/core/etl/src/Flow/ETL/Values/Rows/ColumnRetyping.php
@@ -110,7 +110,7 @@ public function restamped(Column $column, Definition $own, Definition $definitio
return null;
}
- return (new Retype())->proves($column->type(), $definition->type())
+ return new Retype()->proves($column->type(), $definition->type())
? $column->withType($definition->type())
: null;
}
diff --git a/src/core/etl/src/Flow/ETL/Values/Rows/RecordBatch.php b/src/core/etl/src/Flow/ETL/Values/Rows/RecordBatch.php
index ba5207fc9c..2836334696 100644
--- a/src/core/etl/src/Flow/ETL/Values/Rows/RecordBatch.php
+++ b/src/core/etl/src/Flow/ETL/Values/Rows/RecordBatch.php
@@ -197,7 +197,7 @@ public function flush(): array
}
try {
- $rows = (new RowsBuilder($this->schema, $this->backend))
+ $rows = new RowsBuilder($this->schema, $this->backend)
->appendRows($this->records)
->finish();
} catch (SchemaMismatchException $mismatch) {
@@ -293,7 +293,7 @@ private function recordByRecord(): array
);
if ($accepted !== []) {
- $handed[] = (new RowsBuilder($this->schema, $this->backend))
+ $handed[] = new RowsBuilder($this->schema, $this->backend)
->appendRows($accepted)
->finish();
}
diff --git a/src/core/etl/src/Flow/ETL/Values/Schema/Definition/ListDefinition.php b/src/core/etl/src/Flow/ETL/Values/Schema/Definition/ListDefinition.php
index 049551639d..02ad93993c 100644
--- a/src/core/etl/src/Flow/ETL/Values/Schema/Definition/ListDefinition.php
+++ b/src/core/etl/src/Flow/ETL/Values/Schema/Definition/ListDefinition.php
@@ -39,7 +39,7 @@ public function __construct(
) {
$this->name = $name;
$this->metadata = $metadata ?? Metadata::empty();
- $this->type = (new TypeProjection($this->name))->list($type);
+ $this->type = new TypeProjection($this->name)->list($type);
}
/**
diff --git a/src/core/etl/src/Flow/ETL/Values/Schema/Definition/MapDefinition.php b/src/core/etl/src/Flow/ETL/Values/Schema/Definition/MapDefinition.php
index 94134c6e5a..17d68402b7 100644
--- a/src/core/etl/src/Flow/ETL/Values/Schema/Definition/MapDefinition.php
+++ b/src/core/etl/src/Flow/ETL/Values/Schema/Definition/MapDefinition.php
@@ -40,7 +40,7 @@ public function __construct(
) {
$this->name = $name;
$this->metadata = $metadata ?? Metadata::empty();
- $this->type = (new TypeProjection($this->name))->map($type);
+ $this->type = new TypeProjection($this->name)->map($type);
}
/**
diff --git a/src/core/etl/src/Flow/ETL/Values/Schema/Definition/StructureDefinition.php b/src/core/etl/src/Flow/ETL/Values/Schema/Definition/StructureDefinition.php
index 1ed392755b..c3a70b53bc 100644
--- a/src/core/etl/src/Flow/ETL/Values/Schema/Definition/StructureDefinition.php
+++ b/src/core/etl/src/Flow/ETL/Values/Schema/Definition/StructureDefinition.php
@@ -39,7 +39,7 @@ public function __construct(
) {
$this->name = $name;
$this->metadata = $metadata ?? Metadata::empty();
- $this->type = (new TypeProjection($this->name))->structure($type);
+ $this->type = new TypeProjection($this->name)->structure($type);
}
/**
diff --git a/src/core/etl/src/Flow/ETL/Values/Sort/RowOrder.php b/src/core/etl/src/Flow/ETL/Values/Sort/RowOrder.php
index 57de83e9c0..b51d3a2d66 100644
--- a/src/core/etl/src/Flow/ETL/Values/Sort/RowOrder.php
+++ b/src/core/etl/src/Flow/ETL/Values/Sort/RowOrder.php
@@ -181,7 +181,7 @@ public static function flag(Type $type): int
$bare instanceof HTMLType,
$bare instanceof HTMLElementType,
=> SORT_STRING,
- (new ComparableValues())->equalByPhysical($bare) => SORT_NUMERIC,
+ new ComparableValues()->equalByPhysical($bare) => SORT_NUMERIC,
default => SORT_REGULAR,
};
}
diff --git a/src/core/etl/src/Flow/Floe/DSL/functions.php b/src/core/etl/src/Flow/Floe/DSL/functions.php
index 4478cfdbd3..b69106ab51 100644
--- a/src/core/etl/src/Flow/Floe/DSL/functions.php
+++ b/src/core/etl/src/Flow/Floe/DSL/functions.php
@@ -71,7 +71,7 @@ function merge_floe(
?Metadata $metadata = null,
Filesystem $filesystem = new NativeLocalFilesystem(),
): void {
- (new FloeMerger($filesystem, $backend))->merge(
+ new FloeMerger($filesystem, $backend)->merge(
array_map(static fn(string|Path $source): Path => is_string($source) ? path_real($source) : $source, $sources),
is_string($dest) ? path($dest) : $dest,
$compact,
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Context/AggregatorFixtures.php b/src/core/etl/tests/Flow/ETL/Tests/Context/AggregatorFixtures.php
index cc1dab6026..e5405d3672 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Context/AggregatorFixtures.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Context/AggregatorFixtures.php
@@ -96,7 +96,7 @@ public static function instance(string $class): AggregatingFunction
*/
public static function resolved(string $class): AggregatingFunction
{
- return type_instance_of(AggregatingFunction::class)->assert((new ReferenceResolver())->resolve(
+ return type_instance_of(AggregatingFunction::class)->assert(new ReferenceResolver()->resolve(
self::instance($class),
self::schema(),
));
@@ -107,7 +107,7 @@ public static function resolved(string $class): AggregatingFunction
*/
public static function bound(AggregatingFunction $function, Schema $schema): AggregatingFunction
{
- return type_instance_of(AggregatingFunction::class)->assert((new ReferenceResolver())->resolve(
+ return type_instance_of(AggregatingFunction::class)->assert(new ReferenceResolver()->resolve(
$function,
$schema,
));
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Context/AggregatorRoundTrip.php b/src/core/etl/tests/Flow/ETL/Tests/Context/AggregatorRoundTrip.php
index 9528426c1d..04a5e3ef9c 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Context/AggregatorRoundTrip.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Context/AggregatorRoundTrip.php
@@ -32,12 +32,12 @@ public static function aggregated(AggregatingFunction $aggregator): array
$rebuilt = DescribeRoundTrip::rebuilt($aggregator);
$rows = AggregatorFixtures::rows(new PhpBackend());
- $resolved = type_instance_of(AggregatingFunction::class)->assert((new ReferenceResolver())->resolve(
+ $resolved = type_instance_of(AggregatingFunction::class)->assert(new ReferenceResolver()->resolve(
$aggregator,
AggregatorFixtures::schema(),
));
$resolved->aggregate($rows, range(0, 5), flow_context()->backend());
- $copy = type_instance_of(AggregatingFunction::class)->assert((new ReferenceResolver())->resolve(
+ $copy = type_instance_of(AggregatingFunction::class)->assert(new ReferenceResolver()->resolve(
$rebuilt,
AggregatorFixtures::schema(),
));
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Context/DecimalDivisionContext.php b/src/core/etl/tests/Flow/ETL/Tests/Context/DecimalDivisionContext.php
index 97fe0c6d79..dc2f26c68b 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Context/DecimalDivisionContext.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Context/DecimalDivisionContext.php
@@ -9,7 +9,6 @@
use Flow\ETL\Foundation\Calculator\Calculator;
use Flow\ETL\Foundation\Calculator\Rounding;
-use function defined;
use function pack;
use function sprintf;
use function unpack;
@@ -23,30 +22,18 @@ public static function bigDecimalQuotientOfStringForms(
int $scale,
Rounding $rounding,
): float {
- $modern = defined('Brick\Math\RoundingMode::Up');
-
// @mago-ignore analysis:possibly-invalid-argument
return BigDecimal::of((string) $a)->dividedBy(BigDecimal::of((string) $b), $scale, match ($rounding) {
- // @mago-ignore analysis:non-existent-class-constant
- Rounding::UP => $modern ? RoundingMode::Up : RoundingMode::UP,
- // @mago-ignore analysis:non-existent-class-constant
- Rounding::DOWN => $modern ? RoundingMode::Down : RoundingMode::DOWN,
- // @mago-ignore analysis:non-existent-class-constant
- Rounding::CEILING => $modern ? RoundingMode::Ceiling : RoundingMode::CEILING,
- // @mago-ignore analysis:non-existent-class-constant
- Rounding::FLOOR => $modern ? RoundingMode::Floor : RoundingMode::FLOOR,
- // @mago-ignore analysis:non-existent-class-constant
- Rounding::HALF_UP => $modern ? RoundingMode::HalfUp : RoundingMode::HALF_UP,
- // @mago-ignore analysis:non-existent-class-constant
- Rounding::HALF_DOWN => $modern ? RoundingMode::HalfDown : RoundingMode::HALF_DOWN,
- // @mago-ignore analysis:non-existent-class-constant
- Rounding::HALF_CEILING => $modern ? RoundingMode::HalfCeiling : RoundingMode::HALF_CEILING,
- // @mago-ignore analysis:non-existent-class-constant
- Rounding::HALF_FLOOR => $modern ? RoundingMode::HalfFloor : RoundingMode::HALF_FLOOR,
- // @mago-ignore analysis:non-existent-class-constant
- Rounding::HALF_EVEN => $modern ? RoundingMode::HalfEven : RoundingMode::HALF_EVEN,
- // @mago-ignore analysis:non-existent-class-constant
- Rounding::UNNECESSARY => $modern ? RoundingMode::Unnecessary : RoundingMode::UNNECESSARY,
+ Rounding::UP => RoundingMode::Up,
+ Rounding::DOWN => RoundingMode::Down,
+ Rounding::CEILING => RoundingMode::Ceiling,
+ Rounding::FLOOR => RoundingMode::Floor,
+ Rounding::HALF_UP => RoundingMode::HalfUp,
+ Rounding::HALF_DOWN => RoundingMode::HalfDown,
+ Rounding::HALF_CEILING => RoundingMode::HalfCeiling,
+ Rounding::HALF_FLOOR => RoundingMode::HalfFloor,
+ Rounding::HALF_EVEN => RoundingMode::HalfEven,
+ Rounding::UNNECESSARY => RoundingMode::Unnecessary,
})->toFloat();
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Context/DescribableFixtures.php b/src/core/etl/tests/Flow/ETL/Tests/Context/DescribableFixtures.php
index 0e980fb420..a10db5ce23 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Context/DescribableFixtures.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Context/DescribableFixtures.php
@@ -326,7 +326,7 @@ public static function others(): array
ProgressUnit::rows,
7,
'memory://in/orders.floe',
- (new HeartbeatContext())->throttle(new ScheduledHeartbeat(new RecordingHeartbeat(), 1)),
+ new HeartbeatContext()->throttle(new ScheduledHeartbeat(new RecordingHeartbeat(), 1)),
0,
),
IgnoreError::class => static fn(): Describable => new IgnoreError(),
@@ -372,7 +372,7 @@ public static function others(): array
),
ScalarFunctionTransformer::class => static fn(): Describable => type_instance_of(
ScalarFunctionTransformer::class,
- )->assert((new ScalarFunctionTransformer('double', ref('id')->multiply(lit(2))))->bind(schema(int_schema(
+ )->assert(new ScalarFunctionTransformer('double', ref('id')->multiply(lit(2)))->bind(schema(int_schema(
'id',
)))->step),
SchemaValidationLoader::class => static fn(): Describable => new SchemaValidationLoader(
@@ -413,7 +413,7 @@ public static function others(): array
),
UntilTransformer::class => static fn(): Describable => type_instance_of(
UntilTransformer::class,
- )->assert((new UntilTransformer(ref('id')->lessThan(lit(10))))->bind(schema(int_schema('id')))->step),
+ )->assert(new UntilTransformer(ref('id')->lessThan(lit(10)))->bind(schema(int_schema('id')))->step),
Window::class => self::window(...),
WholePartitionFrame::class => static fn(): Describable => new WholePartitionFrame(),
BatchingByProcessor::class => static fn(): Describable => new BatchingByProcessor(ref('country'), 5),
@@ -427,25 +427,25 @@ public static function others(): array
CountingProcessor::class => static fn(): Describable => new CountingProcessor(),
DistinctProcessor::class => static fn(): Describable => type_instance_of(
DistinctProcessor::class,
- )->assert((new DistinctProcessor(['country', ref('day')]))->bind(schema(
+ )->assert(new DistinctProcessor(['country', ref('day')])->bind(schema(
str_schema('country'),
int_schema('day'),
))->step),
ExpandingProcessor::class => static fn(): Describable => type_instance_of(
ExpandingProcessor::class,
- )->assert((new ExpandingProcessor(
+ )->assert(new ExpandingProcessor(
'tag',
ref('tags')->expand(),
RequiredColumns::allBut('tags'),
new BatchSize(9),
- ))->bind(schema(int_schema('id'), list_schema('tags', type_list(type_string()))))->step),
+ )->bind(schema(int_schema('id'), list_schema('tags', type_list(type_string()))))->step),
GroupByAggregationProcessor::class => static fn(): Describable => type_instance_of(
GroupByAggregationProcessor::class,
- )->assert((new GroupByAggregationProcessor(
+ )->assert(new GroupByAggregationProcessor(
new GroupBy(refs('country'), new Aggregators(sum(ref('amount')))),
self::bucketing(),
new NativePHPRandomValueGenerator(),
- ))->bind(schema(str_schema('country'), int_schema('amount')))->step),
+ )->bind(schema(str_schema('country'), int_schema('amount')))->step),
HashJoin::class => self::hashJoin(...),
MemorySortProcessor::class => static fn(): Describable => new MemorySortProcessor([ref(
'id',
@@ -458,14 +458,14 @@ public static function others(): array
OffsetProcessor::class => static fn(): Describable => new OffsetProcessor(3),
PivotProcessor::class => static fn(): Describable => type_instance_of(
PivotProcessor::class,
- )->assert((new PivotProcessor(
+ )->assert(new PivotProcessor(
new GroupBy(
refs('name'),
new Aggregators(sum(ref('id'))),
new Pivot(ref('country'), new DeclaredPivotValues('USA', 'China')),
),
self::bucketing(),
- ))->bind(schema(str_schema('name'), int_schema('id'), str_schema('country')))->step),
+ )->bind(schema(str_schema('name'), int_schema('id'), str_schema('country')))->step),
RepartitionProcessor::class => static fn(): Describable => new RepartitionProcessor(
refs('country'),
self::bucketing(),
@@ -482,7 +482,7 @@ public static function others(): array
VoidProgress::class => static fn(): Describable => new VoidProgress(),
WindowProcessor::class => static fn(): Describable => type_instance_of(
WindowProcessor::class,
- )->assert((new WindowProcessor('rank', new Rank(self::window())))->bind(schema(
+ )->assert(new WindowProcessor('rank', new Rank(self::window()))->bind(schema(
str_schema('country'),
int_schema('id'),
))->step),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Context/ExecutedPipelines.php b/src/core/etl/tests/Flow/ETL/Tests/Context/ExecutedPipelines.php
index 635365ce4a..d7a49b6d72 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Context/ExecutedPipelines.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Context/ExecutedPipelines.php
@@ -29,6 +29,6 @@ final class ExecutedPipelines
*/
public static function of(Extractor $source, array $steps, ?FlowContext $context = null): Generator
{
- return (new Executor())->executePipeline(PipelinesMother::root($source, $steps), $context ?? flow_context());
+ return new Executor()->executePipeline(PipelinesMother::root($source, $steps), $context ?? flow_context());
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Context/ExpansionContext.php b/src/core/etl/tests/Flow/ETL/Tests/Context/ExpansionContext.php
index 06991575c0..047d03d762 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Context/ExpansionContext.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Context/ExpansionContext.php
@@ -19,7 +19,7 @@ public static function of(ScalarFunction $tree, ?Schema $input = null): Expansio
$schema = $input ?? ListColumnsMother::schema();
return type_instance_of(Expansion::class)->assert(Expansion::of(
- (new ReferenceResolver())->resolve($tree, $schema),
+ new ReferenceResolver()->resolve($tree, $schema),
$schema,
));
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Context/FileFormatContract.php b/src/core/etl/tests/Flow/ETL/Tests/Context/FileFormatContract.php
index 3a72ba5804..8de1e5db6a 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Context/FileFormatContract.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Context/FileFormatContract.php
@@ -205,7 +205,7 @@ public function theSplitsReadEveryRowOnce(FileFormat $format): void
foreach (FlowTestCase::extracted(
$extractor->reader(),
flow_context()->backend(),
- (new Criteria())->withSplit(type_instance_of(FileSplit::class)->assert($split)),
+ new Criteria()->withSplit(type_instance_of(FileSplit::class)->assert($split)),
) as $rows) {
$read += $rows->count();
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Context/FloeFilesContext.php b/src/core/etl/tests/Flow/ETL/Tests/Context/FloeFilesContext.php
index 39ba877e99..09c4653447 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Context/FloeFilesContext.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Context/FloeFilesContext.php
@@ -38,7 +38,7 @@ final class FloeFilesContext
public static function columns(Filesystem $filesystem, Path $file): array
{
return Schema::fromArray(
- (new FooterReader())->read($filesystem->readFrom($file), new NoopCodec())->footer->schema,
+ new FooterReader()->read($filesystem->readFrom($file), new NoopCodec())->footer->schema,
)->names();
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Context/FloeStreamReaderContext.php b/src/core/etl/tests/Flow/ETL/Tests/Context/FloeStreamReaderContext.php
index 646bfe396c..21fd51c0d4 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Context/FloeStreamReaderContext.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Context/FloeStreamReaderContext.php
@@ -55,7 +55,7 @@ public static function footer(Filesystem $filesystem, Path $path): Footer
public static function dataBytes(Filesystem $filesystem, Path $path): int
{
return (
- (new FooterReader())->read($filesystem->readFrom($path), new NoopCodec())->footerFrameStart
+ new FooterReader()->read($filesystem->readFrom($path), new NoopCodec())->footerFrameStart
- Format::HEADER_LENGTH
);
}
@@ -86,12 +86,12 @@ public static function roundTrip(Rows $rows): Rows
$filesystem = memory_filesystem();
$path = path('memory://round-trip.floe');
- $writer = (new FloeFiles($filesystem, new AdaptiveBackend()))->create($path, $rows->schema());
+ $writer = new FloeFiles($filesystem, new AdaptiveBackend())->create($path, $rows->schema());
$writer->write($rows);
$writer->close();
$batches = iterator_to_array(
- (new FloeFiles($filesystem, new AdaptiveBackend()))
+ new FloeFiles($filesystem, new AdaptiveBackend())
->read($path)
->rows(),
);
@@ -118,7 +118,7 @@ public static function frameTypes(Filesystem $filesystem, Path $path): array
*/
public static function reconstruct(Filesystem $filesystem, Path $path): Rows
{
- $file = (new FloeFiles($filesystem, new AdaptiveBackend()))->read($path);
+ $file = new FloeFiles($filesystem, new AdaptiveBackend())->read($path);
$rows = rows($file->footer()->schema());
foreach ($file->rows() as $batch) {
@@ -140,7 +140,7 @@ public static function readAll(Filesystem $filesystem, Path $path): Rows
{
$merged = null;
- foreach ((new FloeFiles($filesystem, new AdaptiveBackend()))
+ foreach (new FloeFiles($filesystem, new AdaptiveBackend())
->read($path)
->rows() as $batch) {
$merged = $merged === null ? $batch : Rows::concat($merged->schema(), new PhpBackend(), $merged, $batch);
@@ -159,7 +159,7 @@ public static function write(
array $metadata = [],
Codec $codec = new NoopCodec(),
): void {
- $writer = (new FloeFiles($filesystem, new AdaptiveBackend(), new Options(codec: $codec)))->create(
+ $writer = new FloeFiles($filesystem, new AdaptiveBackend(), new Options(codec: $codec))->create(
$path,
$rows->schema(),
Metadata::fromArray($metadata),
@@ -180,14 +180,14 @@ public static function writeFrames(
): void {
/** @var array> $normalized */
$normalized = $schema->normalize();
- $footerJson = (new Footer(
+ $footerJson = new Footer(
Format::VERSION,
'test',
$normalized,
[new Section(Format::HEADER_LENGTH, $rowCount)],
new FooterStatistics($rowCount, strlen($frames)),
Metadata::empty(),
- ))->toJson();
+ )->toJson();
$stream = $filesystem->writeTo($path);
$stream->append(
@@ -228,7 +228,7 @@ public static function truncatedAt(int $bytesLeft): FloeStreamReader
public static function writeWithoutFooter(Filesystem $filesystem, Path $path, Rows $rows): void
{
- $writer = (new FloeFiles($filesystem, new AdaptiveBackend()))->create($path, $rows->schema());
+ $writer = new FloeFiles($filesystem, new AdaptiveBackend())->create($path, $rows->schema());
$writer->write($rows);
$writer->close();
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Context/FunctionContext.php b/src/core/etl/tests/Flow/ETL/Tests/Context/FunctionContext.php
index fdf0ca2ce3..0163b27dbe 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Context/FunctionContext.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Context/FunctionContext.php
@@ -34,7 +34,7 @@ public function exported(ScalarFunction $function, Rows $rows, Schema $schema):
{
try {
return var_export(
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve($function, $schema)
->eval($rows, $this->context->backend())
->values(),
@@ -50,7 +50,7 @@ public function exported(ScalarFunction $function, Rows $rows, Schema $schema):
*/
public function columnOf(ScalarFunction $function, Rows $rows, Schema $schema): Column
{
- return (new ReferenceResolver())
+ return new ReferenceResolver()
->resolve($function, $schema)
->eval($rows, $this->context->backend());
}
@@ -60,7 +60,7 @@ public function columnOf(ScalarFunction $function, Rows $rows, Schema $schema):
*/
public function column(ScalarFunction $function, array $rows, Schema $schema): Column
{
- return (new ReferenceResolver())
+ return new ReferenceResolver()
->resolve($function, $schema)
->eval(array_to_rows($rows, $schema, $this->context->backend()), $this->context->backend());
}
@@ -73,7 +73,7 @@ public function column(ScalarFunction $function, array $rows, Schema $schema): C
*/
public function eval(ScalarFunction $function, array $row, Schema $schema): mixed
{
- return (new Parameter((new ReferenceResolver())->resolve($function, $schema)))->values(
+ return new Parameter(new ReferenceResolver()->resolve($function, $schema))->values(
array_to_rows([$row], $schema, $this->context->backend()),
$this->context->backend(),
)[0];
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Context/HeartbeatContext.php b/src/core/etl/tests/Flow/ETL/Tests/Context/HeartbeatContext.php
index 543a079f01..7b19b14494 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Context/HeartbeatContext.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Context/HeartbeatContext.php
@@ -52,7 +52,7 @@ public function __construct()
{
$this->clock = new FakeClock();
$this->logs = new MemoryLogProcessor(new VoidExporter());
- $this->logger = (new LoggerProvider($this->logs, $this->clock, new MemoryContextStorage()))->logger(
+ $this->logger = new LoggerProvider($this->logs, $this->clock, new MemoryContextStorage())->logger(
Resource::create(['service.name' => 'flow-test']),
'flow_php_dataframe',
);
@@ -138,7 +138,7 @@ public static function stoppable(ArrayObject $signals): Generator
public static function stageWithId(StageName $name, int $id): HeartbeatStage
{
- return (new self())
+ return new self()
->throttle(new ScheduledHeartbeat(new RecordingHeartbeat(), 120))
->stage($name, ProgressUnit::rows, $id);
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Context/KeyGroupingContext.php b/src/core/etl/tests/Flow/ETL/Tests/Context/KeyGroupingContext.php
index 9a18ddc404..116f17bc77 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Context/KeyGroupingContext.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Context/KeyGroupingContext.php
@@ -27,7 +27,7 @@ final class KeyGroupingContext
public static function groups(array $by, Generator $input): array
{
return iterator_to_array(
- (new KeyGrouping(new KeyEncoder((new References(...$by))->names()), new AdaptiveBackend()))->group($input),
+ new KeyGrouping(new KeyEncoder(new References(...$by)->names()), new AdaptiveBackend())->group($input),
preserve_keys: false,
);
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Context/MetadataColumnsContract.php b/src/core/etl/tests/Flow/ETL/Tests/Context/MetadataColumnsContract.php
index f2678dcf36..41dbb394cb 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Context/MetadataColumnsContract.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Context/MetadataColumnsContract.php
@@ -18,7 +18,7 @@ final class MetadataColumnsContract
*/
public static function declares(string $class): void
{
- Assert::assertTrue((new ReflectionClass($class))->implementsInterface(MetadataColumnsExtractor::class), $class);
+ Assert::assertTrue(new ReflectionClass($class)->implementsInterface(MetadataColumnsExtractor::class), $class);
Assert::assertTrue(method_exists($class, 'withMetadataColumns'), $class);
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Context/PartitionRoutingContext.php b/src/core/etl/tests/Flow/ETL/Tests/Context/PartitionRoutingContext.php
index a693cc1885..8bf6dae22c 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Context/PartitionRoutingContext.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Context/PartitionRoutingContext.php
@@ -21,7 +21,7 @@ final class PartitionRoutingContext
*/
public static function route(Partitioning $partitioning, Rows $rows): array
{
- $groups = iterator_to_array((new PartitionRouter($partitioning))->route($rows), preserve_keys: false);
+ $groups = iterator_to_array(new PartitionRouter($partitioning)->route($rows), preserve_keys: false);
usort($groups, static fn(array $a, array $b): int => self::sortKey($a[0]) <=> self::sortKey($b[0]));
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Context/ProjectionContext.php b/src/core/etl/tests/Flow/ETL/Tests/Context/ProjectionContext.php
index 353bd2506a..ee5e38fa54 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Context/ProjectionContext.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Context/ProjectionContext.php
@@ -15,7 +15,7 @@ final class ProjectionContext
{
public static function pushed(Node $root, Trigger $trigger = Trigger::rows): Read
{
- return (new PushProjectionIntoSource())
+ return new PushProjectionIntoSource()
->apply($trigger->plan($root), config()->backend())
->source();
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Context/ReversedSniffing.php b/src/core/etl/tests/Flow/ETL/Tests/Context/ReversedSniffing.php
index d00f3dd482..53139cff4b 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Context/ReversedSniffing.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Context/ReversedSniffing.php
@@ -26,7 +26,7 @@ public static function schema(Sniffer $sniffer, SchemaInference $inference): Sch
ksort($samples);
- return (new SchemaInferrer($inference))->infer(
+ return new SchemaInferrer($inference)->infer(
new PresniffedSniffer($sniffer->names(), array_values($samples)),
new VoidProgress(),
)->schema;
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Context/ScalarFunctionContract.php b/src/core/etl/tests/Flow/ETL/Tests/Context/ScalarFunctionContract.php
index 2032a1e9f6..1bb6f248bb 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Context/ScalarFunctionContract.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Context/ScalarFunctionContract.php
@@ -32,7 +32,7 @@ final class ScalarFunctionContract
{
public static function returnsItsDeclaredType(ScalarFunction $function, Type $expected): void
{
- $returns = (new ReferenceResolver())
+ $returns = new ReferenceResolver()
->resolve($function, ScalarFunctionFixtures::schema())
->returns();
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Context/ScalarFunctionFixtures.php b/src/core/etl/tests/Flow/ETL/Tests/Context/ScalarFunctionFixtures.php
index b08b620c8d..ca169443e9 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Context/ScalarFunctionFixtures.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Context/ScalarFunctionFixtures.php
@@ -8,7 +8,6 @@
use DateTimeZone;
use DOMDocument;
use Flow\ETL\Foundation\Calculator\Rounding;
-use Flow\ETL\Foundation\Exception\RequiredPHPVersionException;
use Flow\ETL\Foundation\Exception\SchemaNotDerivableException;
use Flow\ETL\Foundation\Hash\HashAlgorithm;
use Flow\ETL\Functions;
@@ -208,26 +207,17 @@ final class ScalarFunctionFixtures
* Every declaring class resolved against schema() and split by type_is_nullable() of its
* returns() answer; the one designed SchemaNotDerivableException refusal counts as NOT NULL.
*
- * @return array{list>, list>, list>}
+ * @return array{list>, list>}
*/
public static function nullabilitySplit(): array
{
$nullable = [];
$notNull = [];
- $unavailable = [];
foreach (ScalarFunctionClasses::declaring(ExtractorClasses::root('core/etl')) as $class) {
try {
- $function = self::instance($class);
- } catch (RequiredPHPVersionException) {
- $unavailable[] = $class;
-
- continue;
- }
-
- try {
- $type = (new ReferenceResolver())
- ->resolve($function, self::schema())
+ $type = new ReferenceResolver()
+ ->resolve(self::instance($class), self::schema())
->returns();
} catch (SchemaNotDerivableException) {
$notNull[] = $class;
@@ -242,7 +232,7 @@ public static function nullabilitySplit(): array
}
}
- return [$nullable, $notNull, $unavailable];
+ return [$nullable, $notNull];
}
/**
@@ -322,8 +312,6 @@ public static function rows(Backend $backend): Rows
/**
* @param class-string $class
- *
- * @throws RequiredPHPVersionException when the class needs a newer PHP than the runtime
*/
public static function instance(string $class): ScalarFunction
{
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Context/WindowProcessorContext.php b/src/core/etl/tests/Flow/ETL/Tests/Context/WindowProcessorContext.php
index e6800c0dde..7e703f840f 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Context/WindowProcessorContext.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Context/WindowProcessorContext.php
@@ -28,7 +28,7 @@ public static function batches(string|Definition $column, WindowFunction $functi
$batches = [];
- foreach ((new WindowProcessor($column, $function))->process($input, flow_context()->backend()) as $batch) {
+ foreach (new WindowProcessor($column, $function)->process($input, flow_context()->backend()) as $batch) {
$batches[] = $batch;
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Double/AcceptingBackend.php b/src/core/etl/tests/Flow/ETL/Tests/Double/AcceptingBackend.php
index dfb0cc4bb3..4a16f493aa 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Double/AcceptingBackend.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Double/AcceptingBackend.php
@@ -37,52 +37,52 @@ public function compare(
string $leftName,
string $rightName,
): Column {
- return (new PhpBackend())->compare($left, $operator, $right, $leftName, $rightName);
+ return new PhpBackend()->compare($left, $operator, $right, $leftName, $rightName);
}
public function isNull(Column $column): Column
{
- return (new PhpBackend())->isNull($column);
+ return new PhpBackend()->isNull($column);
}
public function isNotNull(Column $column): Column
{
- return (new PhpBackend())->isNotNull($column);
+ return new PhpBackend()->isNotNull($column);
}
public function add(Column $left, Column $right): Column
{
- return (new PhpBackend())->add($left, $right);
+ return new PhpBackend()->add($left, $right);
}
public function subtract(Column $left, Column $right): Column
{
- return (new PhpBackend())->subtract($left, $right);
+ return new PhpBackend()->subtract($left, $right);
}
public function multiply(Column $left, Column $right): Column
{
- return (new PhpBackend())->multiply($left, $right);
+ return new PhpBackend()->multiply($left, $right);
}
public function modulo(Column $left, Column $right): Column
{
- return (new PhpBackend())->modulo($left, $right);
+ return new PhpBackend()->modulo($left, $right);
}
public function startsWith(Column $haystack, Column $needle): Column
{
- return (new PhpBackend())->startsWith($haystack, $needle);
+ return new PhpBackend()->startsWith($haystack, $needle);
}
public function endsWith(Column $haystack, Column $needle): Column
{
- return (new PhpBackend())->endsWith($haystack, $needle);
+ return new PhpBackend()->endsWith($haystack, $needle);
}
public function contains(Column $haystack, Column $needle): Column
{
- return (new PhpBackend())->contains($haystack, $needle);
+ return new PhpBackend()->contains($haystack, $needle);
}
/**
@@ -90,7 +90,7 @@ public function contains(Column $haystack, Column $needle): Column
*/
public function sort(Rows $rows, array $columns): Rows
{
- return (new PhpBackend())->sort($rows, $columns);
+ return new PhpBackend()->sort($rows, $columns);
}
/**
@@ -98,32 +98,32 @@ public function sort(Rows $rows, array $columns): Rows
*/
public function sortWorkingBytes(Rows $rows, array $columns): int
{
- return (new PhpBackend())->sortWorkingBytes($rows, $columns);
+ return new PhpBackend()->sortWorkingBytes($rows, $columns);
}
public function groupedTotals(): GroupedTotals
{
- return (new PhpBackend())->groupedTotals();
+ return new PhpBackend()->groupedTotals();
}
public function groupedCounts(): GroupedCounts
{
- return (new PhpBackend())->groupedCounts();
+ return new PhpBackend()->groupedCounts();
}
public function rowHashes(array $columns, int $count): Column
{
- return (new PhpBackend())->rowHashes($columns, $count);
+ return new PhpBackend()->rowHashes($columns, $count);
}
public function hash(Column $strings, HashAlgorithm $algorithm): Column
{
- return (new PhpBackend())->hash($strings, $algorithm);
+ return new PhpBackend()->hash($strings, $algorithm);
}
public function groupedMultisetHashes(HashAlgorithm $algorithm): GroupedMultisetHashes
{
- return (new PhpBackend())->groupedMultisetHashes($algorithm);
+ return new PhpBackend()->groupedMultisetHashes($algorithm);
}
/**
@@ -131,32 +131,32 @@ public function groupedMultisetHashes(HashAlgorithm $algorithm): GroupedMultiset
*/
public function groupTable(array $columns, Schema $declared): GroupTable
{
- return (new PhpBackend())->groupTable($columns, $declared);
+ return new PhpBackend()->groupTable($columns, $declared);
}
public function partition(Rows $rows, array $keys, int $buckets, int $hashOffset): array
{
- return (new PhpBackend())->partition($rows, $keys, $buckets, $hashOffset);
+ return new PhpBackend()->partition($rows, $keys, $buckets, $hashOffset);
}
public function constant(Definition $definition, mixed $value, int $count): Column
{
- return (new PhpBackend())->constant($definition, $value, $count);
+ return new PhpBackend()->constant($definition, $value, $count);
}
public function decode(Definition $definition, array $buffers, int $count, int $nullCount): Column
{
- return (new PhpBackend())->decode($definition, $buffers, $count, $nullCount);
+ return new PhpBackend()->decode($definition, $buffers, $count, $nullCount);
}
public function decodeFrame(string $body, Schema $schema, Codec $codec): Rows
{
- return (new PhpBackend())->decodeFrame($body, $schema, $codec);
+ return new PhpBackend()->decodeFrame($body, $schema, $codec);
}
public function encodeFrame(Rows $rows, Codec $codec): string
{
- return (new PhpBackend())->encodeFrame($rows, $codec);
+ return new PhpBackend()->encodeFrame($rows, $codec);
}
public function adopt(Definition $definition, Column $column): Column
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Double/CountingFrameAccumulating.php b/src/core/etl/tests/Flow/ETL/Tests/Double/CountingFrameAccumulating.php
index a46b3dcfc7..39698a75ec 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Double/CountingFrameAccumulating.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Double/CountingFrameAccumulating.php
@@ -41,7 +41,7 @@ public function frameValues(Rows $partition, array $bounds, Backend $backend, Pr
{
$this->counters()->bounds[] = $bounds;
- return (new Sum($this->ref, false))->frameValues($partition, $bounds, $backend, $progress);
+ return new Sum($this->ref, false)->frameValues($partition, $bounds, $backend, $progress);
}
public static function fromDescription(#[SensitiveParameter] array $data, Rebuild $rebuild): static
@@ -56,7 +56,7 @@ public function describe(): ?Description
public function values(Rows $partition, Backend $backend, Progress $progress): array
{
- return (new FrameAccumulation($this->window()->frame()))->values($this, $partition, $backend, $progress);
+ return new FrameAccumulation($this->window()->frame())->values($this, $partition, $backend, $progress);
}
/**
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Double/DelegatingLauncher.php b/src/core/etl/tests/Flow/ETL/Tests/Double/DelegatingLauncher.php
index d08cefa31d..3df69e40b3 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Double/DelegatingLauncher.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Double/DelegatingLauncher.php
@@ -41,7 +41,7 @@ public function read(
return new Launch(
1,
$this->rest,
- $this->delegated($this->delegated((new StepRunner())->steps(
+ $this->delegated($this->delegated(new StepRunner()->steps(
new PipelineSteps(),
$source->extract($context->backend(), $criteria),
$context,
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Double/FailingOnValuesFunction.php b/src/core/etl/tests/Flow/ETL/Tests/Double/FailingOnValuesFunction.php
index bcff854cb4..93817151aa 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Double/FailingOnValuesFunction.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Double/FailingOnValuesFunction.php
@@ -79,7 +79,7 @@ public function eval(Rows $rows, Backend $backend): Column
{
$this->counters()->evals++;
$this->counters()->seen[] = $rows;
- $values = (new Parameter($this->operand))->asInts($rows, $backend);
+ $values = new Parameter($this->operand)->asInts($rows, $backend);
foreach ($values as $i => $value) {
if (!in_array($value, $this->failing, true)) {
@@ -95,7 +95,7 @@ public function eval(Rows $rows, Backend $backend): Column
};
}
- return (new ResultColumn($backend))->of($this, $values);
+ return new ResultColumn($backend)->of($this, $values);
}
/**
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Double/ReportsResolvedOperand.php b/src/core/etl/tests/Flow/ETL/Tests/Double/ReportsResolvedOperand.php
index 3c7c7836ba..c48d282f25 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Double/ReportsResolvedOperand.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Double/ReportsResolvedOperand.php
@@ -61,7 +61,7 @@ public function withChildren(array $children): static
public function eval(Rows $rows, Backend $backend): Column
{
// @mago-ignore analysis:possibly-invalid-argument
- return (new ResultColumn($backend))->of($this, array_fill(0, $rows->count(), $this->operand->resolved()));
+ return new ResultColumn($backend)->of($this, array_fill(0, $rows->count(), $this->operand->resolved()));
}
/**
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Double/ReturnsSpyFunction.php b/src/core/etl/tests/Flow/ETL/Tests/Double/ReturnsSpyFunction.php
index 0f74d3e988..7c85a64822 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Double/ReturnsSpyFunction.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Double/ReturnsSpyFunction.php
@@ -56,7 +56,7 @@ public function describe(): ?Description
public function eval(Rows $rows, Backend $backend): Column
{
// @mago-ignore analysis:possibly-invalid-argument
- return (new ResultColumn($backend))->of($this, $rows->isEmpty() ? [] : array_fill(0, $rows->count(), 1));
+ return new ResultColumn($backend)->of($this, $rows->isEmpty() ? [] : array_fill(0, $rows->count(), 1));
}
/**
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Double/SpineCopyingRule.php b/src/core/etl/tests/Flow/ETL/Tests/Double/SpineCopyingRule.php
index 867115e3c8..5fa53b4255 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Double/SpineCopyingRule.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Double/SpineCopyingRule.php
@@ -16,7 +16,7 @@
{
public function apply(LogicalPlan $plan, Backend $backend): LogicalPlan
{
- return new LogicalPlan((new TransformUp())->of($plan->root, $this));
+ return new LogicalPlan(new TransformUp()->of($plan->root, $this));
}
public function of(Node $original, Node $rebuilt): Node
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Double/StubLauncher.php b/src/core/etl/tests/Flow/ETL/Tests/Double/StubLauncher.php
index b17148aa76..0c28296c33 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Double/StubLauncher.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Double/StubLauncher.php
@@ -41,7 +41,7 @@ public function read(
FlowContext $context,
?RunCounts $counts = null,
): Launch {
- $batches = (new AdoptedBatches($context->backend()))->of($source->extract($context->backend(), $criteria));
+ $batches = new AdoptedBatches($context->backend())->of($source->extract($context->backend(), $criteria));
foreach ($this->workers as $pid => $peakBytes) {
$counts?->worker($pid, $peakBytes);
@@ -50,7 +50,7 @@ public function read(
return new Launch(
$this->consumed,
$this->rest,
- (new StepRunner())->steps(
+ new StepRunner()->steps(
$this->steps,
$counts === null ? $batches : $counts->count($source, $batches, $criteria->narrows()),
$context,
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Fixtures/Floe/v2/all-column-types.floe b/src/core/etl/tests/Flow/ETL/Tests/Fixtures/Floe/v2/all-column-types.floe
index 14876f23ea..a024f72bb6 100644
Binary files a/src/core/etl/tests/Flow/ETL/Tests/Fixtures/Floe/v2/all-column-types.floe and b/src/core/etl/tests/Flow/ETL/Tests/Fixtures/Floe/v2/all-column-types.floe differ
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/API/Config/Bucketing/BucketingConfigBuilderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/API/Config/Bucketing/BucketingConfigBuilderTest.php
index 8424e7d547..7c43596278 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/API/Config/Bucketing/BucketingConfigBuilderTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/API/Config/Bucketing/BucketingConfigBuilderTest.php
@@ -20,7 +20,7 @@ public function test_build_uses_the_given_spill_root_for_the_default_storage():
{
$spillRoot = $this->cacheDir->suffix('/spill-root');
- (new BucketingConfigBuilder('/flow-php-sort/', 64))
+ new BucketingConfigBuilder('/flow-php-sort/', 64)
->build($spillRoot, new PhpBackend())
->storage->append('bucket-1', array_to_rows([['id' => 1]], schema(int_schema('id'))));
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/GroupByAggregationTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/GroupByAggregationTest.php
index 735e283e90..0794e0a68b 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/GroupByAggregationTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/GroupByAggregationTest.php
@@ -306,7 +306,7 @@ public function test_partition_count_does_not_affect_a_realistic_dataset(): void
'email' => $order['email'],
'discount' => $order['discount'],
],
- iterator_to_array((new FakeRandomOrdersExtractor(1000))->rawData(), false),
+ iterator_to_array(new FakeRandomOrdersExtractor(1000)->rawData(), false),
);
// one schema per spill file: declare the source schema so a null discount carries a
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/JoinCrossTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/JoinCrossTest.php
index 9e700db115..cccd7d9f78 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/JoinCrossTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/JoinCrossTest.php
@@ -152,9 +152,7 @@ public function test_the_runtime_reads_the_right_plan_once_over_every_left_batch
static::assertCount(
3,
df()
- ->read((new CountingExtractor(schema(int_schema('id')), RowsMother::sequentialIds(3)))->withBatchSize(
- 1,
- ))
+ ->read(new CountingExtractor(schema(int_schema('id')), RowsMother::sequentialIds(3))->withBatchSize(1))
->crossJoin(df()->read($right))
->fetch(),
);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/JoinTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/JoinTest.php
index 51fd9e7c62..e1851d3ded 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/JoinTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/JoinTest.php
@@ -80,9 +80,7 @@ public function test_a_limit_after_a_resident_join_closes_the_loaders_before_it(
static::assertCount(
2,
df()
- ->read((new CountingExtractor(schema(int_schema('id')), RowsMother::sequentialIds(10)))->withBatchSize(
- 1,
- ))
+ ->read(new CountingExtractor(schema(int_schema('id')), RowsMother::sequentialIds(10))->withBatchSize(1))
->write($loader)
->join(
df()->read(from_rows(RowsMother::sequentialIds(10))),
@@ -583,9 +581,7 @@ public function test_the_runtime_reads_the_right_plan_once(): void
static::assertCount(
3,
df()
- ->read((new CountingExtractor(schema(int_schema('id')), RowsMother::sequentialIds(3)))->withBatchSize(
- 1,
- ))
+ ->read(new CountingExtractor(schema(int_schema('id')), RowsMother::sequentialIds(3))->withBatchSize(1))
->join(df()->read($right), join_on(['id' => 'id'], 'r_'), JoinType::inner)
->fetch(),
);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/LimitBatchingTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/LimitBatchingTest.php
index dd6284950d..09ada743a7 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/LimitBatchingTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/LimitBatchingTest.php
@@ -29,10 +29,9 @@ public function test_limit_returns_exactly_n_rows_for_any_batch_size(int $batchS
static::assertSame(
min($limit, 2000),
data_frame()
- ->read((new CountingExtractor(
- schema(int_schema('id')),
- RowsMother::sequentialIds(2000),
- ))->withBatchSize($batchSize))
+ ->read(new CountingExtractor(schema(int_schema('id')), RowsMother::sequentialIds(2000))->withBatchSize(
+ $batchSize,
+ ))
->limit($limit)
->fetch()
->count(),
@@ -48,7 +47,7 @@ public function test_limit_returns_exactly_n_rows_for_any_batch_size(int $batchS
#[TestWith([1000, 1001])]
public function test_limit_stops_the_source_within_one_batch(int $batchSize, int $limit): void
{
- $extractor = (new CountingExtractor(schema(int_schema('id')), RowsMother::sequentialIds(2000)))->withBatchSize(
+ $extractor = new CountingExtractor(schema(int_schema('id')), RowsMother::sequentialIds(2000))->withBatchSize(
$batchSize,
);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/ArrayExpandTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/ArrayExpandTest.php
index 258dcb79ff..71b21b16ef 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/ArrayExpandTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/ArrayExpandTest.php
@@ -218,10 +218,7 @@ public function test_explain_shows_the_columns_an_expand_keeps(): void
->select('item')
->explain();
- static::assertStringContainsString(
- 'Keeps: item',
- (new Explain())->of($plan->planner->optimize($plan->logical)),
- );
+ static::assertStringContainsString('Keeps: item', new Explain()->of($plan->planner->optimize($plan->logical)));
}
public function test_expand_nested_in_a_structure_gives_one_row_per_element(): void
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/ArrayKeysStyleConvertTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/ArrayKeysStyleConvertTest.php
index 88ebdd2b52..928d1a705e 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/ArrayKeysStyleConvertTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/ArrayKeysStyleConvertTest.php
@@ -44,7 +44,7 @@ public function test_array_keys_style_convert_in_strict_mode(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "string".');
- (new FunctionContext(flow_context(config())))->eval(
+ new FunctionContext(flow_context(config()))->eval(
array_keys_style_convert(ref('string'), 'camel'),
[
'string' => 'test',
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/DOMElementNextSiblingTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/DOMElementNextSiblingTest.php
index 102347d595..b844916785 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/DOMElementNextSiblingTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/DOMElementNextSiblingTest.php
@@ -7,7 +7,6 @@
use DOMDocument;
use DOMElement;
use Flow\ETL\Tests\FlowTestCase;
-use PHPUnit\Framework\Attributes\RequiresPhp;
use function Flow\ETL\DSL\array_to_rows;
use function Flow\ETL\DSL\df;
@@ -22,7 +21,6 @@
final class DOMElementNextSiblingTest extends FlowTestCase
{
- #[RequiresPhp('>= 8.4.0')]
public function test_dom_element_sibling_text_value(): void
{
static::assertSame(
@@ -47,7 +45,6 @@ public function test_dom_element_sibling_text_value(): void
);
}
- #[RequiresPhp('>= 8.4.0')]
public function test_dom_element_sibling_text_value_when_only_element_is_allowed(): void
{
static::assertSame(
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/DOMElementParentTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/DOMElementParentTest.php
index 0e790b1518..f27dfced2f 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/DOMElementParentTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/DOMElementParentTest.php
@@ -5,7 +5,6 @@
namespace Flow\ETL\Tests\Integration\Functions;
use Flow\ETL\Tests\FlowTestCase;
-use PHPUnit\Framework\Attributes\RequiresPhp;
use function Flow\ETL\DSL\array_to_rows;
use function Flow\ETL\DSL\df;
@@ -17,7 +16,6 @@
final class DOMElementParentTest extends FlowTestCase
{
- #[RequiresPhp('>= 8.4.0')]
public function test_dom_element_value_from_dom_document(): void
{
static::assertSame(
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/DOMElementPreviousSiblingTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/DOMElementPreviousSiblingTest.php
index 3b347127b3..4c6297f9b2 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/DOMElementPreviousSiblingTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/DOMElementPreviousSiblingTest.php
@@ -6,7 +6,6 @@
use DOMDocument;
use Flow\ETL\Tests\FlowTestCase;
-use PHPUnit\Framework\Attributes\RequiresPhp;
use function Flow\ETL\DSL\array_to_rows;
use function Flow\ETL\DSL\df;
@@ -20,7 +19,6 @@
final class DOMElementPreviousSiblingTest extends FlowTestCase
{
- #[RequiresPhp('>= 8.4.0')]
public function test_dom_element_sibling_text_value(): void
{
static::assertSame(
@@ -45,7 +43,6 @@ public function test_dom_element_sibling_text_value(): void
);
}
- #[RequiresPhp('>= 8.4.0')]
public function test_dom_element_sibling_text_value_when_only_element_is_allowed(): void
{
static::assertSame(
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/HTMLQuerySelectorAllTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/HTMLQuerySelectorAllTest.php
index ec3fd9c7c1..2a3c61d216 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/HTMLQuerySelectorAllTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/HTMLQuerySelectorAllTest.php
@@ -5,7 +5,6 @@
namespace Flow\ETL\Tests\Integration\Functions;
use Dom\HTMLDocument;
-use PHPUnit\Framework\Attributes\RequiresPhp;
use PHPUnit\Framework\TestCase;
use function Flow\ETL\DSL\array_to_rows;
@@ -18,8 +17,6 @@
use const LIBXML_HTML_NOIMPLIED;
use const LIBXML_NOERROR;
-// @mago-ignore analysis:unavailable-method
-#[RequiresPhp('>= 8.4.0')]
final class HTMLQuerySelectorAllTest extends TestCase
{
public function test_invalid_query_all_on_html_document(): void
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/HTMLQuerySelectorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/HTMLQuerySelectorTest.php
index 25fb8585e8..f209403213 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/HTMLQuerySelectorTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/HTMLQuerySelectorTest.php
@@ -5,7 +5,6 @@
namespace Flow\ETL\Tests\Integration\Functions;
use Dom\HTMLDocument;
-use PHPUnit\Framework\Attributes\RequiresPhp;
use PHPUnit\Framework\TestCase;
use function Flow\ETL\DSL\array_to_rows;
@@ -15,8 +14,6 @@
use function Flow\ETL\DSL\ref;
use function Flow\ETL\DSL\schema;
-// @mago-ignore analysis:unavailable-method
-#[RequiresPhp('>= 8.4.0')]
final class HTMLQuerySelectorTest extends TestCase
{
public function test_invalid_query_on_html_document(): void
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/ListSelectTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/ListSelectTest.php
index 184e82a0b1..3dfec1e078 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/ListSelectTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/ListSelectTest.php
@@ -24,7 +24,7 @@ public function test_selection_order_and_optional_flags_are_preserved(): void
{
static::assertSame(
'?list',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
list_ref('list')->select('b', 'a'),
schema(list_schema(
@@ -45,7 +45,7 @@ public function test_selecting_a_numeric_element_name_by_its_string_form(): void
{
static::assertSame(
'?list',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
list_ref('list')->select('0'),
schema(list_schema('list', type_list(type_structure([0 => type_integer(), 'b' => type_string()])))),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/StructureSelectTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/StructureSelectTest.php
index 5449c0dfa1..0d5164ca47 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/StructureSelectTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/StructureSelectTest.php
@@ -23,7 +23,7 @@ public function test_selection_order_and_optional_flags_are_preserved(): void
{
static::assertSame(
'?structure{b?: string, a: integer}',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
structure_ref('user')->select('b', 'a'),
schema(structure_schema('user', type_structure([
@@ -41,7 +41,7 @@ public function test_selecting_a_numeric_element_name_by_its_string_form(): void
{
static::assertSame(
'?structure{0: integer}',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
structure_ref('user')->select('0'),
schema(structure_schema('user', type_structure([0 => type_integer(), 'b' => type_string()]))),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/FileFormatContractTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/FileFormatContractTest.php
index 251a818ff4..9a754da322 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/FileFormatContractTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/FileFormatContractTest.php
@@ -30,109 +30,109 @@ public static function formats(): Generator
#[DataProvider('formats')]
public function test_overwrite_replaces_what_the_destination_held(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->overwriteReplacesWhatTheDestinationHeld($format);
+ new FileFormatContract($this->cacheDir)->overwriteReplacesWhatTheDestinationHeld($format);
}
#[DataProvider('formats')]
public function test_append_keeps_what_the_destination_held(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->appendKeepsWhatTheDestinationHeld($format);
+ new FileFormatContract($this->cacheDir)->appendKeepsWhatTheDestinationHeld($format);
}
#[DataProvider('formats')]
public function test_ignore_leaves_an_existing_destination_untouched(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->ignoreLeavesAnExistingDestinationUntouched($format);
+ new FileFormatContract($this->cacheDir)->ignoreLeavesAnExistingDestinationUntouched($format);
}
#[DataProvider('formats')]
public function test_exception_if_exists_refuses_an_existing_destination(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->exceptionIfExistsRefusesAnExistingDestination($format);
+ new FileFormatContract($this->cacheDir)->exceptionIfExistsRefusesAnExistingDestination($format);
}
#[DataProvider('formats')]
public function test_a_batch_of_zero_rows_creates_no_file(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aBatchOfZeroRowsCreatesNoFile($format);
+ new FileFormatContract($this->cacheDir)->aBatchOfZeroRowsCreatesNoFile($format);
}
#[DataProvider('formats')]
public function test_a_write_that_ends_reports_its_file_operations(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aWriteThatEndsReportsItsFileOperations($format);
+ new FileFormatContract($this->cacheDir)->aWriteThatEndsReportsItsFileOperations($format);
}
#[DataProvider('formats')]
public function test_a_partitioned_write_reads_back_every_partition(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aPartitionedWriteReadsBackEveryPartition($format);
+ new FileFormatContract($this->cacheDir)->aPartitionedWriteReadsBackEveryPartition($format);
}
#[DataProvider('formats')]
public function test_a_loader_in_a_task_survives_describe(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aLoaderInATaskSurvivesDescribe($format);
+ new FileFormatContract($this->cacheDir)->aLoaderInATaskSurvivesDescribe($format);
}
#[DataProvider('formats')]
public function test_an_extractor_reader_survives_describe(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->anExtractorReaderSurvivesDescribe($format);
+ new FileFormatContract($this->cacheDir)->anExtractorReaderSurvivesDescribe($format);
}
#[DataProvider('formats')]
public function test_the_splits_read_every_row_once(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->theSplitsReadEveryRowOnce($format);
+ new FileFormatContract($this->cacheDir)->theSplitsReadEveryRowOnce($format);
}
#[DataProvider('formats')]
public function test_metadata_columns_name_the_source_file(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->metadataColumnsNameTheSourceFile($format);
+ new FileFormatContract($this->cacheDir)->metadataColumnsNameTheSourceFile($format);
}
#[DataProvider('formats')]
public function test_the_batch_size_bounds_every_batch(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->theBatchSizeBoundsEveryBatch($format);
+ new FileFormatContract($this->cacheDir)->theBatchSizeBoundsEveryBatch($format);
}
#[DataProvider('formats')]
public function test_refresh_lists_the_files_written_after_a_read(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->refreshListsTheFilesWrittenAfterARead($format);
+ new FileFormatContract($this->cacheDir)->refreshListsTheFilesWrittenAfterARead($format);
}
#[DataProvider('formats')]
public function test_a_failed_run_leaves_no_file_at_the_destination(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aFailedRunLeavesNoFileAtTheDestination($format);
+ new FileFormatContract($this->cacheDir)->aFailedRunLeavesNoFileAtTheDestination($format);
}
#[DataProvider('formats')]
public function test_an_extractor_rejects_a_path_its_filesystem_does_not_serve(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->anExtractorRejectsAPathItsFilesystemDoesNotServe($format);
+ new FileFormatContract($this->cacheDir)->anExtractorRejectsAPathItsFilesystemDoesNotServe($format);
}
#[DataProvider('formats')]
public function test_a_loader_rejects_a_path_its_filesystem_does_not_serve(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aLoaderRejectsAPathItsFilesystemDoesNotServe($format);
+ new FileFormatContract($this->cacheDir)->aLoaderRejectsAPathItsFilesystemDoesNotServe($format);
}
#[DataProvider('formats')]
public function test_reads_back_through_the_same_filesystem_instance(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->readsBackThroughTheSameFilesystemInstance($format);
+ new FileFormatContract($this->cacheDir)->readsBackThroughTheSameFilesystemInstance($format);
}
#[DataProvider('formats')]
public function test_a_pushed_filter_returns_what_the_filter_node_returns(FileFormat $format): void
{
- (new FileFormatContract($this->cacheDir))->aPushedFilterReturnsWhatTheFilterNodeReturns(
+ new FileFormatContract($this->cacheDir)->aPushedFilterReturnsWhatTheFilterNodeReturns(
$format,
ref('id')->notEquals(lit('b')),
);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Floe/FloeSplitReadTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Floe/FloeSplitReadTest.php
index 5da3906962..4d85ac93be 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Floe/FloeSplitReadTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Floe/FloeSplitReadTest.php
@@ -68,7 +68,7 @@ public function test_a_sized_split_is_read_without_listing(): void
FlowTestCase::extracted(
$reader,
flow_context()->backend(),
- (new Criteria())->withSplit(new FileSplit($file, 0, null, $size)),
+ new Criteria()->withSplit(new FileSplit($file, 0, null, $size)),
),
false,
),
@@ -90,7 +90,7 @@ public function test_an_unsized_split_lists_its_path(): void
iterator_to_array(FlowTestCase::extracted(
$reader,
flow_context()->backend(),
- (new Criteria())->withSplit(new FileSplit(path('memory://a.floe'), 0, null)),
+ new Criteria()->withSplit(new FileSplit(path('memory://a.floe'), 0, null)),
));
static::assertSame($listedBySchema + 1, $counting->listCalls);
@@ -131,7 +131,7 @@ public function test_the_limit_travels_with_the_split(): void
FlowTestCase::extracted(
from_floe(path('memory://a.floe'), filesystem: $memory)->reader(),
flow_context()->backend(),
- (new Criteria(3))->withSplit(new FileSplit(path('memory://a.floe'), 0, null)),
+ new Criteria(3)->withSplit(new FileSplit(path('memory://a.floe'), 0, null)),
),
false,
)[0]->count(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Loader/File/FileCommit/FileCommitTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Loader/File/FileCommit/FileCommitTest.php
index 3d83149a2f..e0af4b3b39 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Loader/File/FileCommit/FileCommitTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Loader/File/FileCommit/FileCommitTest.php
@@ -210,7 +210,7 @@ public function test_scan(): void
]);
static::assertCount(4, iterator_to_array(
- (new FileListing($this->fs))->list($this->context->path(__FUNCTION__ . '/**/*.txt'), new KeepAll()),
+ new FileListing($this->fs)->list($this->context->path(__FUNCTION__ . '/**/*.txt'), new KeepAll()),
false,
));
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Loader/File/FileCommit/Partitioned/PartitionPlaceholdersTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Loader/File/FileCommit/Partitioned/PartitionPlaceholdersTest.php
index dd42050fad..75a690cfb5 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Loader/File/FileCommit/Partitioned/PartitionPlaceholdersTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Loader/File/FileCommit/Partitioned/PartitionPlaceholdersTest.php
@@ -64,7 +64,7 @@ public function test_list_attaches_partitions_from_placeholders(): void
]);
$listed = iterator_to_array(
- (new FileListing($this->fs))->list(
+ new FileListing($this->fs)->list(
$this->context->path(__FUNCTION__ . '/order-year=*/{order-name}.csv'),
new OnlyFiles(),
),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/Storage/FilesystemRowsStorageTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/Storage/FilesystemRowsStorageTest.php
index a33e1dc4b2..da9ca37aa8 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/Storage/FilesystemRowsStorageTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/Storage/FilesystemRowsStorageTest.php
@@ -82,9 +82,7 @@ public function test_remove_of_a_missing_bucket_is_a_no_op(): void
{
$cacheDir = path(__DIR__ . '/var/buckets_remove_missing');
$this->fs()->rm($cacheDir);
- (new FilesystemRowsStorage($this->fs(), cacheDir: $cacheDir, backend: new PhpBackend()))->remove(
- 'never-written',
- );
+ new FilesystemRowsStorage($this->fs(), cacheDir: $cacheDir, backend: new PhpBackend())->remove('never-written');
static::assertNull($this->fs()->status($cacheDir));
}
@@ -267,11 +265,11 @@ public function test_get_missing_bucket_yields_nothing(): void
static::assertSame(
[],
- RowsStorageContext::rows((new FilesystemRowsStorage(
+ RowsStorageContext::rows(new FilesystemRowsStorage(
$this->fs(),
cacheDir: $cacheDir,
backend: new PhpBackend(),
- ))->get('nope')),
+ )->get('nope')),
);
}
@@ -481,7 +479,7 @@ public function test_append_resume_with_a_genuinely_different_column_set_still_t
{
$path = $this->cacheDir->suffix('resume-different-columns.floe');
- $writer = (new FloeFiles($this->fs(), new AdaptiveBackend()))->create(
+ $writer = new FloeFiles($this->fs(), new AdaptiveBackend())->create(
$path,
($first = array_to_rows(
[['id' => 1, 'name' => 'x']],
@@ -493,10 +491,7 @@ public function test_append_resume_with_a_genuinely_different_column_set_still_t
$this->expectException(IncompatibleSchemaException::class);
- (new FloeFiles($this->fs(), new AdaptiveBackend()))->append($path, schema(
- int_schema('id'),
- str_schema('city'),
- ));
+ new FloeFiles($this->fs(), new AdaptiveBackend())->append($path, schema(int_schema('id'), str_schema('city')));
}
public function test_datetime_values_read_back_as_admitted(): void
@@ -547,11 +542,11 @@ public function test_close_finishes_a_bucket_so_a_fresh_store_can_read_it(): voi
static::assertCount(
2,
- RowsStorageContext::rows((new FilesystemRowsStorage(
+ RowsStorageContext::rows(new FilesystemRowsStorage(
$this->fs(),
cacheDir: $cacheDir,
backend: new PhpBackend(),
- ))->get('bucket')),
+ )->get('bucket')),
);
$this->fs()->rm($cacheDir);
@@ -560,12 +555,12 @@ public function test_close_finishes_a_bucket_so_a_fresh_store_can_read_it(): voi
public function test_a_store_over_the_local_filesystem_describes_its_root_and_batch_size(): void
{
$cacheDir = path(__DIR__ . '/var/buckets_describe');
- $description = (new FilesystemRowsStorage(
+ $description = new FilesystemRowsStorage(
$this->fs(),
cacheDir: $cacheDir,
backend: new PhpBackend(),
batchSize: 7,
- ))->describe();
+ )->describe();
static::assertNotNull($description);
static::assertTrue($description->sensitive());
@@ -576,22 +571,22 @@ public function test_a_store_over_the_local_filesystem_describes_its_root_and_ba
public function test_a_backend_that_does_not_describe_makes_the_storage_undescribable(): void
{
static::assertNull(
- (new FilesystemRowsStorage(
+ new FilesystemRowsStorage(
$this->fs(),
cacheDir: path(__DIR__ . '/var/buckets_describe'),
backend: new AcceptingBackend(),
- ))->describe(),
+ )->describe(),
);
}
public function test_a_store_over_a_memory_filesystem_does_not_describe(): void
{
static::assertNull(
- (new FilesystemRowsStorage(
+ new FilesystemRowsStorage(
memory_filesystem(),
cacheDir: path('memory://cache'),
backend: new PhpBackend(),
- ))->describe(),
+ )->describe(),
);
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/Storage/Floe/FloeStatisticsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/Storage/Floe/FloeStatisticsTest.php
index 691f2ecb31..48eb84579e 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/Storage/Floe/FloeStatisticsTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/Storage/Floe/FloeStatisticsTest.php
@@ -74,7 +74,7 @@ public function test_a_multi_section_file_sums_its_sections(): void
FloeStreamReaderContext::write($this->fs(), $path, array_to_rows([['id' => 1]], schema(int_schema('id'))));
foreach ([[2, 3], [4, 5, 6]] as $ids) {
- $writer = (new FloeFiles($this->fs(), new AdaptiveBackend()))->append($path, schema(int_schema('id')));
+ $writer = new FloeFiles($this->fs(), new AdaptiveBackend())->append($path, schema(int_schema('id')));
foreach ($ids as $id) {
$writer->write(array_to_rows([['id' => $id]], schema(int_schema('id'))));
@@ -117,7 +117,7 @@ public function test_an_appended_file_reports_the_combined_totals(): void
FloeStreamReaderContext::write($this->fs(), $path, array_to_rows([['id' => 1]], schema(int_schema('id'))));
$before = FloeStreamReaderContext::footer($this->fs(), $path)->statistics->byteSize;
- $writer = (new FloeFiles($this->fs(), new AdaptiveBackend()))->append($path, schema(int_schema('id')));
+ $writer = new FloeFiles($this->fs(), new AdaptiveBackend())->append($path, schema(int_schema('id')));
$writer->write(array_to_rows([['id' => 2], ['id' => 3]], schema(int_schema('id'))));
$writer->close();
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/Storage/Floe/FloeStreamReaderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/Storage/Floe/FloeStreamReaderTest.php
index 2bf6a471f1..a259409b05 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/Storage/Floe/FloeStreamReaderTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/Storage/Floe/FloeStreamReaderTest.php
@@ -28,7 +28,7 @@ public function test_merged_multi_schema_file_reads_seamlessly(): void
$fileThree = $this->cacheDir->suffix('evolving-3.floe');
$rowsOne = array_to_rows([['id' => 1]], schema(int_schema('id')));
- $writer = (new FloeFiles($this->fs(), new AdaptiveBackend()))->create($fileOne, $rowsOne->schema());
+ $writer = new FloeFiles($this->fs(), new AdaptiveBackend())->create($fileOne, $rowsOne->schema());
$writer->write($rowsOne);
$writer->close();
@@ -36,7 +36,7 @@ public function test_merged_multi_schema_file_reads_seamlessly(): void
[['id' => 2, 'email' => null]],
schema(int_schema('id'), str_schema('email', nullable: true)),
);
- $writer = (new FloeFiles($this->fs(), new AdaptiveBackend()))->create($fileTwo, $rowsTwo->schema());
+ $writer = new FloeFiles($this->fs(), new AdaptiveBackend())->create($fileTwo, $rowsTwo->schema());
$writer->write($rowsTwo);
$writer->close();
@@ -44,13 +44,13 @@ public function test_merged_multi_schema_file_reads_seamlessly(): void
[['id' => 3, 'email' => 'third@flow.php']],
schema(int_schema('id'), str_schema('email')),
);
- $writer = (new FloeFiles($this->fs(), new AdaptiveBackend()))->create($fileThree, $rowsThree->schema());
+ $writer = new FloeFiles($this->fs(), new AdaptiveBackend())->create($fileThree, $rowsThree->schema());
$writer->write($rowsThree);
$writer->close();
- (new FloeMerger($this->fs(), new AdaptiveBackend()))->merge([$fileOne, $fileTwo, $fileThree], $path);
+ new FloeMerger($this->fs(), new AdaptiveBackend())->merge([$fileOne, $fileTwo, $fileThree], $path);
- $reader = (new FloeFiles($this->fs(), new AdaptiveBackend()))->read($path);
+ $reader = new FloeFiles($this->fs(), new AdaptiveBackend())->read($path);
static::assertSame(3, $reader->totalRows());
@@ -74,7 +74,7 @@ public function test_a_file_of_many_frames_round_trips(): void
[['id' => 0, 'payload' => str_pad('row_0', 300, 'x')]],
schema(int_schema('id'), str_schema('payload')),
)->schema();
- $writer = (new FloeFiles($this->fs(), new AdaptiveBackend()))->create($path, $schema);
+ $writer = new FloeFiles($this->fs(), new AdaptiveBackend())->create($path, $schema);
$written = 0;
for ($i = 0; $i < 4000; $i++) {
@@ -89,7 +89,7 @@ public function test_a_file_of_many_frames_round_trips(): void
$read = 0;
- foreach ((new FloeFiles($this->fs(), new AdaptiveBackend(), chunkSize: 4096))
+ foreach (new FloeFiles($this->fs(), new AdaptiveBackend(), chunkSize: 4096)
->read($path)
->rows(500) as $batch) {
foreach ($batch->toArray() as $row) {
@@ -106,12 +106,12 @@ public function test_round_trip_of_all_column_types_through_local_filesystem():
$rows = RowsMother::withAllColumnTypes();
$path = $this->cacheDir->suffix('all-types.floe');
- $writer = (new FloeFiles($this->fs(), new AdaptiveBackend()))->create($path, $rows->schema());
+ $writer = new FloeFiles($this->fs(), new AdaptiveBackend())->create($path, $rows->schema());
$writer->write($rows);
$writer->close();
$batches = iterator_to_array(
- (new FloeFiles($this->fs(), new AdaptiveBackend()))
+ new FloeFiles($this->fs(), new AdaptiveBackend())
->read($path)
->rows(),
);
@@ -125,13 +125,13 @@ public function test_round_trip_of_heterogeneous_rows_through_local_filesystem()
$rows = RowsMother::heterogeneous();
$path = $this->cacheDir->suffix('heterogeneous.floe');
- $writer = (new FloeFiles($this->fs(), new AdaptiveBackend()))->create($path, $rows->schema());
+ $writer = new FloeFiles($this->fs(), new AdaptiveBackend())->create($path, $rows->schema());
$writer->write($rows);
$writer->close();
$read = 0;
- foreach ((new FloeFiles($this->fs(), new AdaptiveBackend()))
+ foreach (new FloeFiles($this->fs(), new AdaptiveBackend())
->read($path)
->rows() as $batch) {
$read += $batch->count();
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/Storage/Floe/FloeWriteContractTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/Storage/Floe/FloeWriteContractTest.php
index 674e567a89..58ffc8be88 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Integration/Storage/Floe/FloeWriteContractTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/Storage/Floe/FloeWriteContractTest.php
@@ -60,7 +60,7 @@ public function test_the_writer_rejects_the_value_with_the_message(
string $expectedMessage,
): void {
$path = $this->cacheDir->suffix('contract-' . md5($expectedMessage) . '.floe');
- $writer = (new FloeFiles($this->fs(), new AdaptiveBackend(), new Options()))->create($path, $schema);
+ $writer = new FloeFiles($this->fs(), new AdaptiveBackend(), new Options())->create($path, $schema);
try {
$writer->write($batch);
@@ -81,7 +81,7 @@ public function test_the_writer_rejects_the_value_with_the_message(
public function test_a_rejected_batch_leaves_previously_written_rows_readable(): void
{
$path = $this->cacheDir->suffix('contract-survivor.floe');
- $writer = (new FloeFiles($this->fs(), new AdaptiveBackend(), new Options()))->create(
+ $writer = new FloeFiles($this->fs(), new AdaptiveBackend(), new Options())->create(
$path,
schema(int_schema('id')),
);
@@ -101,7 +101,7 @@ public function test_a_rejected_batch_leaves_previously_written_rows_readable():
public function test_a_batch_omitting_a_nullable_column_still_writes(): void
{
$path = $this->cacheDir->suffix('contract-absent.floe');
- $writer = (new FloeFiles($this->fs(), new AdaptiveBackend(), new Options()))->create($path, schema(
+ $writer = new FloeFiles($this->fs(), new AdaptiveBackend(), new Options())->create($path, schema(
int_schema('id'),
str_schema('name', nullable: true),
));
@@ -125,7 +125,7 @@ public function test_a_batch_omitting_a_nullable_column_still_writes(): void
public function test_a_batch_omitting_a_not_null_column_is_refused(): void
{
$path = $this->cacheDir->suffix('contract-absent-not-null.floe');
- $writer = (new FloeFiles($this->fs(), new AdaptiveBackend(), new Options()))->create($path, schema(
+ $writer = new FloeFiles($this->fs(), new AdaptiveBackend(), new Options())->create($path, schema(
int_schema('id'),
str_schema('name'),
));
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Mother/ColumnMother.php b/src/core/etl/tests/Flow/ETL/Tests/Mother/ColumnMother.php
index 01fb06f3c7..0e13d45201 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Mother/ColumnMother.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Mother/ColumnMother.php
@@ -16,7 +16,7 @@ final class ColumnMother
*/
public static function of(Definition $definition, array $values): Column
{
- $builder = (new PhpBackend())->builder($definition);
+ $builder = new PhpBackend()->builder($definition);
$builder->appendMany($values);
return $builder->finish();
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Mother/PartitionedSourceMother.php b/src/core/etl/tests/Flow/ETL/Tests/Mother/PartitionedSourceMother.php
index c84d9e4526..5a18d541b7 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Mother/PartitionedSourceMother.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Mother/PartitionedSourceMother.php
@@ -23,13 +23,13 @@ public static function partitions(): Schema
public static function yearMonth(): RecordingFileExtractor
{
- return (new RecordingFileExtractor(
+ return new RecordingFileExtractor(
schema(int_schema('year'), str_schema('month'), str_schema('value')),
array_to_rows(
[['year' => 2023, 'month' => '07', 'value' => 'a'], ['year' => 2024, 'month' => '08', 'value' => 'b']],
schema(int_schema('year'), str_schema('month'), str_schema('value')),
),
- ))->withPartitionSchema(self::partitions());
+ )->withPartitionSchema(self::partitions());
}
public static function file(string $partitions): FileStatus
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Mother/RowsMother.php b/src/core/etl/tests/Flow/ETL/Tests/Mother/RowsMother.php
index 2ab2c06645..8753baf69a 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Mother/RowsMother.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Mother/RowsMother.php
@@ -19,6 +19,8 @@
use function Flow\ETL\DSL\datetime_schema;
use function Flow\ETL\DSL\enum_schema;
use function Flow\ETL\DSL\float_schema;
+use function Flow\ETL\DSL\html_element_schema;
+use function Flow\ETL\DSL\html_schema;
use function Flow\ETL\DSL\int_schema;
use function Flow\ETL\DSL\json_schema;
use function Flow\ETL\DSL\list_schema;
@@ -34,6 +36,8 @@
use function Flow\ETL\DSL\xml_schema;
use function Flow\Types\DSL\structure_element;
use function Flow\Types\DSL\type_boolean;
+use function Flow\Types\DSL\type_html;
+use function Flow\Types\DSL\type_html_element;
use function Flow\Types\DSL\type_integer;
use function Flow\Types\DSL\type_json;
use function Flow\Types\DSL\type_list;
@@ -150,7 +154,7 @@ public static function numbered(int $count): Rows
static fn(int $id) => [
'id' => $id,
'name' => ($id % 4) === 0 ? null : 'user_' . $id,
- 'at' => (new DateTimeImmutable('2026-01-01 00:00:00.000001 +00:00'))->modify("+{$id} hours"),
+ 'at' => new DateTimeImmutable('2026-01-01 00:00:00.000001 +00:00')->modify("+{$id} hours"),
],
range(1, $count),
),
@@ -166,9 +170,6 @@ public static function heterogeneous(): Rows
);
}
- /**
- * Every column type except html/html_element, which require PHP 8.4.
- */
public static function withAllColumnTypes(): Rows
{
$structure = type_structure([
@@ -212,6 +213,8 @@ public static function withAllColumnTypes(): Rows
'structure_interleaved' => $interleaved->cast(['z' => 1, 'b' => 'x']),
'xml' => type_xml()->cast('text & entity'),
'xml_element' => type_xml_element()->cast('- value
'),
+ 'html' => type_html()->cast('hi
'),
+ 'html_element' => type_html_element()->cast('hi
'),
]],
schema(
int_schema('int'),
@@ -240,6 +243,8 @@ enum_schema('enum_basic', BasicEnum::class),
structure_schema('structure_interleaved', $interleaved),
xml_schema('xml'),
xml_element_schema('xml_element'),
+ html_schema('html'),
+ html_element_schema('html_element'),
),
);
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Config/Bucketing/BucketingConfigBuilderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Config/Bucketing/BucketingConfigBuilderTest.php
index 9a1f65d352..926c274a9f 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Config/Bucketing/BucketingConfigBuilderTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Config/Bucketing/BucketingConfigBuilderTest.php
@@ -25,12 +25,12 @@ public function test_batch_size_below_one_is_rejected(): void
$this->expectExceptionMessage('Batch size must be at least 1');
// @mago-ignore analysis:invalid-argument
- (new BucketingConfigBuilder('/flow-php-join/', 64))->batchSize(0);
+ new BucketingConfigBuilder('/flow-php-join/', 64)->batchSize(0);
}
public function test_buckets_count_and_batch_size_are_set(): void
{
- $config = (new BucketingConfigBuilder('/flow-php-join/', 64))
+ $config = new BucketingConfigBuilder('/flow-php-join/', 64)
->bucketsCount(4)
->batchSize(250)
->build(Path::realpath(__DIR__), new PhpBackend());
@@ -45,12 +45,12 @@ public function test_buckets_count_below_one_is_rejected(): void
$this->expectExceptionMessage('Buckets count must be greater than 0');
// @mago-ignore analysis:invalid-argument
- (new BucketingConfigBuilder('/flow-php-join/', 64))->bucketsCount(0);
+ new BucketingConfigBuilder('/flow-php-join/', 64)->bucketsCount(0);
}
public function test_default_builds_a_filesystem_buckets_storage(): void
{
- $config = (new BucketingConfigBuilder('/flow-php-join/', 64))->build(Path::realpath(__DIR__), new PhpBackend());
+ $config = new BucketingConfigBuilder('/flow-php-join/', 64)->build(Path::realpath(__DIR__), new PhpBackend());
static::assertInstanceOf(FilesystemRowsStorage::class, $config->storage);
static::assertSame(64, $config->bucketsCount);
@@ -61,7 +61,7 @@ public function test_default_buckets_count_comes_from_the_constructor(): void
{
static::assertSame(
100,
- (new BucketingConfigBuilder('/flow-php-sort/', 100))->build(
+ new BucketingConfigBuilder('/flow-php-sort/', 100)->build(
Path::realpath(__DIR__),
new PhpBackend(),
)->bucketsCount,
@@ -72,7 +72,7 @@ public function test_memory_limit_defaults_to_the_process_default(): void
{
static::assertSame(
MemoryLimit::default()->inBytes(),
- (new BucketingConfigBuilder('/flow-php-join/', 64))
+ new BucketingConfigBuilder('/flow-php-join/', 64)
->build(Path::realpath(__DIR__), new PhpBackend())
->memoryLimit->inBytes(),
);
@@ -82,7 +82,7 @@ public function test_memory_limit_is_set(): void
{
static::assertSame(
Unit::fromMb(128)->inBytes(),
- (new BucketingConfigBuilder('/flow-php-join/', 64))
+ new BucketingConfigBuilder('/flow-php-join/', 64)
->memoryLimit(Unit::fromMb(128))
->build(Path::realpath(__DIR__), new PhpBackend())
->memoryLimit->inBytes(),
@@ -94,7 +94,7 @@ public function test_memory_limit_below_one_byte_is_rejected(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Bucketing memory limit must be greater than 0 bytes');
- (new BucketingConfigBuilder('/flow-php-join/', 64))->memoryLimit(Unit::fromBytes(0));
+ new BucketingConfigBuilder('/flow-php-join/', 64)->memoryLimit(Unit::fromBytes(0));
}
public function test_group_by_and_repartition_defaults_are_64_buckets_of_1000_rows_on_the_filesystem(): void
@@ -114,7 +114,7 @@ public function test_injected_storage_wins_over_the_default(): void
static::assertSame(
$storage,
- (new BucketingConfigBuilder('/flow-php-join/', 64))
+ new BucketingConfigBuilder('/flow-php-join/', 64)
->storage($storage)
->build(Path::realpath(__DIR__), new PhpBackend())
->storage,
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/DataFrameTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/DataFrameTest.php
index 802934b9e7..8a140ecc68 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/DataFrameTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/DataFrameTest.php
@@ -1486,7 +1486,7 @@ public function test_for_each_receives_every_batch(): void
public function test_explain_prints_the_logical_plan_without_reading_a_row(): void
{
- $extractor = (new RecordingFileExtractor(schema(int_schema('id'))))->withPruning();
+ $extractor = new RecordingFileExtractor(schema(int_schema('id')))->withPruning();
static::assertSame(<<<'PLAN'
#2 Write preserving · opaque
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/TransformationsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/TransformationsTest.php
index 743b5f3fe0..19444c0516 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/TransformationsTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/TransformationsTest.php
@@ -25,7 +25,7 @@ public function test_transformations(): void
$transformation1->expects(self::once())->method('__invoke')->with($dataFrame)->willReturn($dataFrame);
$transformation2->expects(self::once())->method('__invoke')->with($dataFrame)->willReturn($dataFrame);
- static::assertSame($dataFrame, (new Transformations($transformation1, $transformation2))($dataFrame));
+ static::assertSame($dataFrame, new Transformations($transformation1, $transformation2)($dataFrame));
}
public function test_invoking_transformations_gives_the_rows_of_with(): void
@@ -33,7 +33,7 @@ public function test_invoking_transformations_gives_the_rows_of_with(): void
$dataFrame = df()->read(from_array([['id' => 1, 'name' => 'a'], ['id' => 2, 'name' => 'b']]));
$expected = [['id' => 1]];
- static::assertSame($expected, (new Transformations(select('id'), limit(1)))($dataFrame)->fetch()->toArray());
+ static::assertSame($expected, new Transformations(select('id'), limit(1))($dataFrame)->fetch()->toArray());
static::assertSame(
$expected,
$dataFrame
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Comparator/ColumnComparatorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Comparator/ColumnComparatorTest.php
index 97c176ba42..bbfe7e9895 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Comparator/ColumnComparatorTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Comparator/ColumnComparatorTest.php
@@ -21,16 +21,16 @@ public function test_accepts_only_two_columns(): void
{
$column = ColumnMother::of(int_schema('a'), [1]);
- static::assertTrue((new ColumnComparator())->accepts($column, $column));
- static::assertFalse((new ColumnComparator())->accepts($column, [1]));
- static::assertFalse((new ColumnComparator())->accepts([1], $column));
+ static::assertTrue(new ColumnComparator()->accepts($column, $column));
+ static::assertFalse(new ColumnComparator()->accepts($column, [1]));
+ static::assertFalse(new ColumnComparator()->accepts([1], $column));
}
public function test_columns_of_both_backends_with_equal_values_pass(): void
{
$comparator = new ColumnComparator();
$comparator->setFactory(Factory::getInstance());
- $default = (new AdaptiveBackend())->builder(int_schema('a', nullable: true));
+ $default = new AdaptiveBackend()->builder(int_schema('a', nullable: true));
$default->appendMany([1, null]);
$comparator->assertEquals(ColumnMother::of(int_schema('a', nullable: true), [1, null]), $default->finish());
@@ -47,7 +47,7 @@ public function test_different_values_fail(): void
$this->expectExceptionMessage('Failed asserting that two columns are equal.');
$comparator->assertEquals(
- (new PhpBackend())->constant(int_schema('a'), 1, 2),
+ new PhpBackend()->constant(int_schema('a'), 1, 2),
ColumnMother::of(int_schema('a'), [1, 3]),
);
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Comparator/RowsComparatorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Comparator/RowsComparatorTest.php
index 9238522891..793031d5c1 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Comparator/RowsComparatorTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Comparator/RowsComparatorTest.php
@@ -49,7 +49,7 @@ public function test_equal_across_column_classes(): void
$comparator->assertEquals(
Rows::fromColumns(
schema(int_schema('id')),
- ['id' => (new PhpBackend())->constant(int_schema('id'), 7, 2)],
+ ['id' => new PhpBackend()->constant(int_schema('id'), 7, 2)],
2,
),
array_to_rows([['id' => 7], ['id' => 7]], schema(int_schema('id'))),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/DSL/DefinitionFromTypeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/DSL/DefinitionFromTypeTest.php
index 3f2127d5f1..9ceaa7b0e6 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/DSL/DefinitionFromTypeTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/DSL/DefinitionFromTypeTest.php
@@ -112,7 +112,7 @@ public function test_the_string_narrower_output_can_always_be_typed(): void
foreach (['+02:00', 'Europe/Warsaw', 'UTC'] as $value) {
static::assertInstanceOf(TimeZoneDefinition::class, definition_from_type(
'tz',
- (new StringTypeNarrower())->narrow($value),
+ new StringTypeNarrower()->narrow($value),
));
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Calculator/CalculatorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Calculator/CalculatorTest.php
index b1c8776cb0..6dedf5fd50 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Calculator/CalculatorTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Calculator/CalculatorTest.php
@@ -50,7 +50,7 @@ public function test_modulus_by_zero_is_refused_for_ints(): void
{
$this->expectException(MathException::class);
- (new Calculator())->modulus(7, 0);
+ new Calculator()->modulus(7, 0);
}
#[TestWith(['1', '1', 2.0])]
@@ -77,7 +77,7 @@ public function test_add(string|int|float $a, string|int|float $b, int|float $ou
assert(is_numeric($b), 'String parameter $b must be numeric');
}
- static::assertSame($output, (new Calculator())->add($a, $b));
+ static::assertSame($output, new Calculator()->add($a, $b));
}
#[TestWith(['1', '1', 1.0])]
@@ -105,14 +105,14 @@ public function test_divide(string|int|float $a, string|int|float $b, int|float
assert(is_numeric($b), 'String parameter $b must be numeric');
}
- static::assertSame($output, (new Calculator())->divide($a, $b, rounding: Rounding::HALF_UP));
+ static::assertSame($output, new Calculator()->divide($a, $b, rounding: Rounding::HALF_UP));
}
#[TestWith([4, 2, 2.0])]
#[TestWith([4.0, 2, 2.0])]
public function test_divide_always_yields_float(int|float $a, int|float $b, float $output): void
{
- static::assertSame($output, (new Calculator())->divide($a, $b));
+ static::assertSame($output, new Calculator()->divide($a, $b));
}
public function test_divide_by_zero(): void
@@ -120,7 +120,7 @@ public function test_divide_by_zero(): void
$this->expectException(DivisionByZeroError::class);
$this->expectExceptionMessage('Division by zero');
- (new Calculator())->divide(1, 0);
+ new Calculator()->divide(1, 0);
}
public function test_divide_by_zero_with_a_scale_and_a_rounding(): void
@@ -128,24 +128,24 @@ public function test_divide_by_zero_with_a_scale_and_a_rounding(): void
$this->expectException(DivisionByZeroError::class);
$this->expectExceptionMessage('Division by zero.');
- (new Calculator())->divide(1, 0, 2, Rounding::HALF_UP);
+ new Calculator()->divide(1, 0, 2, Rounding::HALF_UP);
}
public function test_divide_with_unnecessary_rounding_refuses_an_inexact_quotient(): void
{
$this->expectException(RoundingNecessaryException::class);
- (new Calculator())->divide(1, 3, 2, Rounding::UNNECESSARY);
+ new Calculator()->divide(1, 3, 2, Rounding::UNNECESSARY);
}
public function test_divide_a_numeric_string_with_a_scale_and_a_rounding(): void
{
- static::assertSame(0.33, (new Calculator())->divide('1', 3, 2, Rounding::HALF_UP));
+ static::assertSame(0.33, new Calculator()->divide('1', 3, 2, Rounding::HALF_UP));
}
public function test_modulus_of_a_numeric_string_beyond_the_int_range(): void
{
- static::assertSame(1, (new Calculator())->modulus('99999999999999999999', 7));
+ static::assertSame(1, new Calculator()->modulus('99999999999999999999', 7));
}
public function test_divide_by_zero_as_float(): void
@@ -153,7 +153,7 @@ public function test_divide_by_zero_as_float(): void
$this->expectException(DivisionByZeroError::class);
$this->expectExceptionMessage('Division by zero');
- (new Calculator())->divide(1, 0.0);
+ new Calculator()->divide(1, 0.0);
}
public function test_divide_by_zero_as_string(): void
@@ -161,7 +161,7 @@ public function test_divide_by_zero_as_string(): void
$this->expectException(DivisionByZeroError::class);
$this->expectExceptionMessage('Division by zero');
- (new Calculator())->divide(1, '0');
+ new Calculator()->divide(1, '0');
}
public function test_float_operand_always_yields_float(): void
@@ -186,7 +186,7 @@ public function test_multiply_refuses_an_int_product_that_overflows(): void
{
$this->expectException(IntegerOverflowException::class);
- (new Calculator())->multiply(3_037_000_500, 3_037_000_500);
+ new Calculator()->multiply(3_037_000_500, 3_037_000_500);
}
#[TestWith([PHP_INT_MAX, 2])]
@@ -195,14 +195,14 @@ public function test_multiply_refuses_an_overflowing_product_of_a_large_and_a_sm
{
$this->expectException(IntegerOverflowException::class);
- (new Calculator())->multiply($a, $b);
+ new Calculator()->multiply($a, $b);
}
public function test_divide_with_a_scale_and_no_rounding_refuses_an_inexact_quotient(): void
{
$this->expectException(RoundingNecessaryException::class);
- (new Calculator())->divide(1, 3, 2);
+ new Calculator()->divide(1, 3, 2);
}
public function test_divide_refuses_a_negative_scale(): void
@@ -210,12 +210,12 @@ public function test_divide_refuses_a_negative_scale(): void
$this->expectException(PhpInvalidArgumentException::class);
$this->expectExceptionMessageMatches('/scale (cannot|must not) be negative/i');
- (new Calculator())->divide(10, 3, -1, Rounding::HALF_UP);
+ new Calculator()->divide(10, 3, -1, Rounding::HALF_UP);
}
public function test_divide_rounds_the_decimal_form_of_a_float_not_its_binary_value(): void
{
- static::assertSame(0.1, (new Calculator())->divide(0.10000000000000041, 1, 15, Rounding::UP));
+ static::assertSame(0.1, new Calculator()->divide(0.10000000000000041, 1, 15, Rounding::UP));
}
public function test_divide_under_a_zero_float_precision_rounds_the_decimal_form(): void
@@ -225,7 +225,7 @@ public function test_divide_under_a_zero_float_precision_rounds_the_decimal_form
try {
ini_set('precision', '0');
- static::assertSame(0.67, (new Calculator())->divide(1.5, 3, 2, Rounding::HALF_UP));
+ static::assertSame(0.67, new Calculator()->divide(1.5, 3, 2, Rounding::HALF_UP));
} finally {
ini_set('precision', $precision);
}
@@ -262,7 +262,7 @@ public function test_modulus(string|int $a, string|int $b, int|float $output): v
assert(is_numeric($b), 'String parameter $b must be numeric');
}
- static::assertSame($output, (new Calculator())->modulus($a, $b));
+ static::assertSame($output, new Calculator()->modulus($a, $b));
}
#[TestWith(['2', '3', 6.0])]
@@ -284,7 +284,7 @@ public function test_multiply(string|int|float $a, string|int|float $b, int|floa
assert(is_numeric($b), 'String parameter $b must be numeric');
}
- static::assertSame($output, (new Calculator())->multiply($a, $b));
+ static::assertSame($output, new Calculator()->multiply($a, $b));
}
#[TestWith(['1', '1', 1.0])]
@@ -308,7 +308,7 @@ public function test_power(string|int|float $a, string|int $b, int|float $output
assert(is_numeric($b), 'String parameter $b must be numeric');
}
- static::assertSame($output, (new Calculator())->power($a, $b));
+ static::assertSame($output, new Calculator()->power($a, $b));
}
#[TestWith(['1', '1', 0.0])]
@@ -336,7 +336,7 @@ public function test_subtract(string|int|float $a, string|int|float $b, int|floa
assert(is_numeric($b), 'String parameter $b must be numeric');
}
- static::assertSame($output, (new Calculator())->subtract($a, $b));
+ static::assertSame($output, new Calculator()->subtract($a, $b));
}
public function test_divide_answers_the_decimal_division_at_every_rounding_edge(): void
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Calculator/RunningSumTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Calculator/RunningSumTest.php
index 1604b0f7b1..a1b8db2fd8 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Calculator/RunningSumTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Calculator/RunningSumTest.php
@@ -18,7 +18,7 @@ final class RunningSumTest extends TestCase
{
public function test_empty_partial_is_the_partial_of_a_fresh_sum(): void
{
- static::assertSame(RunningSum::emptyPartial(), (new RunningSum())->partial());
+ static::assertSame(RunningSum::emptyPartial(), new RunningSum()->partial());
static::assertSame(0, RunningSum::fromPartial(RunningSum::emptyPartial())->value());
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Clock/HighResolutionTimeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Clock/HighResolutionTimeTest.php
index efea6ccfb5..5ac452fb86 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Clock/HighResolutionTimeTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Clock/HighResolutionTimeTest.php
@@ -70,7 +70,7 @@ public function test_now_reads_the_monotonic_clock_into_seconds_and_nanoseconds(
public function test_to_string_shows_every_nanosecond_by_default(): void
{
- static::assertSame('1.123456789s', (new HighResolutionTime(1, 123456789))->toString());
+ static::assertSame('1.123456789s', new HighResolutionTime(1, 123456789)->toString());
}
public function test_to_formatted_string_removes_trailing_zeroes(): void
@@ -90,7 +90,7 @@ public function test_to_formatted_string_removes_trailing_zeroes(): void
public function test_to_string_keeps_every_nanosecond_of_a_large_second_count(): void
{
- static::assertSame('1073741824.123456789s', (new HighResolutionTime(1_073_741_824, 123_456_789))->toString());
+ static::assertSame('1073741824.123456789s', new HighResolutionTime(1_073_741_824, 123_456_789)->toString());
}
#[TestWith([10, 'Precision must be between 0 and 9, got 10.'])]
@@ -100,7 +100,7 @@ public function test_to_string_refuses_a_precision_outside_zero_to_nine(int $pre
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage($message);
- (new HighResolutionTime(1, 5))->toString($precision);
+ new HighResolutionTime(1, 5)->toString($precision);
}
#[TestWith([1, 123_456_789, 3, '1.123s'])]
@@ -116,11 +116,11 @@ public function test_to_string_rounds_half_up_to_the_precision(
int $precision,
string $expected,
): void {
- static::assertSame($expected, (new HighResolutionTime($seconds, $nanoseconds))->toString($precision));
+ static::assertSame($expected, new HighResolutionTime($seconds, $nanoseconds)->toString($precision));
}
public function test_to_string_of_a_negative_time_keeps_its_sign(): void
{
- static::assertSame('-0.5s', (new HighResolutionTime(-1, 500_000_000))->toString());
+ static::assertSame('-0.5s', new HighResolutionTime(-1, 500_000_000)->toString());
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/ConfiguredFilesystemTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/ConfiguredFilesystemTest.php
index 5d643704fa..1595d1fdeb 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/ConfiguredFilesystemTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/ConfiguredFilesystemTest.php
@@ -16,7 +16,7 @@ final class ConfiguredFilesystemTest extends FlowTestCase
{
public function test_a_configurable_filesystem_round_trips_as_a_secret(): void
{
- $description = (new ConfiguredFilesystem(new NativeLocalFilesystem()))->describe();
+ $description = new ConfiguredFilesystem(new NativeLocalFilesystem())->describe();
static::assertNotNull($description);
static::assertTrue($description->sensitive());
@@ -29,13 +29,13 @@ public function test_a_configurable_filesystem_round_trips_as_a_secret(): void
);
static::assertEquals(
new NativeLocalFilesystem(),
- (new Rebuild())->of($description->normalize(), ConfiguredFilesystem::class)->filesystem(),
+ new Rebuild()->of($description->normalize(), ConfiguredFilesystem::class)->filesystem(),
);
}
public function test_a_filesystem_with_live_state_does_not_describe(): void
{
- static::assertNull((new ConfiguredFilesystem(new MemoryFilesystem()))->describe());
+ static::assertNull(new ConfiguredFilesystem(new MemoryFilesystem())->describe());
}
public function test_a_class_that_is_not_a_filesystem_is_refused(): void
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/DescribableRoundTripTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/DescribableRoundTripTest.php
index 54c8e04287..1e22ec675e 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/DescribableRoundTripTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/DescribableRoundTripTest.php
@@ -6,7 +6,6 @@
use Flow\ETL\Foundation\Describe\Describable;
use Flow\ETL\Foundation\Exception\InvalidArgumentException;
-use Flow\ETL\Foundation\Exception\RequiredPHPVersionException;
use Flow\ETL\Foundation\Exception\RuntimeException;
use Flow\ETL\Tests\Context\DescribableFixtures;
use Flow\ETL\Tests\Context\DescribeRoundTrip;
@@ -56,11 +55,7 @@ public function test_a_rebuilt_describable_equals_the_described_one(string $clas
$this->expectException(RuntimeException::class);
}
- try {
- $describable = DescribableFixtures::all()[$class]();
- } catch (RequiredPHPVersionException $e) {
- static::markTestSkipped($e->getMessage());
- }
+ $describable = DescribableFixtures::all()[$class]();
if (in_array($class, DescribableFixtures::undescribable(), true)) {
static::assertNull($describable->describe());
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/DescriptionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/DescriptionTest.php
index 90bb2b89f8..7d9dc381d9 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/DescriptionTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/DescriptionTest.php
@@ -18,15 +18,15 @@ public function test_a_description_is_sensitive_when_any_nested_description_is()
{
$secret = new Description(Described::class, ['token' => 'x'], secret: true);
- static::assertFalse((new Description(Described::class, ['a' => 1]))->sensitive());
- static::assertTrue((new Description(Described::class, ['nested' => ['deep' => [$secret]]]))->sensitive());
+ static::assertFalse(new Description(Described::class, ['a' => 1])->sensitive());
+ static::assertTrue(new Description(Described::class, ['nested' => ['deep' => [$secret]]])->sensitive());
}
public function test_normalize_nests_descriptions_and_reports_the_derived_secrecy(): void
{
- $normalized = (new Description(Described::class, [
+ $normalized = new Description(Described::class, [
'nested' => new Description(Described::class, ['v' => 1], secret: true),
- ]))->normalize();
+ ])->normalize();
static::assertSame(
[
@@ -47,19 +47,19 @@ public function test_extensions_union_nested_descriptions_sorted_and_unique(): v
);
static::assertSame(['snappy', 'zlib'], $description?->extensions());
- static::assertSame([], (new Description(Described::class, ['a' => 1]))->extensions());
+ static::assertSame([], new Description(Described::class, ['a' => 1])->extensions());
}
public function test_normalize_does_not_carry_extensions_or_settings(): void
{
static::assertSame(
['class' => Described::class, 'secret' => false, 'data' => ['a' => 1]],
- (new Description(
+ new Description(
Described::class,
['a' => 1],
extensions: ['zlib'],
settings: ['precision' => '17'],
- ))->normalize(),
+ )->normalize(),
);
}
@@ -90,11 +90,11 @@ public function test_two_descriptions_declaring_different_values_for_one_setting
. ' declares it as "14"',
);
- (new Description(
+ new Description(
Described::class,
['nested' => new Description(NotDescribed::class, [], settings: ['precision' => '14'])],
settings: ['precision' => '17'],
- ))->settings();
+ )->settings();
}
public function test_from_array_does_not_recurse_into_data(): void
@@ -128,11 +128,11 @@ public function test_debug_info_redacts_sensitive_data(): void
{
static::assertSame(
['class' => Described::class, 'secret' => true, 'data' => '[redacted]'],
- (new Description(Described::class, ['token' => 'x'], secret: true))->__debugInfo(),
+ new Description(Described::class, ['token' => 'x'], secret: true)->__debugInfo(),
);
static::assertSame(
['class' => Described::class, 'secret' => false, 'data' => ['a' => 1]],
- (new Description(Described::class, ['a' => 1]))->__debugInfo(),
+ new Description(Described::class, ['a' => 1])->__debugInfo(),
);
}
@@ -140,8 +140,8 @@ public function test_compose_replaces_nested_describables(): void
{
static::assertEquals(
new Description(Described::class, [
- 'a' => (new Described('x'))->describe(),
- 'list' => [(new Described('y'))->describe()],
+ 'a' => new Described('x')->describe(),
+ 'list' => [new Described('y')->describe()],
]),
Description::compose(Described::class, ['a' => new Described('x'), 'list' => [new Described('y')]]),
);
@@ -216,14 +216,14 @@ public function test_extensions_keep_every_nested_description(): void
{
static::assertSame(
['apcu', 'snappy', 'zlib'],
- (new Description(
+ new Description(
Described::class,
[
'a' => new Description(Described::class, [], extensions: ['snappy']),
'b' => new Description(Described::class, [], extensions: ['zlib']),
],
extensions: ['apcu'],
- ))->extensions(),
+ )->extensions(),
);
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/RebuildTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/RebuildTest.php
index 9c49f033c1..536ccc8941 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/RebuildTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/RebuildTest.php
@@ -42,7 +42,7 @@ public function test_an_unknown_class_is_refused(): void
/** @var class-string $class */
$class = 'Flow\\Nope\\Missing';
- (new Rebuild())->object(new Description($class, []), Describable::class);
+ new Rebuild()->object(new Description($class, []), Describable::class);
}
public function test_a_class_that_is_none_of_the_three_kinds_is_refused(): void
@@ -50,7 +50,7 @@ public function test_a_class_that_is_none_of_the_three_kinds_is_refused(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Flow\\ETL\\Foundation\\Describe\\Rebuild is not Describable');
- (new Rebuild())->object(new Description(Rebuild::class, []), Describable::class);
+ new Rebuild()->object(new Description(Rebuild::class, []), Describable::class);
}
public function test_an_interface_name_is_refused(): void
@@ -58,7 +58,7 @@ public function test_an_interface_name_is_refused(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Flow\\ETL\\Foundation\\Describe\\Describable is not a concrete class');
- (new Rebuild())->object(new Description(Describable::class, []), Describable::class);
+ new Rebuild()->object(new Description(Describable::class, []), Describable::class);
}
public function test_the_wrong_type_is_refused(): void
@@ -68,14 +68,14 @@ public function test_the_wrong_type_is_refused(): void
'Flow\\ETL\\Tests\\Double\\Described is not a Flow\\ETL\\Foundation\\Describe\\ConfiguredFilesystem',
);
- (new Rebuild())->object((new Described('x'))->describe(), ConfiguredFilesystem::class);
+ new Rebuild()->object(new Described('x')->describe(), ConfiguredFilesystem::class);
}
public function test_a_describable_is_rebuilt_from_its_description(): void
{
static::assertEquals(
new Described('x'),
- (new Rebuild())->object((new Described('x'))->describe(), Described::class),
+ new Rebuild()->object(new Described('x')->describe(), Described::class),
);
}
@@ -83,15 +83,15 @@ public function test_of_rebuilds_a_normalized_description(): void
{
static::assertEquals(
new Described('x'),
- (new Rebuild())->of((new Described('x'))->describe()->normalize(), Described::class),
+ new Rebuild()->of(new Described('x')->describe()->normalize(), Described::class),
);
}
public function test_all_keeps_keys(): void
{
- $rebuilt = (new Rebuild())->all([
- 'first' => (new Described('a'))->describe()->normalize(),
- 7 => (new Described('b'))->describe()->normalize(),
+ $rebuilt = new Rebuild()->all([
+ 'first' => new Described('a')->describe()->normalize(),
+ 7 => new Described('b')->describe()->normalize(),
], Described::class);
static::assertEquals(['first' => new Described('a'), 7 => new Described('b')], $rebuilt);
@@ -101,19 +101,19 @@ public function test_of_refuses_a_non_array(): void
{
$this->expectException(InvalidTypeException::class);
- (new Rebuild())->of('not a description', Described::class);
+ new Rebuild()->of('not a description', Described::class);
}
public function test_progress_is_void_by_default(): void
{
- static::assertInstanceOf(VoidProgress::class, (new Rebuild())->progress(StageName::sort));
+ static::assertInstanceOf(VoidProgress::class, new Rebuild()->progress(StageName::sort));
}
public function test_progress_is_bound_by_the_given_stages(): void
{
$spy = new ProgressSpy();
- (new Rebuild($spy))->progress(StageName::join);
+ new Rebuild($spy)->progress(StageName::join);
static::assertSame(['join'], $spy->stages());
}
@@ -121,16 +121,16 @@ public function test_progress_is_bound_by_the_given_stages(): void
public function test_progress_from_a_stage_description_reports_into_its_id(): void
{
$spy = new ProgressSpy();
- (new Rebuild($spy))->progress(
+ new Rebuild($spy)->progress(
StageName::sort,
- (new HeartbeatStage(
+ new HeartbeatStage(
StageName::sort,
ProgressUnit::rows,
7,
'memory://in/x.floe',
- (new HeartbeatContext())->throttle(new ScheduledHeartbeat(new RecordingHeartbeat(), 1)),
+ new HeartbeatContext()->throttle(new ScheduledHeartbeat(new RecordingHeartbeat(), 1)),
0,
- ))
+ )
->describe()
?->normalize(),
);
@@ -142,8 +142,8 @@ public function test_progress_without_a_description_is_a_new_stage_of_the_name()
{
$spy = new ProgressSpy();
- (new Rebuild($spy))->progress(StageName::group_by);
- (new Rebuild($spy))->progress(StageName::sort, (new VoidProgress())->describe()?->normalize());
+ new Rebuild($spy)->progress(StageName::group_by);
+ new Rebuild($spy)->progress(StageName::sort, new VoidProgress()->describe()?->normalize());
static::assertSame(
[
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Exception/CorruptedRecordExceptionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Exception/CorruptedRecordExceptionTest.php
index 5819ecb83c..479ac92757 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Exception/CorruptedRecordExceptionTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Exception/CorruptedRecordExceptionTest.php
@@ -20,7 +20,7 @@ public function test_the_message_names_the_record_where_it_is_why_and_the_way_ou
static::assertSame(
'Corrupted record at offset 12, line 3, of file:///a.csv: 3 fields, the header has 2: "1,a,x". Route '
. 'corrupted records to a loader with ->withCorruptedRecords($loader).',
- (new CorruptedRecordException('file:///a.csv', 12, 3, '3 fields, the header has 2', '1,a,x'))->getMessage(),
+ new CorruptedRecordException('file:///a.csv', 12, 3, '3 fields, the header has 2', '1,a,x')->getMessage(),
);
}
@@ -31,7 +31,7 @@ public function test_a_record_without_a_line_or_a_uri_and_too_long_to_show_whole
. str_repeat('ü', 120)
. '…". Route corrupted '
. 'records to a loader with ->withCorruptedRecords($loader).',
- (new CorruptedRecordException(null, 4, null, 'reason', str_repeat('ü', 121)))->getMessage(),
+ new CorruptedRecordException(null, 4, null, 'reason', str_repeat('ü', 121))->getMessage(),
);
}
@@ -42,7 +42,7 @@ public function test_a_record_of_exactly_the_shown_length_is_shown_whole(): void
. str_repeat('ü', 120)
. '". Route corrupted '
. 'records to a loader with ->withCorruptedRecords($loader).',
- (new CorruptedRecordException(null, 4, null, 'reason', str_repeat('ü', 120)))->getMessage(),
+ new CorruptedRecordException(null, 4, null, 'reason', str_repeat('ü', 120))->getMessage(),
);
}
@@ -53,7 +53,7 @@ public function test_a_too_long_record_is_shown_from_its_first_character(): void
. str_repeat('ü', 119)
. '…". Route corrupted '
. 'records to a loader with ->withCorruptedRecords($loader).',
- (new CorruptedRecordException(null, 4, null, 'reason', 'a' . str_repeat('ü', 120)))->getMessage(),
+ new CorruptedRecordException(null, 4, null, 'reason', 'a' . str_repeat('ü', 120))->getMessage(),
);
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Exception/RequiredPHPVersionExceptionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Exception/RequiredPHPVersionExceptionTest.php
deleted file mode 100644
index c8c78fb22e..0000000000
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Exception/RequiredPHPVersionExceptionTest.php
+++ /dev/null
@@ -1,24 +0,0 @@
-getMessage(),
- );
- static::assertSame($previous, $exception->getPrevious());
- }
-}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Exception/SchemaDefinitionNotFoundExceptionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Exception/SchemaDefinitionNotFoundExceptionTest.php
index 40e4dd790b..dfd5071731 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Exception/SchemaDefinitionNotFoundExceptionTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Exception/SchemaDefinitionNotFoundExceptionTest.php
@@ -25,7 +25,7 @@ public function test_the_single_argument_form_keeps_its_message(): void
{
static::assertSame(
'Schema definition for column "scoree" not found.',
- (new SchemaDefinitionNotFoundException('scoree'))->getMessage(),
+ new SchemaDefinitionNotFoundException('scoree')->getMessage(),
);
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Exception/SchemaMismatchExceptionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Exception/SchemaMismatchExceptionTest.php
index 483de23ffc..16c54aa4b7 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Exception/SchemaMismatchExceptionTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Exception/SchemaMismatchExceptionTest.php
@@ -14,14 +14,14 @@ public function test_it_keeps_the_row_violation_as_the_cause(): void
{
$cause = ColumnMismatchException::unexpectedColumn('extra');
- static::assertSame($cause, (new SchemaMismatchException(2, $cause))->getPrevious());
+ static::assertSame($cause, new SchemaMismatchException(2, $cause)->getPrevious());
}
public function test_it_places_a_column_violation_at_its_row(): void
{
static::assertSame(
'Rows do not match their schema: column "extra" (row 2) is not declared by the schema',
- (new SchemaMismatchException(2, ColumnMismatchException::unexpectedColumn('extra')))->getMessage(),
+ new SchemaMismatchException(2, ColumnMismatchException::unexpectedColumn('extra'))->getMessage(),
);
}
@@ -29,11 +29,11 @@ public function test_it_places_a_value_violation_at_its_row(): void
{
static::assertSame(
'Rows do not match their schema: column "code" (row 1): could not convert 1000 (integer) to string',
- (new SchemaMismatchException(1, ColumnMismatchException::valueDoesNotMatch(
+ new SchemaMismatchException(1, ColumnMismatchException::valueDoesNotMatch(
'code',
'string',
1000,
- )))->getMessage(),
+ ))->getMessage(),
);
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Exception/SchemaValidationExceptionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Exception/SchemaValidationExceptionTest.php
index a8430f4d09..d92bdd8ed4 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Exception/SchemaValidationExceptionTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Exception/SchemaValidationExceptionTest.php
@@ -57,12 +57,12 @@ public function test_diff_message_renders_nullable_marker_on_expected_type(): vo
{
static::assertStringContainsString(
'expected: deleted_at, given: deleted_at',
- (new SchemaValidationException(
+ new SchemaValidationException(
schema_validate(
schema(datetime_schema('deleted_at', nullable: true)),
schema(integer_schema('deleted_at')),
)->toString(),
- ))->getMessage(),
+ )->getMessage(),
);
}
@@ -70,7 +70,7 @@ public function test_the_message_prefixes_the_mismatches(): void
{
static::assertSame(
"Schema validation failed: \n Unexpected Definitions: \n",
- (new SchemaValidationException(" Unexpected Definitions: \n"))->getMessage(),
+ new SchemaValidationException(" Unexpected Definitions: \n")->getMessage(),
);
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/FlowPhpExtensionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/FlowPhpExtensionTest.php
index 400253b1d5..17d34a9501 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/FlowPhpExtensionTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/FlowPhpExtensionTest.php
@@ -14,12 +14,12 @@ final class FlowPhpExtensionTest extends TestCase
{
public function test_an_extension_that_is_not_loaded_is_not_available(): void
{
- static::assertFalse((new FlowPhpExtension(false, null))->available());
+ static::assertFalse(new FlowPhpExtension(false, null)->available());
}
public function test_a_loaded_extension_of_the_expected_abi_is_available(): void
{
- static::assertTrue((new FlowPhpExtension(true, FlowPhpExtension::ABI))->available());
+ static::assertTrue(new FlowPhpExtension(true, FlowPhpExtension::ABI)->available());
}
public function test_a_loaded_extension_of_another_abi_is_refused(): void
@@ -34,7 +34,7 @@ public function test_a_loaded_extension_of_another_abi_is_refused(): void
. 'flow_php to the version of flow-php/etl, or stop loading it to use the PHP implementation.',
);
- (new FlowPhpExtension(true, FlowPhpExtension::ABI + 1, '0.46.0'))->available();
+ new FlowPhpExtension(true, FlowPhpExtension::ABI + 1, '0.46.0')->available();
}
public function test_a_loaded_extension_without_an_abi_is_refused(): void
@@ -42,7 +42,7 @@ public function test_a_loaded_extension_without_an_abi_is_refused(): void
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('The loaded flow_php extension (0.44.1, ABI none) does not match flow-php/etl');
- (new FlowPhpExtension(true, null, '0.44.1'))->available();
+ new FlowPhpExtension(true, null, '0.44.1')->available();
}
public function test_detect_reports_whether_flow_php_is_loaded(): void
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/NativePHPRandomValueGeneratorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/NativePHPRandomValueGeneratorTest.php
index 71c4c77c40..12fea028d1 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/NativePHPRandomValueGeneratorTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/NativePHPRandomValueGeneratorTest.php
@@ -44,9 +44,9 @@ public static function valid_range_provider(): array
public function test_can_create_random_int_from_given_range(): void
{
- static::assertSame(1, (new NativePHPRandomValueGenerator())->int(1, 1));
+ static::assertSame(1, new NativePHPRandomValueGenerator()->int(1, 1));
static::assertThat(
- (new NativePHPRandomValueGenerator())->int(1, 2),
+ new NativePHPRandomValueGenerator()->int(1, 2),
static::logicalOr(static::equalTo(1), static::equalTo(2)),
);
}
@@ -54,27 +54,27 @@ public function test_can_create_random_int_from_given_range(): void
#[DataProvider('integers_provider')]
public function test_can_create_random_string_with_given_length(int $expectedLength): void
{
- static::assertSame($expectedLength, mb_strlen((new NativePHPRandomValueGenerator())->string($expectedLength)));
+ static::assertSame($expectedLength, mb_strlen(new NativePHPRandomValueGenerator()->string($expectedLength)));
}
public function test_empty_string_on_length_below_1(): void
{
- static::assertSame('', (new NativePHPRandomValueGenerator())->string(0));
- static::assertSame('', (new NativePHPRandomValueGenerator())->string(-1));
+ static::assertSame('', new NativePHPRandomValueGenerator()->string(0));
+ static::assertSame('', new NativePHPRandomValueGenerator()->string(-1));
}
#[DataProvider('invalid_range_provider')]
public function test_fail_on_invalid_range(int $min, int $max): void
{
self::expectException(ValueError::class);
- (new NativePHPRandomValueGenerator())->int($min, $max);
+ new NativePHPRandomValueGenerator()->int($min, $max);
}
#[DataProvider('valid_range_provider')]
public function test_return_random_int_on_valid_range(int $min, int $max): void
{
static::assertThat(
- (new NativePHPRandomValueGenerator())->int($min, $max),
+ new NativePHPRandomValueGenerator()->int($min, $max),
static::logicalOr(static::greaterThanOrEqual($min), static::lessThanOrEqual($max)),
);
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/SimilarNamesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/SimilarNamesTest.php
index 48133cde71..ae20c4bc4d 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/SimilarNamesTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/SimilarNamesTest.php
@@ -11,47 +11,44 @@ final class SimilarNamesTest extends FlowTestCase
{
public function test_a_candidate_containing_the_searched_name_is_always_close(): void
{
- static::assertSame(
- ['region_code'],
- (new SimilarNames())->closestTo('region', ['month', 'sales', 'region_code']),
- );
+ static::assertSame(['region_code'], new SimilarNames()->closestTo('region', ['month', 'sales', 'region_code']));
}
public function test_an_empty_candidate_list_stays_empty(): void
{
- static::assertSame([], (new SimilarNames())->closestTo('id', []));
+ static::assertSame([], new SimilarNames()->closestTo('id', []));
}
public function test_nothing_close_enough_suggests_nothing(): void
{
- static::assertSame([], (new SimilarNames())->closestTo('nope', ['id', 'seller', 'amount']));
+ static::assertSame([], new SimilarNames()->closestTo('nope', ['id', 'seller', 'amount']));
}
public function test_a_candidate_a_third_of_the_name_away_or_more_is_not_close(): void
{
- static::assertSame([], (new SimilarNames())->closestTo('abcdef', ['abcxyz']));
+ static::assertSame([], new SimilarNames()->closestTo('abcdef', ['abcxyz']));
}
public function test_the_cap_is_configurable(): void
{
- static::assertSame(['scorea'], (new SimilarNames())->closestTo('score', ['scorea', 'scoreb'], 1));
+ static::assertSame(['scorea'], new SimilarNames()->closestTo('score', ['scorea', 'scoreb'], 1));
}
public function test_the_closest_candidate_comes_first(): void
{
static::assertSame(
['score', 'scoreid'],
- (new SimilarNames())->closestTo('scoree', ['scoreid', 'score', 'name', 'id']),
+ new SimilarNames()->closestTo('scoree', ['scoreid', 'score', 'name', 'id']),
);
}
public function test_the_list_is_capped(): void
{
- static::assertCount(3, (new SimilarNames())->closestTo('score', ['scorea', 'scoreb', 'scorec', 'scored']));
+ static::assertCount(3, new SimilarNames()->closestTo('score', ['scorea', 'scoreb', 'scorec', 'scored']));
}
public function test_a_typo_finds_its_column(): void
{
- static::assertSame(['score'], (new SimilarNames())->closestTo('scoree', ['id', 'score', 'name']));
+ static::assertSame(['score'], new SimilarNames()->closestTo('scoree', ['id', 'score', 'name']));
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Telemetry/TelemetryAttributesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Telemetry/TelemetryAttributesTest.php
index 82d9359b22..ea5eab1d66 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Telemetry/TelemetryAttributesTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Telemetry/TelemetryAttributesTest.php
@@ -13,7 +13,7 @@ final class TelemetryAttributesTest extends FlowTestCase
public function test_all_custom_keys_use_the_flow_etl_prefix(): void
{
// @mago-expect analysis:mixed-assignment
- foreach ((new ReflectionClass(TelemetryAttributes::class))->getConstants() as $name => $value) {
+ foreach (new ReflectionClass(TelemetryAttributes::class)->getConstants() as $name => $value) {
static::assertIsString($value);
static::assertStringStartsWith(
'flow.etl.',
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/VoidProgressTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/VoidProgressTest.php
index bca6565520..ef658fb340 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/VoidProgressTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/VoidProgressTest.php
@@ -42,7 +42,7 @@ public function test_busy_and_done_do_nothing(): void
public function test_describes_as_itself(): void
{
- static::assertEquals(Description::compose(VoidProgress::class, []), (new VoidProgress())->describe());
+ static::assertEquals(Description::compose(VoidProgress::class, []), new VoidProgress()->describe());
}
public function test_counts_in_does_nothing(): void
@@ -56,6 +56,6 @@ public function test_counts_in_does_nothing(): void
public function test_nobody_listens_to_it(): void
{
- static::assertNull((new VoidProgress())->reportsEverySeconds());
+ static::assertNull(new VoidProgress()->reportsEverySeconds());
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllAggregatesDeclareTheirTypeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllAggregatesDeclareTheirTypeTest.php
index 8369e6a467..b8d5907921 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllAggregatesDeclareTheirTypeTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllAggregatesDeclareTheirTypeTest.php
@@ -85,7 +85,7 @@ public function test_every_producer_declares_and_round_trips(): void
$bare = 0;
foreach ($factories as $class => $factory) {
- $returns = (new ReferenceResolver())
+ $returns = new ReferenceResolver()
->resolve($factory(), self::inputSchema())
->returns();
definition_from_type('out', $returns);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllAggregatorsPartialTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllAggregatorsPartialTest.php
index df23ef69c4..404c893434 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllAggregatorsPartialTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllAggregatorsPartialTest.php
@@ -68,16 +68,16 @@ public function test_partials_merged_in_order_equal_one_pass(string $class): voi
$merged = AggregatorFixtures::resolved($class);
foreach ([[0, 1], [2, 3], [4, 5]] as $part => $indices) {
- $aggregator = (new Aggregators(AggregatorFixtures::resolved($class)))->fresh()->first();
+ $aggregator = new Aggregators(AggregatorFixtures::resolved($class))->fresh()->first();
$aggregator->aggregate($rows, $indices, $context->backend());
$schema = schema(structure_schema('partial', $aggregator->partialType()));
$path = $scratch->suffix('part-' . $part . '.floe');
- $writer = (new FloeFiles($filesystem, new PhpBackend()))->create($path, $schema);
+ $writer = new FloeFiles($filesystem, new PhpBackend())->create($path, $schema);
$writer->write(array_to_rows([['partial' => $aggregator->partial()]], $schema));
$writer->close();
- foreach ((new FloeFiles($filesystem, new PhpBackend()))
+ foreach (new FloeFiles($filesystem, new PhpBackend())
->read($path)
->rows() as $batch) {
$merged->merge(
@@ -118,7 +118,7 @@ public function test_fresh_has_no_state(AggregatingFunction $aggregator): void
$untouched = $aggregator->withChildren($aggregator->children());
$aggregator->aggregate(AggregatorFixtures::rows(new PhpBackend()), range(0, 5), flow_context()->backend());
- $fresh = (new Aggregators($aggregator))->fresh()->first();
+ $fresh = new Aggregators($aggregator)->fresh()->first();
static::assertNotSame($aggregator, $fresh);
static::assertSame(var_export($untouched->value(), true), var_export($fresh->value(), true));
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllFunctionsDeclareTheirDeterminismTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllFunctionsDeclareTheirDeterminismTest.php
index 0f8855d893..03f0e69660 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllFunctionsDeclareTheirDeterminismTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllFunctionsDeclareTheirDeterminismTest.php
@@ -5,7 +5,6 @@
namespace Flow\ETL\Tests\Unit\Functions;
use DateTimeImmutable;
-use Flow\ETL\Foundation\Exception\RequiredPHPVersionException;
use Flow\ETL\Functions\CallUserFunc;
use Flow\ETL\Functions\Now;
use Flow\ETL\Functions\RandomString;
@@ -44,14 +43,8 @@ public static function scalar_functions_provider(): Generator
#[DataProvider('scalar_functions_provider')]
public function test_every_scalar_function_is_deterministic_except_the_declared_generators(string $class): void
{
- try {
- $function = ScalarFunctionFixtures::instance($class);
- } catch (RequiredPHPVersionException $e) {
- static::markTestSkipped($e->getMessage());
- }
-
ScalarFunctionContract::declaresDeterminism(
- $function,
+ ScalarFunctionFixtures::instance($class),
!in_array(
$class,
[
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllFunctionsDeclareTheirTypeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllFunctionsDeclareTheirTypeTest.php
index 7a310272be..5e0e052a6e 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllFunctionsDeclareTheirTypeTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllFunctionsDeclareTheirTypeTest.php
@@ -4,7 +4,6 @@
namespace Flow\ETL\Tests\Unit\Functions;
-use Flow\ETL\Foundation\Exception\RequiredPHPVersionException;
use Flow\ETL\Functions\All;
use Flow\ETL\Functions\Any;
use Flow\ETL\Functions\ArrayGetCollection;
@@ -65,7 +64,6 @@
use PHPUnit\Framework\Attributes\DataProvider;
use function array_diff;
-use function array_intersect;
use function array_keys;
use function array_values;
use function Flow\Types\DSL\type_is_nullable;
@@ -178,16 +176,10 @@ public function test_the_fixture_schema_is_entirely_nullable(): void
#[DataProvider('declaring_classes_provider')]
public function test_every_function_answers_returns_with_a_column_representable_type(string $class): void
{
- try {
- $function = ScalarFunctionFixtures::instance($class);
- } catch (RequiredPHPVersionException $e) {
- static::markTestSkipped($e->getMessage());
- }
-
$expected = ScalarFunctionFixtures::expectedReturns($class);
static::assertNotNull($expected);
- ScalarFunctionContract::returnsItsDeclaredType($function, $expected);
+ ScalarFunctionContract::returnsItsDeclaredType(ScalarFunctionFixtures::instance($class), $expected);
}
/**
@@ -196,27 +188,21 @@ public function test_every_function_answers_returns_with_a_column_representable_
#[DataProvider('declaring_classes_provider')]
public function test_with_children_round_trips(string $class): void
{
- try {
- $fn = ScalarFunctionFixtures::instance($class);
- } catch (RequiredPHPVersionException $e) {
- static::markTestSkipped($e->getMessage());
- }
-
- ScalarFunctionContract::withChildrenRoundTrips($fn);
+ ScalarFunctionContract::withChildrenRoundTrips(ScalarFunctionFixtures::instance($class));
}
public function test_exactly_49_of_the_128_declare_themselves_nullable(): void
{
- [$nullable, $notNull, $unavailable] = ScalarFunctionFixtures::nullabilitySplit();
+ [$nullable, $notNull] = ScalarFunctionFixtures::nullabilitySplit();
static::assertCount(128, ScalarFunctionClasses::declaring(ExtractorClasses::root('core/etl')));
static::assertCount(49, self::declared_nullable_classes());
static::assertCount(
49,
- [...$nullable, ...array_intersect($unavailable, self::declared_nullable_classes())],
+ $nullable,
'nullable set drifted: ' . implode(', ', array_diff($nullable, self::declared_nullable_classes())),
);
- static::assertCount(79, [...$notNull, ...array_diff($unavailable, self::declared_nullable_classes())]);
+ static::assertCount(79, $notNull);
}
/**
@@ -225,34 +211,27 @@ public function test_exactly_49_of_the_128_declare_themselves_nullable(): void
#[DataProvider('declared_nullable_provider')]
public function test_the_nullable_set_is_exactly_the_declared_49(string $class): void
{
- try {
- $function = ScalarFunctionFixtures::instance($class);
- } catch (RequiredPHPVersionException $e) {
- static::markTestSkipped($e->getMessage());
- }
-
$expected = ScalarFunctionFixtures::expectedReturns($class);
static::assertNotNull($expected);
static::assertTrue(type_is_nullable($expected));
- ScalarFunctionContract::returnsItsDeclaredType($function, $expected);
+ ScalarFunctionContract::returnsItsDeclaredType(ScalarFunctionFixtures::instance($class), $expected);
}
public function test_the_not_null_set_is_the_complement(): void
{
- [$nullable, $notNull, $unavailable] = ScalarFunctionFixtures::nullabilitySplit();
+ [$nullable, $notNull] = ScalarFunctionFixtures::nullabilitySplit();
$expectedNotNull = array_values(array_diff(
ScalarFunctionClasses::declaring(ExtractorClasses::root('core/etl')),
self::declared_nullable_classes(),
- $unavailable,
));
sort($expectedNotNull);
sort($notNull);
static::assertSame($expectedNotNull, $notNull);
- $expectedNullable = array_values(array_diff(self::declared_nullable_classes(), $unavailable));
+ $expectedNullable = self::declared_nullable_classes();
sort($expectedNullable);
sort($nullable);
@@ -263,6 +242,6 @@ public function test_an_unresolved_reference_refuses_to_describe_itself(): void
{
$this->expectExceptionMessage('Invalid call to returns() on unresolved reference');
- (new UnresolvedReference('a'))->returns();
+ new UnresolvedReference('a')->returns();
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllFunctionsDescribeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllFunctionsDescribeTest.php
index c271b4505b..2988efb2fc 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllFunctionsDescribeTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllFunctionsDescribeTest.php
@@ -4,7 +4,6 @@
namespace Flow\ETL\Tests\Unit\Functions;
-use Flow\ETL\Foundation\Exception\RequiredPHPVersionException;
use Flow\ETL\Functions\ScalarFunction;
use Flow\ETL\Tests\Context\ExtractorClasses;
use Flow\ETL\Tests\Context\ScalarFunctionClasses;
@@ -34,13 +33,7 @@ public static function functions(): Generator
#[DataProvider('functions')]
public function test_every_function_round_trips(string $class): void
{
- try {
- $function = ScalarFunctionFixtures::instance($class);
- } catch (RequiredPHPVersionException $e) {
- static::markTestSkipped($e->getMessage());
- }
-
- ScalarFunctionContract::describesItself($function, self::undescribable());
+ ScalarFunctionContract::describesItself(ScalarFunctionFixtures::instance($class), self::undescribable());
}
public function test_only_dom_literals_refuse_to_describe(): void
@@ -48,13 +41,7 @@ public function test_only_dom_literals_refuse_to_describe(): void
$refusing = [];
foreach (ScalarFunctionClasses::all(ExtractorClasses::root('core/etl')) as $class) {
- try {
- $function = ScalarFunctionFixtures::instance($class);
- } catch (RequiredPHPVersionException) {
- continue;
- }
-
- if ($function->describe() === null) {
+ if (ScalarFunctionFixtures::instance($class)->describe() === null) {
$refusing[] = $class;
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllFunctionsEvaluateOnTheConfiguredBackendTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllFunctionsEvaluateOnTheConfiguredBackendTest.php
index 89198b82a4..4ebbca9c5f 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllFunctionsEvaluateOnTheConfiguredBackendTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllFunctionsEvaluateOnTheConfiguredBackendTest.php
@@ -4,7 +4,6 @@
namespace Flow\ETL\Tests\Unit\Functions;
-use Flow\ETL\Foundation\Exception\RequiredPHPVersionException;
use Flow\ETL\Functions\ScalarFunction;
use Flow\ETL\Tests\Context\ScalarFunctionContract;
use Flow\ETL\Tests\Context\ScalarFunctionFixtures;
@@ -32,15 +31,11 @@ public static function functions(): Generator
#[DataProvider('functions')]
public function test_a_function_gives_the_same_values_and_a_column_of_the_configured_backend(string $class): void
{
- try {
- // a fresh function per run: a function may keep what it evaluated (Literal keeps its column)
- $onPhp = ScalarFunctionFixtures::instance($class);
- $onAdaptive = ScalarFunctionFixtures::instance($class);
- $adaptiveUnderPhp = ScalarFunctionFixtures::instance($class);
- } catch (RequiredPHPVersionException $e) {
- static::markTestSkipped($e->getMessage());
- }
-
- ScalarFunctionContract::evaluatesOnTheConfiguredBackend($onPhp, $onAdaptive, $adaptiveUnderPhp);
+ // a fresh function per run: a function may keep what it evaluated (Literal keeps its column)
+ ScalarFunctionContract::evaluatesOnTheConfiguredBackend(
+ ScalarFunctionFixtures::instance($class),
+ ScalarFunctionFixtures::instance($class),
+ ScalarFunctionFixtures::instance($class),
+ );
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllTest.php
index f9541fa4db..fbcd14788a 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllTest.php
@@ -49,7 +49,7 @@ public static function three_valued_and(): Generator
#[DataProvider('three_valued_and')]
public function test_three_valued_truth_table(?bool $left, ?bool $right, ?bool $expected): void
{
- static::assertSame($expected, (new FunctionContext(flow_context()))->eval(
+ static::assertSame($expected, new FunctionContext(flow_context())->eval(
new All(lit($left), lit($right)),
[],
schema(),
@@ -58,7 +58,7 @@ public function test_three_valued_truth_table(?bool $left, ?bool $right, ?bool $
public function test_all_expression_on_is_null_expression(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
all(ref('value')->isNull()),
['value' => null],
schema(str_schema('value', nullable: true)),
@@ -67,7 +67,7 @@ public function test_all_expression_on_is_null_expression(): void
public function test_all_expression_on_multiple_boolean_values(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
all(lit(true), lit(true), lit(true)),
[],
schema(),
@@ -76,7 +76,7 @@ public function test_all_expression_on_multiple_boolean_values(): void
public function test_all_expression_on_multiple_random_boolean_values(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
all(lit(true), lit(false), lit(true)),
[],
schema(),
@@ -85,12 +85,12 @@ public function test_all_expression_on_multiple_random_boolean_values(): void
public function test_all_function_on_boolean_false_value(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(all(lit(false)), [], schema()));
+ static::assertFalse(new FunctionContext(flow_context())->eval(all(lit(false)), [], schema()));
}
public function test_all_function_on_boolean_true_value(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(all(lit(true)), [], schema()));
+ static::assertTrue(new FunctionContext(flow_context())->eval(all(lit(true)), [], schema()));
}
public function test_an_undecided_row_only_reaches_the_next_argument(): void
@@ -102,8 +102,8 @@ public function test_an_undecided_row_only_reaches_the_next_argument(): void
static::assertSame(
[false, true],
- (new ReferenceResolver())
- ->resolve(all(ref('c'), (new FailingOnValuesFunction(ref('v'), [99]))->isNotNull()), $rows->schema())
+ new ReferenceResolver()
+ ->resolve(all(ref('c'), new FailingOnValuesFunction(ref('v'), [99])->isNotNull()), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
);
@@ -113,7 +113,7 @@ public function test_a_non_boolean_conjunct_counts_by_its_truthiness(): void
{
static::assertSame(
[false, true, false, null],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
all(ref('i')),
[['i' => 0], ['i' => 2], ['i' => 0], ['i' => null]],
@@ -138,7 +138,7 @@ public function test_a_row_decided_by_the_second_argument_keeps_its_index(): voi
static::assertSame(
[false, true, false],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(all(ref('a'), ref('b')), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AnyTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AnyTest.php
index 22b54ee0db..6f2e1f5406 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AnyTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AnyTest.php
@@ -50,7 +50,7 @@ public static function three_valued_or(): Generator
#[DataProvider('three_valued_or')]
public function test_three_valued_truth_table(?bool $left, ?bool $right, ?bool $expected): void
{
- static::assertSame($expected, (new FunctionContext(flow_context()))->eval(
+ static::assertSame($expected, new FunctionContext(flow_context())->eval(
new Any(lit($left), lit($right)),
[],
schema(),
@@ -59,17 +59,17 @@ public function test_three_valued_truth_table(?bool $left, ?bool $right, ?bool $
public function test_any_expression_on_boolean_false_value(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(any(lit(false)), [], schema()));
+ static::assertFalse(new FunctionContext(flow_context())->eval(any(lit(false)), [], schema()));
}
public function test_any_expression_on_boolean_true_value(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(any(lit(true)), [], schema()));
+ static::assertTrue(new FunctionContext(flow_context())->eval(any(lit(true)), [], schema()));
}
public function test_any_expression_on_is_null_expression(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
any(ref('value')->isNull()),
['value' => null],
schema(str_schema('value', nullable: true)),
@@ -78,7 +78,7 @@ public function test_any_expression_on_is_null_expression(): void
public function test_any_expression_on_multiple_boolean_values(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
any(lit(false), lit(true), lit(false)),
[],
schema(),
@@ -94,8 +94,8 @@ public function test_an_undecided_row_only_reaches_the_next_argument(): void
static::assertSame(
[true, true],
- (new ReferenceResolver())
- ->resolve(any(ref('c'), (new FailingOnValuesFunction(ref('v'), [99]))->isNotNull()), $rows->schema())
+ new ReferenceResolver()
+ ->resolve(any(ref('c'), new FailingOnValuesFunction(ref('v'), [99])->isNotNull()), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
);
@@ -105,7 +105,7 @@ public function test_a_non_boolean_conjunct_counts_by_its_truthiness(): void
{
static::assertSame(
[false, true, false, null],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
any(ref('i')),
[['i' => 0], ['i' => 2], ['i' => 0], ['i' => null]],
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AppendTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AppendTest.php
index 2ef836689f..e7b8438a3a 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AppendTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AppendTest.php
@@ -18,7 +18,7 @@ final class AppendTest extends FlowTestCase
{
public function test_append_empty_string_to_content(): void
{
- static::assertEquals('hello', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('hello', new FunctionContext(flow_context())->eval(
ref('str')->append(''),
['str' => 'hello'],
schema(str_schema('str')),
@@ -27,7 +27,7 @@ public function test_append_empty_string_to_content(): void
public function test_append_to_empty_string(): void
{
- static::assertEquals('hello', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('hello', new FunctionContext(flow_context())->eval(
ref('str')->append('hello'),
['str' => ''],
schema(str_schema('str')),
@@ -36,7 +36,7 @@ public function test_append_to_empty_string(): void
public function test_append_to_non_empty_string(): void
{
- static::assertEquals('hello world', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('hello world', new FunctionContext(flow_context())->eval(
ref('str')->append(' world'),
['str' => 'hello'],
schema(str_schema('str')),
@@ -45,7 +45,7 @@ public function test_append_to_non_empty_string(): void
public function test_append_with_null_suffix(): void
{
- static::assertEquals('hello', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('hello', new FunctionContext(flow_context())->eval(
ref('str')->append(ref('suffix')),
['str' => 'hello', 'suffix' => null],
schema(str_schema('str'), str_schema('suffix', nullable: true)),
@@ -56,7 +56,7 @@ public function test_a_null_suffix_leaves_the_next_row_appended(): void
{
static::assertSame(
['hello', 'worldx'],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
ref('str')->append(ref('suffix')),
[['str' => 'hello', 'suffix' => null], ['str' => 'world', 'suffix' => 'x']],
@@ -71,7 +71,7 @@ public function test_append_with_null_value(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Append function requires non-null value');
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('str')->append(' world'),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -83,7 +83,7 @@ public function test_append_with_null_value_in_strict_mode(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Append function requires non-null value');
- (new FunctionContext(flow_context(config())))->eval(
+ new FunctionContext(flow_context(config()))->eval(
ref('str')->append(' world'),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -92,7 +92,7 @@ public function test_append_with_null_value_in_strict_mode(): void
public function test_append_with_scalar_function_parameter(): void
{
- static::assertEquals('hello world', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('hello world', new FunctionContext(flow_context())->eval(
ref('str')->append(ref('suffix')),
['str' => 'hello', 'suffix' => ' world'],
schema(str_schema('str'), str_schema('suffix')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayExpandTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayExpandTest.php
index 5323941e43..b5f7e4576f 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayExpandTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayExpandTest.php
@@ -39,7 +39,7 @@ public function test_expand_both(): void
['b' => 2],
['c' => 3],
],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_expand(ref('array'), ArrayExpand::BOTH),
['array' => [
'a' => 1,
@@ -55,7 +55,7 @@ public function test_expand_keys(): void
{
static::assertSame(
['a', 'b', 'c'],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_expand(ref('array'), ArrayExpand::KEYS),
['array' => [
'a' => 1,
@@ -72,7 +72,7 @@ public function test_expand_values(): void
// an expand hands the step a list: the keys never reached the exploded column
static::assertSame(
[1, 2, 3],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_expand(ref('array')),
['array' => [
'a' => 1,
@@ -89,7 +89,7 @@ public function test_for_not_array_entry(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "integer".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_expand(ref('integer_entry')),
['integer_entry' => 1],
schema(int_schema('integer_entry')),
@@ -101,7 +101,7 @@ public function test_for_not_array_entry_in_strict_mode(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "integer".');
- (new FunctionContext(flow_context(config())))->eval(
+ new FunctionContext(flow_context(config()))->eval(
array_expand(ref('integer_entry')),
['integer_entry' => 1],
schema(int_schema('integer_entry')),
@@ -112,7 +112,7 @@ public function test_values_over_a_structure_declare_the_unified_field_type(): v
{
static::assertSame(
'integer',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
array_expand(ref('structure')),
schema(structure_schema('structure', type_structure([
@@ -134,14 +134,14 @@ public function test_keys_declare_the_key_type(): void
static::assertSame(
'string',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(array_expand(ref('structure'), ArrayExpand::KEYS), $schema)
->returns()
->toString(),
);
static::assertSame(
'integer',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(array_expand(ref('list'), ArrayExpand::KEYS), $schema)
->returns()
->toString(),
@@ -152,7 +152,7 @@ public function test_both_declares_a_one_pair_map(): void
{
static::assertSame(
'map',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
array_expand(ref('list'), ArrayExpand::BOTH),
schema(list_schema('list', type_list(type_string()))),
@@ -168,21 +168,21 @@ public function test_a_map_operand_declares_its_value_and_key_types(): void
static::assertSame(
'integer',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(array_expand(ref('map')), $schema)
->returns()
->toString(),
);
static::assertSame(
'string',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(array_expand(ref('map'), ArrayExpand::KEYS), $schema)
->returns()
->toString(),
);
static::assertSame(
'map',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(array_expand(ref('map'), ArrayExpand::BOTH), $schema)
->returns()
->toString(),
@@ -193,7 +193,7 @@ public function test_keys_of_an_integer_keyed_map_declare_integer(): void
{
static::assertSame(
'integer',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
array_expand(ref('map'), ArrayExpand::KEYS),
schema(map_schema('map', type_map(type_integer(), type_string()))),
@@ -207,7 +207,7 @@ public function test_a_null_array_does_not_stop_the_next_row(): void
{
static::assertSame(
[[], [1, 2]],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
array_expand(ref('list')),
[['list' => null], ['list' => [1, 2]]],
@@ -221,7 +221,7 @@ public function test_keys_over_a_structure_with_non_unifying_fields_still_declar
{
static::assertSame(
'string',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
array_expand(ref('structure'), ArrayExpand::KEYS),
schema(structure_schema('structure', type_structure([
@@ -238,7 +238,7 @@ public function test_values_over_a_structure_with_non_unifying_fields_refuse_to_
{
$this->expectException(SchemaNotDerivableException::class);
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
array_expand(ref('structure')),
schema(structure_schema('structure', type_structure([
@@ -256,7 +256,7 @@ public function test_a_null_array_expands_to_nothing(ArrayExpand $expand): void
{
static::assertSame(
[],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_expand(ref('list'), $expand),
[
'list' => null,
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayFilterTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayFilterTest.php
index 0a0f5d83df..5076968575 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayFilterTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayFilterTest.php
@@ -25,7 +25,7 @@ public function test_array_filter(): void
{
static::assertSame(
[1],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('list')->arrayFilter(lit(2)),
['list' => [
1,
@@ -40,7 +40,7 @@ public function test_array_filter_by_entry_reference(): void
{
static::assertSame(
[1],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('list')->arrayFilter(ref('int')),
['list' => [1, 2], 'int' => 2],
schema(list_schema('list', type_list(type_integer())), int_schema('int')),
@@ -53,7 +53,7 @@ public function test_array_filter_in_strict_mode(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "string".');
- (new FunctionContext(flow_context(config())))->eval(
+ new FunctionContext(flow_context(config()))->eval(
ref('map')->arrayFilter(lit(1)),
['map' => 'test'],
schema(str_schema('map')),
@@ -64,7 +64,7 @@ public function test_array_filter_not_existing_value(): void
{
static::assertSame(
[1, 2],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('list')->arrayFilter(lit(5)),
['list' => [
1,
@@ -80,7 +80,7 @@ public function test_array_filter_on_non_array(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "string".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('map')->arrayFilter(lit(1)),
['map' => 'test'],
schema(str_schema('map')),
@@ -92,7 +92,7 @@ public function test_array_filter_on_null(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ArrayFilter function requires non-null array');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('list')->arrayFilter(lit(2)),
['list' => null],
schema(list_schema('list', type_list(type_integer()), nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayGetCollectionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayGetCollectionTest.php
index 72ea400be0..2b23d996a6 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayGetCollectionTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayGetCollectionTest.php
@@ -43,7 +43,7 @@ public function test_array_get_collection_in_strict_mode(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ArrayGetCollection function failed to evaluate parameters');
- (new FunctionContext(flow_context(config())))->eval(
+ new FunctionContext(flow_context(config()))->eval(
array_get_collection(ref('invalid_entry'), ['id']),
['invalid_entry' => 1],
schema(int_schema('invalid_entry')),
@@ -55,7 +55,7 @@ public function test_for_not_array_entry(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ArrayGetCollection function failed to evaluate parameters.');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_get_collection(ref('invalid_entry'), ['id']),
['invalid_entry' => 1],
schema(int_schema('invalid_entry')),
@@ -65,7 +65,7 @@ public function test_for_not_array_entry(): void
public function test_null_keys_are_refused(): void
{
try {
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_get_collection(ref('array_entry'), ref('keys')),
['array_entry' => [['id' => 1]], 'keys' => null],
schema(
@@ -89,7 +89,7 @@ public function test_getting_keys_from_simple_array(): void
$rows = RowsMother::arrayColumn();
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_get_collection(ref('array_entry'), ['id']),
$rows->values(0),
$rows->schema(),
@@ -103,7 +103,7 @@ public function test_getting_specific_keys_from_collection_of_array(): void
['id' => 1, 'status' => 'PENDING'],
['id' => 2, 'status' => 'NEW'],
],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_get_collection(ref('array_entry'), ['id', 'status']),
[
'array_entry' => [
@@ -140,7 +140,7 @@ public function test_getting_specific_keys_from_first_element_in_collection_of_a
[
'parent_id' => 1,
],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('array_entry')->arrayGetCollectionFirst('parent_id'),
[
'array_entry' => [
@@ -180,7 +180,7 @@ public function test_getting_specific_keys_from_first_element_in_collection_of_a
[
'parent_id' => 1,
],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_get_collection_first(ref('array_entry'), 'parent_id'),
[
'array_entry' => [
@@ -221,7 +221,7 @@ public function test_getting_specific_keys_from_first_element_in_collection_of_a
#[TestWith([['a.b'], [['a' => ['b' => 1]]], [['a.b' => null]]])]
public function test_keys_are_literal_keys(array $keys, array $collection, array $expected): void
{
- static::assertSame($expected, (new FunctionContext(flow_context()))->eval(
+ static::assertSame($expected, new FunctionContext(flow_context())->eval(
array_get_collection(ref('array_entry'), $keys),
[
'array_entry' => $collection,
@@ -235,7 +235,7 @@ public function test_a_non_scalar_key_fails(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ArrayGetCollection function failed to evaluate parameters.');
- (new FunctionContext(flow_context()))->eval(array_get_collection(ref('array_entry'), [[
+ new FunctionContext(flow_context())->eval(array_get_collection(ref('array_entry'), [[
'x',
]]), ['array_entry' => [['x' => 1]]], schema(list_schema('array_entry', type_list(type_structure(['x' => type_integer()])))));
}
@@ -244,7 +244,7 @@ public function test_an_empty_element_reads_null_keys(): void
{
static::assertSame(
[['id' => null], ['id' => null]],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_get_collection(ref('array_entry'), ['id']),
[
'array_entry' => [['name' => 'a'], []],
@@ -284,7 +284,7 @@ public function test_describe_round_trips(): void
public function test_a_null_array_with_keys_is_refused(): void
{
try {
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_get_collection(ref('array_entry'), ['id']),
['array_entry' => null],
schema(json_schema('array_entry', nullable: true)),
@@ -303,7 +303,7 @@ public function test_an_index_of_several_steps_walks_each_step(): void
{
static::assertSame(
[['id' => 1], ['id' => 2]],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
new ArrayGetCollection(ref('array_entry'), lit(['id']), lit('items.*')),
['array_entry' => ['items' => [['id' => 1, 'name' => 'a'], ['id' => 2, 'name' => 'b']]]],
schema(json_schema('array_entry')),
@@ -314,7 +314,7 @@ public function test_an_index_of_several_steps_walks_each_step(): void
public function test_an_invalid_index_path_keeps_the_path_failure(): void
{
try {
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
new ArrayGetCollection(ref('array_entry'), lit(['id']), lit('items.{id}')),
['array_entry' => ['items' => [['id' => 1]]]],
schema(json_schema('array_entry')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayGetTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayGetTest.php
index 1e07601020..487f56a88f 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayGetTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayGetTest.php
@@ -117,14 +117,14 @@ public function test_array_access_for_not_array_entry(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ArrayGet function failed to get value from array.');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_get(ref('integer_entry'), 'invalid_path'),
[
'integer_entry' => 1,
],
schema(int_schema('integer_entry')),
);
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_exists(ref('integer_entry'), 'invalid_path'),
[
'integer_entry' => 1,
@@ -139,7 +139,7 @@ public function test_array_access_for_not_array_entry_strict_mode(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ArrayGet function failed to get value from array');
- (new FunctionContext($context))->eval(
+ new FunctionContext($context)->eval(
array_get(ref('integer_entry'), 'invalid_path'),
[
'integer_entry' => 1,
@@ -151,12 +151,12 @@ public function test_array_access_for_not_array_entry_strict_mode(): void
public function test_array_accessor_transformer(): void
{
$rows = RowsMother::arrayColumn();
- static::assertEquals('bar', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('bar', new FunctionContext(flow_context())->eval(
array_get(ref('array_entry'), 'array.foo'),
$rows->values(0),
$rows->schema(),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
array_exists(ref('array_entry'), 'array.foo'),
$rows->values(0),
$rows->schema(),
@@ -165,7 +165,7 @@ public function test_array_accessor_transformer(): void
public function test_array_accessor_transformer_with_invalid_and_without_strict_path(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
array_get(ref('array_entry'), '?invalid_path'),
[
'array_entry' => [
@@ -184,7 +184,7 @@ public function test_array_accessor_transformer_with_invalid_and_without_strict_
'array' => type_structure(['foo' => type_string()]),
]))),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
array_exists(ref('array_entry'), '?invalid_path'),
[
'array_entry' => [
@@ -203,7 +203,7 @@ public function test_array_accessor_transformer_with_invalid_and_without_strict_
'array' => type_structure(['foo' => type_string()]),
]))),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
array_exists(ref('array_entry'), 'invalid_path'),
[
'array_entry' => [
@@ -227,7 +227,7 @@ public function test_array_accessor_transformer_with_invalid_and_without_strict_
public function test_array_accessor_transformer_with_invalid_but_strict_path(): void
{
try {
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_get(ref('array_entry'), 'invalid_path'),
[
'array_entry' => [
@@ -256,7 +256,7 @@ public function test_array_accessor_transformer_with_invalid_but_strict_path():
public function test_array_get_with_null_array(): void
{
try {
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_get(ref('array_entry'), 'id'),
['array_entry' => null],
schema(structure_schema('array_entry', type_structure(['id' => type_integer()]), nullable: true)),
@@ -274,7 +274,7 @@ public function test_array_get_with_null_array(): void
public function test_returns_rejects_a_non_structure_input(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(
+ $resolved = new ReferenceResolver()->resolve(
array_get(ref('list'), 'field'),
schema(list_schema('list', type_list(type_string()))),
);
@@ -290,7 +290,7 @@ public function test_returns_rejects_a_non_structure_input(): void
public function test_returns_rejects_an_undeclared_path_segment(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(
+ $resolved = new ReferenceResolver()->resolve(
array_get(ref('data'), 'missing'),
schema(structure_schema('data', type_structure(['field' => type_integer()]))),
);
@@ -304,7 +304,7 @@ public function test_returns_rejects_an_undeclared_path_segment(): void
public function test_returns_resolves_the_element_type_for_a_declared_path(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(
+ $resolved = new ReferenceResolver()->resolve(
array_get(ref('data'), 'field'),
schema(structure_schema('data', type_structure(['field' => type_integer()]))),
);
@@ -315,7 +315,7 @@ public function test_returns_resolves_the_element_type_for_a_declared_path(): vo
public function test_returns_resolves_a_numeric_path_segment_to_an_integer_named_element(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(
+ $resolved = new ReferenceResolver()->resolve(
array_get(ref('data'), '0'),
schema(structure_schema('data', type_structure([0 => type_integer(), 'b' => type_string()]))),
);
@@ -333,7 +333,7 @@ public function test_returns_follows_the_path_grammar(
string $expected,
): void {
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(
+ $resolved = new ReferenceResolver()->resolve(
array_get(ref('data'), $path),
schema(structure_schema('data', $structure)),
);
@@ -344,7 +344,7 @@ public function test_returns_follows_the_path_grammar(
public function test_returns_names_the_key_of_an_undeclared_nullsafe_segment(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(
+ $resolved = new ReferenceResolver()->resolve(
array_get(ref('data'), '?missing'),
schema(structure_schema('data', type_structure(['field' => type_integer()]))),
);
@@ -398,6 +398,6 @@ public function test_a_description_rebuilds_through_the_constructor_checks(): vo
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('selects more than one value');
- (new Rebuild())->of($data, ScalarFunction::class);
+ new Rebuild()->of($data, ScalarFunction::class);
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeepTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeepTest.php
index ef4bb7d2dd..b136e70d55 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeepTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeepTest.php
@@ -25,7 +25,7 @@ public function test_array_keep(): void
{
static::assertSame(
[1 => 2],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('list')->arrayKeep(lit(2)),
['list' => [
1,
@@ -40,7 +40,7 @@ public function test_array_keep_by_entry_reference(): void
{
static::assertSame(
[1 => 2],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('list')->arrayKeep(ref('int')),
['list' => [1, 2], 'int' => 2],
schema(list_schema('list', type_list(type_integer())), int_schema('int')),
@@ -53,7 +53,7 @@ public function test_array_keep_in_strict_mode(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "string".');
- (new FunctionContext(flow_context(config())))->eval(
+ new FunctionContext(flow_context(config()))->eval(
ref('map')->arrayKeep(lit(1)),
['map' => 'test'],
schema(str_schema('map')),
@@ -64,7 +64,7 @@ public function test_array_keep_not_existing_value(): void
{
static::assertSame(
[],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('list')->arrayKeep(lit(5)),
['list' => [
1,
@@ -80,7 +80,7 @@ public function test_array_keep_on_non_array(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "string".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('map')->arrayKeep(lit(1)),
['map' => 'test'],
schema(str_schema('map')),
@@ -92,7 +92,7 @@ public function test_array_keep_on_null(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ArrayKeep function requires non-null array');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('list')->arrayKeep(lit(2)),
['list' => null],
schema(list_schema('list', type_list(type_integer()), nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeyRenameTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeyRenameTest.php
index 0b613e1b0b..283d40dc00 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeyRenameTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeyRenameTest.php
@@ -28,7 +28,7 @@ public function test_array_key_rename_in_strict_mode(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "integer".');
- (new FunctionContext(flow_context(config())))->eval(
+ new FunctionContext(flow_context(config()))->eval(
array_key_rename(ref('integer_entry'), 'invalid_path', 'new_name'),
['integer_entry' => 1],
schema(int_schema('integer_entry')),
@@ -40,7 +40,7 @@ public function test_for_not_array_entry(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "integer".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_key_rename(ref('integer_entry'), 'invalid_path', 'new_name'),
['integer_entry' => 1],
schema(int_schema('integer_entry')),
@@ -54,7 +54,7 @@ public function test_renames_array_entry_keys_in_multiple_array_entry(): void
'first_name' => 'John',
'last' => 'Snow',
],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_key_rename(ref('customer'), 'first', 'first_name'),
[
'customer' => [
@@ -87,7 +87,7 @@ public function test_renames_array_entry_keys_in_multiple_array_entry(): void
],
'estimated_delivery_date' => '2023-04-01T10:00:00+00:00',
],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_key_rename(ref('shipping'), 'address.line', 'street'),
[
'customer' => [
@@ -124,7 +124,7 @@ public function test_renames_array_entry_keys_in_single_array_entry(): void
'enabled' => true,
'array' => ['new_name' => 'bar'],
],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_key_rename(ref('array_entry'), 'array.foo', 'new_name'),
$rows->values(0),
$rows->schema(),
@@ -137,7 +137,7 @@ public function test_throws_exception_for_invalid_path(): void
$rows = RowsMother::arrayColumn();
try {
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_key_rename(ref('array_entry'), 'invalid_path', 'new_name'),
$rows->values(0),
$rows->schema(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeysStyleConverterTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeysStyleConverterTest.php
index 5cc9bec3f8..906732c41d 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeysStyleConverterTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeysStyleConverterTest.php
@@ -33,7 +33,7 @@ public function test_for_invalid_style(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Unrecognized style invalid, please use one of following:');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_keys_style_convert(ref('invalid_entry'), 'invalid'),
['invalid_entry' => []],
schema(json_schema('invalid_entry')),
@@ -45,7 +45,7 @@ public function test_for_not_array_entry(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "integer".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_keys_style_convert(ref('invalid_entry'), 'snake'),
['invalid_entry' => 1],
schema(int_schema('invalid_entry')),
@@ -57,7 +57,7 @@ public function test_for_null_array_entry(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ArrayKeysStyleConvert function requires non-null array');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_keys_style_convert(ref('array_entry'), 'snake'),
['array_entry' => null],
schema(map_schema('array_entry', type_map(type_string(), type_integer()), nullable: true)),
@@ -85,7 +85,7 @@ public function test_transforms_case_style_for_all_keys_in_array_entry(): void
'variant_name' => 'Variant Name',
],
],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_keys_style_convert(ref('arrayEntry'), 'snake'),
[
'arrayEntry' => [
@@ -130,7 +130,7 @@ public function test_colliding_converted_field_names_are_refused_instead_of_sile
'fields "foo_bar" and "fooBar" of "structure{foo_bar: integer, fooBar: string}" both convert to "fooBar"',
);
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
array_keys_style_convert(ref('structure'), StringStyles::CAMEL),
schema(structure_schema('structure', type_structure([
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeysTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeysTest.php
index 3d38a884f6..7dae2ca5da 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeysTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeysTest.php
@@ -31,7 +31,7 @@ final class ArrayKeysTest extends FlowTestCase
public function test_a_structure_operand_declares_a_list_of_string_keys(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(
+ $resolved = new ReferenceResolver()->resolve(
ref('structure')->arrayKeys(),
schema(structure_schema('structure', type_structure(['field' => type_integer()]))),
);
@@ -42,7 +42,7 @@ public function test_a_structure_operand_declares_a_list_of_string_keys(): void
public function test_a_list_operand_declares_a_list_of_integer_keys(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(
+ $resolved = new ReferenceResolver()->resolve(
ref('list')->arrayKeys(),
schema(list_schema('list', type_list(type_string()))),
);
@@ -53,7 +53,7 @@ public function test_a_list_operand_declares_a_list_of_integer_keys(): void
public function test_an_operand_without_a_key_type_is_refused_at_bind(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(ref('json')->arrayKeys(), schema(json_schema('json')));
+ $resolved = new ReferenceResolver()->resolve(ref('json')->arrayKeys(), schema(json_schema('json')));
$this->expectException(SchemaNotDerivableException::class);
$this->expectExceptionMessage('which has no key type');
@@ -65,7 +65,7 @@ public function test_array_keys(): void
{
static::assertSame(
['a', 'b'],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('map')->arrayKeys(),
['map' => [
'a' => 1,
@@ -81,7 +81,7 @@ public function test_array_keys_in_strict_mode(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "string".');
- (new FunctionContext(flow_context(config())))->eval(
+ new FunctionContext(flow_context(config()))->eval(
ref('map')->arrayKeys(),
['map' => 'test'],
schema(str_schema('map')),
@@ -93,7 +93,7 @@ public function test_array_keys_on_non_array(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "string".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('map')->arrayKeys(),
['map' => 'test'],
schema(str_schema('map')),
@@ -105,7 +105,7 @@ public function test_array_keys_on_null(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ArrayKeys function requires non-null array');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('map')->arrayKeys(),
['map' => null],
schema(map_schema('map', type_map(type_string(), type_integer()), nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayMergeCollectionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayMergeCollectionTest.php
index e6573d38f3..05402483d8 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayMergeCollectionTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayMergeCollectionTest.php
@@ -32,7 +32,7 @@ public function test_array_merge_collection_in_strict_mode_with_non_array(): voi
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "integer".');
- (new FunctionContext(flow_context(config())))->eval(
+ new FunctionContext(flow_context(config()))->eval(
array_merge_collection(ref('invalid_entry')),
['invalid_entry' => 1],
schema(int_schema('invalid_entry')),
@@ -44,7 +44,7 @@ public function test_array_merge_collection_in_strict_mode_with_non_array_elemen
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ArrayMergeCollection function requires array elements to be arrays');
- (new FunctionContext(flow_context(config())))->eval(
+ new FunctionContext(flow_context(config()))->eval(
array_merge_collection(ref('array_entry')),
[
'array_entry' => [
@@ -61,7 +61,7 @@ public function test_attempt_of_merging_collection_where_not_every_element_is_ar
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ArrayMergeCollection function requires array elements to be arrays');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_merge_collection(ref('array_entry')),
[
'array_entry' => [
@@ -78,7 +78,7 @@ public function test_for_not_array_entry(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "integer".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_merge_collection(ref('invalid_entry')),
['invalid_entry' => 1],
schema(int_schema('invalid_entry')),
@@ -89,7 +89,7 @@ public function test_merging_collection_of_arrays(): void
{
static::assertEquals(
[1, 2],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_merge_collection(ref('array_entry')),
[
'array_entry' => [
@@ -111,7 +111,7 @@ public function test_merging_a_string_keyed_collection(): void
{
static::assertSame(
[1, 2],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
array_merge_collection(ref('array_entry')),
['array_entry' => ['a' => [1], 'b' => [2]]],
schema(map_schema('array_entry', type_map(type_string(), type_list(type_integer())))),
@@ -123,7 +123,7 @@ public function test_a_list_of_structures_declares_the_structure(): void
{
static::assertSame(
'structure{a?: integer}',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('collection')->arrayMergeCollection(),
schema(list_schema(
@@ -140,7 +140,7 @@ public function test_an_interleaved_structure_keeps_its_order_and_every_field_co
{
static::assertSame(
'structure{z?: integer, a?: string, b?: integer}',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('collection')->arrayMergeCollection(),
schema(list_schema(
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayMergeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayMergeTest.php
index bcffadf27d..b2f1e8e7ec 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayMergeTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayMergeTest.php
@@ -34,7 +34,7 @@ public function test_array_merge_in_strict_mode(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "integer".');
- (new FunctionContext(flow_context(config())))->eval(
+ new FunctionContext(flow_context(config()))->eval(
ref('a')->arrayMerge(ref('b')),
['a' => 1, 'b' => ['b' => 2]],
schema(int_schema('a'), map_schema('b', type_map(type_string(), type_integer()))),
@@ -45,7 +45,7 @@ public function test_array_merge_two_array_row_entries(): void
{
static::assertSame(
['a' => 1, 'b' => 2],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('a')->arrayMerge(ref('b')),
['a' => ['a' => 1], 'b' => ['b' => 2]],
schema(
@@ -60,7 +60,7 @@ public function test_array_merge_two_lit_functions(): void
{
static::assertSame(
['a' => 1, 'b' => 2],
- (new FunctionContext(flow_context()))->eval(new ArrayMerge(lit(['a' => 1]), lit(['b' => 2])), [], schema()),
+ new FunctionContext(flow_context())->eval(new ArrayMerge(lit(['a' => 1]), lit(['b' => 2])), [], schema()),
);
}
@@ -69,7 +69,7 @@ public function test_array_merge_when_left_side_is_not_an_array(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "integer".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('a')->arrayMerge(ref('b')),
['a' => 1, 'b' => ['b' => 2]],
schema(int_schema('a'), map_schema('b', type_map(type_string(), type_integer()))),
@@ -81,7 +81,7 @@ public function test_array_merge_when_right_side_is_not_an_array(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "integer".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('a')->arrayMerge(ref('b')),
['a' => ['a' => 1], 'b' => 2],
schema(map_schema('a', type_map(type_string(), type_integer())), int_schema('b')),
@@ -92,7 +92,7 @@ public function test_a_list_merged_with_a_map_declares_an_array(): void
{
static::assertEquals(
type_array(),
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('a')->arrayMerge(ref('b')),
schema(
@@ -109,7 +109,7 @@ public function test_lists_without_a_common_element_type_refuse_to_declare(): vo
$this->expectException(InvalidTypeException::class);
$this->expectExceptionMessage('Cannot combine types "boolean", "datetime"');
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('a')->arrayMerge(ref('b')),
schema(list_schema('a', type_list(type_boolean())), list_schema('b', type_list(type_datetime()))),
@@ -122,7 +122,7 @@ public function test_array_merge_when_left_side_is_null(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ArrayMerge function requires two non-null arrays');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('a')->arrayMerge(ref('b')),
['a' => null, 'b' => ['b' => 2]],
schema(
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayPathExistsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayPathExistsTest.php
index 18f632ebf0..61fc6ff3c6 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayPathExistsTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayPathExistsTest.php
@@ -22,7 +22,7 @@ public function test_a_null_array_is_null_and_does_not_stop_the_next_row(): void
{
static::assertSame(
[null, true],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
array_exists(ref('array'), 'a'),
[['array' => null], ['array' => ['a' => 1]]],
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayReverseTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayReverseTest.php
index 5065e0c1e4..e1afcf305a 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayReverseTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayReverseTest.php
@@ -28,7 +28,7 @@ public function test_array_reverse_array_entry(): void
{
static::assertSame(
[5, 3, 10, 4],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('a')->arrayReverse(),
['a' => [
4,
@@ -46,7 +46,7 @@ public function test_array_reverse_in_strict_mode(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "integer".');
- (new FunctionContext(flow_context(config())))->eval(
+ new FunctionContext(flow_context(config()))->eval(
ref('a')->arrayReverse(),
['a' => 123],
schema(int_schema('a')),
@@ -58,14 +58,14 @@ public function test_array_reverse_non_array_entry(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "integer".');
- (new FunctionContext(flow_context()))->eval(ref('a')->arrayReverse(), ['a' => 123], schema(int_schema('a')));
+ new FunctionContext(flow_context())->eval(ref('a')->arrayReverse(), ['a' => 123], schema(int_schema('a')));
}
public function test_a_structure_operand_declares_reversed_fields(): void
{
static::assertSame(
'structure{b: string, a: integer}',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('structure')->arrayReverse(),
schema(structure_schema('structure', type_structure([
@@ -82,7 +82,7 @@ public function test_optional_structure_fields_are_reversed_too(): void
{
static::assertSame(
'structure{y?: string, x?: string, a: integer}',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('structure')->arrayReverse(),
schema(structure_schema('structure', type_structure([
@@ -100,7 +100,7 @@ public function test_reversal_crosses_the_required_and_optional_buckets(): void
{
static::assertSame(
'structure{x?: string, b: integer, a: integer}',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('structure')->arrayReverse(),
schema(structure_schema('structure', type_structure([
@@ -119,7 +119,7 @@ public function test_array_reverse_on_null(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ArrayReverse function requires non-null array');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('list')->arrayReverse(),
['list' => null],
schema(list_schema('list', type_list(type_integer()), nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArraySortTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArraySortTest.php
index 5cef64bf99..70a80e4552 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArraySortTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArraySortTest.php
@@ -38,7 +38,7 @@ public function test_array_sort_in_strict_mode(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "string".');
- (new FunctionContext(flow_context(config())))->eval(
+ new FunctionContext(flow_context(config()))->eval(
ref('array')->arraySort(),
['array' => 'string'],
schema(str_schema('array')),
@@ -158,7 +158,7 @@ public function test_sorting_big_arrays(string $json): void
]],
]],
type_instance_of(Json::class)
- ->assert((new FunctionContext(flow_context()))->eval(
+ ->assert(new FunctionContext(flow_context())->eval(
ref('array')->arraySort(),
['array' => type_array()->assert(json_decode($json, true, 512, JSON_THROW_ON_ERROR))],
schema(json_schema('array')),
@@ -181,7 +181,7 @@ public function test_sorting_nested_array_using_asort_algo(): void
],
],
type_instance_of(Json::class)
- ->assert((new FunctionContext(flow_context()))->eval(
+ ->assert(new FunctionContext(flow_context())->eval(
ref('array')->arraySort(Sort::asort),
[
'array' => [
@@ -214,7 +214,7 @@ public function test_sorting_nested_associative_array(): void
],
],
type_instance_of(Json::class)
- ->assert((new FunctionContext(flow_context()))->eval(
+ ->assert(new FunctionContext(flow_context())->eval(
ref('array')->arraySort(Sort::ksort),
[
'array' => [
@@ -238,7 +238,7 @@ public function test_sorting_non_array_value(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "string".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('array')->arraySort(),
['array' => 'string'],
schema(str_schema('array')),
@@ -250,7 +250,7 @@ public function test_sorting_null_array(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ArraySort function requires non-null array');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('array')->arraySort(),
['array' => null],
schema(map_schema('array', type_map(type_string(), type_integer()), nullable: true)),
@@ -261,7 +261,7 @@ public function test_a_null_recursive_flag_leaves_nested_arrays_unsorted(): void
{
static::assertSame(
['a' => ['d' => 1, 'c' => 2], 'b' => ['z' => 1, 'y' => 2]],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('array')->arraySort(Sort::ksort, recursive: ref('recursive')),
['array' => ['b' => ['z' => 1, 'y' => 2], 'a' => ['d' => 1, 'c' => 2]], 'recursive' => null],
schema(
@@ -276,7 +276,7 @@ public function test_ksort_declares_key_sorted_structure_fields(): void
{
static::assertSame(
'structure{a: integer, b: integer}',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('structure')->arraySort(Sort::ksort),
schema(structure_schema('structure', type_structure([
@@ -293,7 +293,7 @@ public function test_a_value_sort_keeps_the_declared_field_order(): void
{
static::assertSame(
'structure{b: integer, a: integer}',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('structure')->arraySort(Sort::asort),
schema(structure_schema('structure', type_structure([
@@ -310,7 +310,7 @@ public function test_krsort_declares_reverse_key_sorted_structure_fields(): void
{
static::assertSame(
'structure{b: integer, a: integer}',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('structure')->arraySort(Sort::krsort),
schema(structure_schema('structure', type_structure([
@@ -327,7 +327,7 @@ public function test_ksort_orders_across_the_required_and_optional_buckets(): vo
{
static::assertSame(
'structure{a?: integer, z: integer}',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('structure')->arraySort(Sort::ksort),
schema(structure_schema('structure', type_structure([
@@ -344,7 +344,7 @@ public function test_ksort_reproduces_php_key_order_for_numeric_element_names():
{
static::assertSame(
'structure{9: integer, 10: integer, b: integer}',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('structure')->arraySort(Sort::ksort),
schema(structure_schema('structure', type_structure([
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayUnpackTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayUnpackTest.php
index 5dcb77c4bf..476b151ebf 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayUnpackTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayUnpackTest.php
@@ -38,7 +38,7 @@ public function test_array_unpack(): void
'status' => 'PENDING',
'enabled' => true,
],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
new ArrayUnpack(ref('array_entry'), schema(str_schema('status'), bool_schema('enabled'))),
[
'id' => 1,
@@ -65,7 +65,7 @@ public function test_array_unpack_with_null_in_strict_mode(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('array_unpack() requires a non-null array');
- (new FunctionContext(flow_context(config())))->eval(
+ new FunctionContext(flow_context(config()))->eval(
new ArrayUnpack(ref('array_entry'), schema(str_schema('status'))),
[
'id' => 1,
@@ -90,7 +90,7 @@ public function test_returns_the_declared_structure_with_every_column_nullable()
'status' => structure_element('status', type_optional(type_string())),
'enabled' => structure_element('enabled', type_optional(type_boolean())),
]),
- (new ArrayUnpack(ref('array_entry'), schema(str_schema('status'), bool_schema('enabled'))))->returns(),
+ new ArrayUnpack(ref('array_entry'), schema(str_schema('status'), bool_schema('enabled')))->returns(),
);
}
@@ -98,7 +98,7 @@ public function test_the_declared_columns_are_readable_through_returns(): void
{
static::assertEquals(
type_structure(['payload' => structure_element('payload', type_optional(type_json()))]),
- (new ArrayUnpack(ref('array_entry'), schema(json_schema('payload'))))->returns(),
+ new ArrayUnpack(ref('array_entry'), schema(json_schema('payload')))->returns(),
);
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayValuesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayValuesTest.php
index d5655463fa..e94a381b43 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayValuesTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayValuesTest.php
@@ -30,7 +30,7 @@ public function test_array_values(): void
{
static::assertSame(
[1, 2],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('map')->arrayValues(),
['map' => [
'a' => 1,
@@ -46,7 +46,7 @@ public function test_array_values_in_strict_mode(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "string".');
- (new FunctionContext(flow_context(config())))->eval(
+ new FunctionContext(flow_context(config()))->eval(
ref('map')->arrayValues(),
['map' => 'test'],
schema(str_schema('map')),
@@ -58,7 +58,7 @@ public function test_array_values_on_non_array(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "string".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('map')->arrayValues(),
['map' => 'test'],
schema(str_schema('map')),
@@ -69,7 +69,7 @@ public function test_a_structure_operand_declares_the_unified_field_type(): void
{
static::assertSame(
'list',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('structure')->arrayValues(),
schema(structure_schema('structure', type_structure([
@@ -86,7 +86,7 @@ public function test_a_structure_whose_fields_do_not_unify_refuses_to_declare():
{
$this->expectException(SchemaNotDerivableException::class);
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('structure')->arrayValues(),
schema(structure_schema('structure', type_structure([
@@ -102,7 +102,7 @@ public function test_array_values_on_null(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ArrayValues function requires non-null array');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('map')->arrayValues(),
['map' => null],
schema(map_schema('map', type_map(type_string(), type_integer()), nullable: true)),
@@ -113,7 +113,7 @@ public function test_a_map_operand_declares_the_map_value_type(): void
{
static::assertSame(
'list',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(ref('map')->arrayValues(), schema(map_schema('map', type_map(type_string(), type_integer()))))
->returns()
->toString(),
@@ -125,7 +125,7 @@ public function test_a_scalar_operand_refuses_to_declare(): void
$this->expectException(SchemaNotDerivableException::class);
$this->expectExceptionMessage('the array operand declares "string", which has no element type');
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(ref('map')->arrayValues(), schema(str_schema('map')))
->returns();
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AsciiTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AsciiTest.php
index 28b9779e96..4fb2ff48b5 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AsciiTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AsciiTest.php
@@ -17,7 +17,7 @@ final class AsciiTest extends FlowTestCase
{
public function test_ascii(): void
{
- static::assertSame('azcz', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('azcz', new FunctionContext(flow_context())->eval(
ref('str')->ascii(),
['str' => 'ąźćż'],
schema(str_schema('str')),
@@ -29,7 +29,7 @@ public function test_ascii_on_null(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Ascii function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->ascii(),
['str' => null],
schema(str_schema('str', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BetweenTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BetweenTest.php
index c4c25c32d9..9a9d3c674f 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BetweenTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BetweenTest.php
@@ -25,7 +25,7 @@ final class BetweenTest extends FlowTestCase
{
public function test_a_definite_false_short_circuits_past_a_null(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
ref('value')->between(lit(10), lit(null)),
['value' => 5],
schema(int_schema('value')),
@@ -34,7 +34,7 @@ public function test_a_definite_false_short_circuits_past_a_null(): void
public function test_a_null_bound_that_could_change_the_answer_is_null(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('value')->between(lit(10), lit(null)),
['value' => 50],
schema(int_schema('value')),
@@ -43,28 +43,28 @@ public function test_a_null_bound_that_could_change_the_answer_is_null(): void
public function test_between_exclusive(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
between(ref('value'), lit(10), lit(50), Boundary::EXCLUSIVE),
[
'value' => 11,
],
schema(int_schema('value')),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
between(ref('value'), lit(10), lit(50), Boundary::EXCLUSIVE),
[
'value' => 49,
],
schema(int_schema('value')),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
between(ref('value'), lit(10), lit(50), Boundary::EXCLUSIVE),
[
'value' => 10,
],
schema(int_schema('value')),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
between(ref('value'), lit(10), lit(50), Boundary::EXCLUSIVE),
[
'value' => 50,
@@ -75,28 +75,28 @@ public function test_between_exclusive(): void
public function test_between_inclusive(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
between(ref('value'), lit(10), lit(50), Boundary::INCLUSIVE),
[
'value' => 10,
],
schema(int_schema('value')),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
between(ref('value'), lit(10), lit(50), Boundary::INCLUSIVE),
[
'value' => 50,
],
schema(int_schema('value')),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
between(ref('value'), lit(10), lit(50), Boundary::INCLUSIVE),
[
'value' => 9,
],
schema(int_schema('value')),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
between(ref('value'), lit(10), lit(50), Boundary::INCLUSIVE),
[
'value' => 51,
@@ -107,14 +107,14 @@ public function test_between_inclusive(): void
public function test_between_left_inclusive(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
between(ref('value'), lit(10), lit(50)),
[
'value' => 10,
],
schema(int_schema('value')),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
between(ref('value'), lit(10), lit(50)),
[
'value' => 9,
@@ -125,14 +125,14 @@ public function test_between_left_inclusive(): void
public function test_between_right_inclusive(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
between(ref('value'), lit(10), lit(50), Boundary::RIGHT_INCLUSIVE),
[
'value' => 50,
],
schema(int_schema('value')),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
between(ref('value'), lit(10), lit(50), Boundary::RIGHT_INCLUSIVE),
[
'value' => 51,
@@ -146,7 +146,7 @@ public function test_between_with_invalid_boundary_in_strict_mode(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "object", got "string".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
between(ref('value'), lit(10), lit(50), lit('invalid')),
[
'value' => 20,
@@ -178,7 +178,7 @@ public function test_between_refuses_a_value_incomparable_with_its_bounds(): voi
public function test_with_operands_keeps_value_lower_and_upper_bound_in_order(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
between(lit(0), lit(0), lit(0), Boundary::EXCLUSIVE)->withOperands([lit(5), lit(1), lit(10)]),
[],
schema(),
@@ -187,7 +187,7 @@ public function test_with_operands_keeps_value_lower_and_upper_bound_in_order():
public function test_between_orders_strings_by_bytes(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('a')->between(lit('10'), lit('9')),
['a' => '100'],
schema(str_schema('a')),
@@ -198,17 +198,17 @@ public function test_between_orders_a_numeric_string_column_numerically(): void
{
$context = flow_context();
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('a')->between(lit('10'), lit('9')),
['a' => '100'],
schema(definition_from_type('a', type_numeric_string())),
));
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('a')->between(lit('9'), lit('18446744073709551615'), lit(Boundary::INCLUSIVE)),
['a' => '18446744073709551615'],
schema(definition_from_type('a', type_numeric_string())),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('a')->between(lit('9'), lit('18446744073709551614'), lit(Boundary::INCLUSIVE)),
['a' => '18446744073709551615'],
schema(definition_from_type('a', type_numeric_string())),
@@ -217,7 +217,7 @@ public function test_between_orders_a_numeric_string_column_numerically(): void
public function test_a_null_value_is_null(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('value')->between(lit(1), lit(10)),
['value' => null],
schema(int_schema('value', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BinaryComparisonsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BinaryComparisonsTest.php
index 658a8d95ce..8de7041ad5 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BinaryComparisonsTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BinaryComparisonsTest.php
@@ -36,7 +36,7 @@ final class BinaryComparisonsTest extends FlowTestCase
{
public function test_equals(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::EQUAL, ref('b')),
[
'a' => 100,
@@ -47,7 +47,7 @@ public function test_equals(): void
],
schema(int_schema('a'), int_schema('b'), int_schema('c'), datetime_schema('d'), datetime_schema('e')),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new Comparison(ref('d'), Operator::EQUAL, ref('e')),
[
'a' => 100,
@@ -58,7 +58,7 @@ public function test_equals(): void
],
schema(int_schema('a'), int_schema('b'), int_schema('c'), datetime_schema('d'), datetime_schema('e')),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::EQUAL, ref('c')),
[
'a' => 100,
@@ -73,7 +73,7 @@ public function test_equals(): void
public function test_greater_than(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::GREATER_THAN, ref('c')),
[
'a' => 100,
@@ -92,7 +92,7 @@ public function test_greater_than(): void
str_schema('f', nullable: true),
),
));
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::GREATER_THAN, ref('f')),
[
'a' => 100,
@@ -111,7 +111,7 @@ public function test_greater_than(): void
str_schema('f', nullable: true),
),
));
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
new Comparison(ref('f'), Operator::GREATER_THAN, ref('c')),
[
'a' => 100,
@@ -130,7 +130,7 @@ public function test_greater_than(): void
str_schema('f', nullable: true),
),
));
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
new Comparison(ref('f'), Operator::GREATER_THAN, ref('f')),
[
'a' => 100,
@@ -149,7 +149,7 @@ public function test_greater_than(): void
str_schema('f', nullable: true),
),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::GREATER_THAN, ref('b')),
[
'a' => 100,
@@ -168,7 +168,7 @@ public function test_greater_than(): void
str_schema('f', nullable: true),
),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::GREATER_THAN_EQUAL, ref('c')),
[
'a' => 100,
@@ -187,7 +187,7 @@ public function test_greater_than(): void
str_schema('f', nullable: true),
),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::GREATER_THAN_EQUAL, ref('b')),
[
'a' => 100,
@@ -206,7 +206,7 @@ public function test_greater_than(): void
str_schema('f', nullable: true),
),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new Comparison(ref('e'), Operator::GREATER_THAN_EQUAL, ref('d')),
[
'a' => 100,
@@ -225,7 +225,7 @@ public function test_greater_than(): void
str_schema('f', nullable: true),
),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new Comparison(
ref('e'),
Operator::GREATER_THAN_EQUAL,
@@ -248,7 +248,7 @@ public function test_greater_than(): void
str_schema('f', nullable: true),
),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
new Comparison(
ref('e'),
Operator::GREATER_THAN_EQUAL,
@@ -271,7 +271,7 @@ public function test_greater_than(): void
str_schema('f', nullable: true),
),
));
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::GREATER_THAN_EQUAL, ref('f')),
[
'a' => 100,
@@ -290,7 +290,7 @@ public function test_greater_than(): void
str_schema('f', nullable: true),
),
));
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
new Comparison(ref('f'), Operator::GREATER_THAN_EQUAL, ref('c')),
[
'a' => 100,
@@ -309,7 +309,7 @@ public function test_greater_than(): void
str_schema('f', nullable: true),
),
));
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
new Comparison(ref('f'), Operator::GREATER_THAN_EQUAL, ref('f')),
[
'a' => 100,
@@ -332,7 +332,7 @@ public function test_greater_than(): void
public function test_greater_than_equal_with_null_in_strict_mode(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::GREATER_THAN_EQUAL, ref('f')),
['a' => 100, 'f' => null],
schema(int_schema('a'), str_schema('f', nullable: true)),
@@ -341,7 +341,7 @@ public function test_greater_than_equal_with_null_in_strict_mode(): void
public function test_greater_than_with_null_in_strict_mode(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::GREATER_THAN, ref('f')),
['a' => 100, 'f' => null],
schema(int_schema('a'), str_schema('f', nullable: true)),
@@ -350,7 +350,7 @@ public function test_greater_than_with_null_in_strict_mode(): void
public function test_is_in(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new IsIn(ref('a'), lit(1)),
[
'a' => [1, 2, 3, 4, 5],
@@ -367,7 +367,7 @@ public function test_is_in(): void
str_schema('e'),
),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
new IsIn(ref('a'), lit(10)),
[
'a' => [1, 2, 3, 4, 5],
@@ -384,7 +384,7 @@ public function test_is_in(): void
str_schema('e'),
),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new IsIn(ref('a'), ref('d')),
[
'a' => [1, 2, 3, 4, 5],
@@ -401,7 +401,7 @@ public function test_is_in(): void
str_schema('e'),
),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new IsIn(ref('b'), ref('e')),
[
'a' => [1, 2, 3, 4, 5],
@@ -422,7 +422,7 @@ public function test_is_in(): void
public function test_is_in_with_null_array_in_strict_mode(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
new IsIn(ref('a'), ref('d')),
['a' => null, 'd' => 1],
schema(str_schema('a', nullable: true), int_schema('d')),
@@ -431,32 +431,32 @@ public function test_is_in_with_null_array_in_strict_mode(): void
public function test_is_numeric(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new IsNumeric(ref('a')),
['a' => 100, 'b' => null],
schema(int_schema('a'), str_schema('b', nullable: true)),
));
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
new IsNumeric(ref('b')),
['a' => 100, 'b' => null],
schema(int_schema('a'), str_schema('b', nullable: true)),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
new IsNotNumeric(ref('a')),
['a' => 100, 'b' => null],
schema(int_schema('a'), str_schema('b', nullable: true)),
));
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
new IsNotNumeric(ref('b')),
['a' => 100, 'b' => null],
schema(int_schema('a'), str_schema('b', nullable: true)),
));
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
new IsNotNumeric(lit(null)),
['a' => 100, 'b' => null],
schema(int_schema('a'), str_schema('b', nullable: true)),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new IsNumeric(lit(1000)),
['a' => 100, 'b' => null],
schema(int_schema('a'), str_schema('b', nullable: true)),
@@ -465,12 +465,12 @@ public function test_is_numeric(): void
public function test_is_type(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new IsType(ref('a'), 'integer', 'string'),
['a' => 100, 'b' => null],
schema(int_schema('a'), str_schema('b', nullable: true)),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
new IsType(ref('a'), type_string()),
['a' => 100, 'b' => null],
schema(int_schema('a'), str_schema('b', nullable: true)),
@@ -481,7 +481,7 @@ public function test_is_type_with_non_existing_type_class(): void
{
$this->expectExceptionMessage('Unknown type \'aaa\'');
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
new IsType(ref('a'), 'aaa'),
['a' => 100, 'b' => null],
schema(int_schema('a'), str_schema('b', nullable: true)),
@@ -490,52 +490,52 @@ public function test_is_type_with_non_existing_type_class(): void
public function test_less_than(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::LESS_THAN, ref('c')),
['a' => 100, 'b' => 100, 'c' => 10, 'd' => null],
schema(int_schema('a'), int_schema('b'), int_schema('c'), str_schema('d', nullable: true)),
));
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::LESS_THAN, ref('d')),
['a' => 100, 'b' => 100, 'c' => 10, 'd' => null],
schema(int_schema('a'), int_schema('b'), int_schema('c'), str_schema('d', nullable: true)),
));
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
new Comparison(ref('d'), Operator::LESS_THAN, ref('d')),
['a' => 100, 'b' => 100, 'c' => 10, 'd' => null],
schema(int_schema('a'), int_schema('b'), int_schema('c'), str_schema('d', nullable: true)),
));
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
new Comparison(ref('d'), Operator::LESS_THAN, ref('c')),
['a' => 100, 'b' => 100, 'c' => 10, 'd' => null],
schema(int_schema('a'), int_schema('b'), int_schema('c'), str_schema('d', nullable: true)),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::LESS_THAN, ref('b')),
['a' => 100, 'b' => 100, 'c' => 10, 'd' => null],
schema(int_schema('a'), int_schema('b'), int_schema('c'), str_schema('d', nullable: true)),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new Comparison(ref('c'), Operator::LESS_THAN_EQUAL, ref('a')),
['a' => 100, 'b' => 100, 'c' => 10, 'd' => null],
schema(int_schema('a'), int_schema('b'), int_schema('c'), str_schema('d', nullable: true)),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::LESS_THAN_EQUAL, ref('b')),
['a' => 100, 'b' => 100, 'c' => 10, 'd' => null],
schema(int_schema('a'), int_schema('b'), int_schema('c'), str_schema('d', nullable: true)),
));
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::LESS_THAN_EQUAL, ref('d')),
['a' => 100, 'b' => 100, 'c' => 10, 'd' => null],
schema(int_schema('a'), int_schema('b'), int_schema('c'), str_schema('d', nullable: true)),
));
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
new Comparison(ref('d'), Operator::LESS_THAN_EQUAL, ref('c')),
['a' => 100, 'b' => 100, 'c' => 10, 'd' => null],
schema(int_schema('a'), int_schema('b'), int_schema('c'), str_schema('d', nullable: true)),
));
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
new Comparison(ref('d'), Operator::LESS_THAN_EQUAL, ref('d')),
['a' => 100, 'b' => 100, 'c' => 10, 'd' => null],
schema(int_schema('a'), int_schema('b'), int_schema('c'), str_schema('d', nullable: true)),
@@ -544,7 +544,7 @@ public function test_less_than(): void
public function test_less_than_equal_with_null_in_strict_mode(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::LESS_THAN_EQUAL, ref('d')),
['a' => 100, 'd' => null],
schema(int_schema('a'), str_schema('d', nullable: true)),
@@ -553,7 +553,7 @@ public function test_less_than_equal_with_null_in_strict_mode(): void
public function test_less_than_with_null_in_strict_mode(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::LESS_THAN, ref('d')),
['a' => 100, 'd' => null],
schema(int_schema('a'), str_schema('d', nullable: true)),
@@ -562,12 +562,12 @@ public function test_less_than_with_null_in_strict_mode(): void
public function test_not_equals(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::NOT_EQUAL, ref('b')),
['a' => 100, 'b' => 100, 'c' => 10],
schema(int_schema('a'), int_schema('b'), int_schema('c')),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::NOT_EQUAL, ref('c')),
['a' => 100, 'b' => 100, 'c' => 10],
schema(int_schema('a'), int_schema('b'), int_schema('c')),
@@ -576,12 +576,12 @@ public function test_not_equals(): void
public function test_not_same(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::NOT_IDENTICAL, ref('c')),
['a' => 100, 'b' => 100, 'c' => 10],
schema(int_schema('a'), int_schema('b'), int_schema('c')),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::NOT_IDENTICAL, ref('b')),
['a' => 100, 'b' => 100, 'c' => 10],
schema(int_schema('a'), int_schema('b'), int_schema('c')),
@@ -590,32 +590,32 @@ public function test_not_same(): void
public function test_null(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
new IsNull(ref('a')),
['a' => 100, 'b' => null],
schema(int_schema('a'), str_schema('b', nullable: true)),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new IsNull(ref('b')),
['a' => 100, 'b' => null],
schema(int_schema('a'), str_schema('b', nullable: true)),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new IsNotNull(ref('a')),
['a' => 100, 'b' => null],
schema(int_schema('a'), str_schema('b', nullable: true)),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
new IsNotNull(ref('b')),
['a' => 100, 'b' => null],
schema(int_schema('a'), str_schema('b', nullable: true)),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new IsNull(lit(null)),
['a' => 100, 'b' => null],
schema(int_schema('a'), str_schema('b', nullable: true)),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new IsNotNull(lit(1000)),
['a' => 100, 'b' => null],
schema(int_schema('a'), str_schema('b', nullable: true)),
@@ -624,7 +624,7 @@ public function test_null(): void
public function test_same(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::IDENTICAL, ref('b')),
[
'a' => 100,
@@ -636,7 +636,7 @@ public function test_same(): void
schema(int_schema('a'), int_schema('b'), int_schema('c'), datetime_schema('d'), datetime_schema('e')),
));
// two datetimes of the same instant are the same value
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new Comparison(ref('d'), Operator::IDENTICAL, ref('e')),
[
'a' => 100,
@@ -647,7 +647,7 @@ public function test_same(): void
],
schema(int_schema('a'), int_schema('b'), int_schema('c'), datetime_schema('d'), datetime_schema('e')),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
new Comparison(ref('a'), Operator::IDENTICAL, ref('c')),
[
'a' => 100,
@@ -662,7 +662,7 @@ public function test_same(): void
public function test_starts_ends_with(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new StartsWith(ref('a'), lit('some not')),
[
'a' => 'some not too long string',
@@ -672,7 +672,7 @@ public function test_starts_ends_with(): void
],
schema(str_schema('a'), str_schema('b'), str_schema('c'), str_schema('d')),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new EndsWith(ref('a'), lit('long string')),
[
'a' => 'some not too long string',
@@ -682,7 +682,7 @@ public function test_starts_ends_with(): void
],
schema(str_schema('a'), str_schema('b'), str_schema('c'), str_schema('d')),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new StartsWith(ref('b'), ref('c')),
[
'a' => 'some not too long string',
@@ -692,7 +692,7 @@ public function test_starts_ends_with(): void
],
schema(str_schema('a'), str_schema('b'), str_schema('c'), str_schema('d')),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new EndsWith(ref('b'), ref('d')),
[
'a' => 'some not too long string',
@@ -702,7 +702,7 @@ public function test_starts_ends_with(): void
],
schema(str_schema('a'), str_schema('b'), str_schema('c'), str_schema('d')),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
new Contains(ref('a'), lit('too long')),
[
'a' => 'some not too long string',
@@ -712,7 +712,7 @@ public function test_starts_ends_with(): void
],
schema(str_schema('a'), str_schema('b'), str_schema('c'), str_schema('d')),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
new Contains(ref('a'), lit('blablabla')),
[
'a' => 'some not too long string',
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BinaryLengthTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BinaryLengthTest.php
index 8853decdae..1fdf4e5efa 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BinaryLengthTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BinaryLengthTest.php
@@ -17,7 +17,7 @@ final class BinaryLengthTest extends FlowTestCase
{
public function test_binary_length_ascii_string(): void
{
- static::assertSame(5, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(5, new FunctionContext(flow_context())->eval(
ref('str')->binaryLength(),
['str' => 'hello'],
schema(str_schema('str')),
@@ -26,7 +26,7 @@ public function test_binary_length_ascii_string(): void
public function test_binary_length_binary_data(): void
{
- static::assertSame(5, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(5, new FunctionContext(flow_context())->eval(
ref('str')->binaryLength(),
['str' => "\x00\x01\x02\x03\xFF"],
schema(str_schema('str')),
@@ -35,7 +35,7 @@ public function test_binary_length_binary_data(): void
public function test_binary_length_empty_string(): void
{
- static::assertSame(0, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(0, new FunctionContext(flow_context())->eval(
ref('str')->binaryLength(),
['str' => ''],
schema(str_schema('str')),
@@ -47,7 +47,7 @@ public function test_binary_length_throws_on_null_input(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('BinaryLength function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->binaryLength(),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -56,7 +56,7 @@ public function test_binary_length_throws_on_null_input(): void
public function test_binary_length_string_with_newlines_and_tabs(): void
{
- static::assertSame(12, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(12, new FunctionContext(flow_context())->eval(
ref('str')->binaryLength(),
['str' => "hello\nworld\t"],
schema(str_schema('str')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CallUserFuncTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CallUserFuncTest.php
index 4c4d2efc36..3f9b5817f5 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CallUserFuncTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CallUserFuncTest.php
@@ -31,9 +31,9 @@ final class CallUserFuncTest extends FlowTestCase
{
public function test_children_are_a_list_for_named_parameters(): void
{
- static::assertEquals([lit('strval'), ref('integer')], (new CallUserFunc(lit('strval'), type_string(), [
+ static::assertEquals([lit('strval'), ref('integer')], new CallUserFunc(lit('strval'), type_string(), [
'value' => ref('integer'),
- ]))->children());
+ ])->children());
}
public function test_it_is_never_deterministic(): void
@@ -50,19 +50,15 @@ public function test_named_parameters_survive_a_rebuild(): void
$rebuilt = $function->withChildren($function->children());
static::assertEquals(
- (new FunctionContext(flow_context()))->eval($function, [], schema()),
- (new FunctionContext(flow_context()))->eval($rebuilt, [], schema()),
+ new FunctionContext(flow_context())->eval($function, [], schema()),
+ new FunctionContext(flow_context())->eval($rebuilt, [], schema()),
);
- static::assertEquals(['1', '2', '3'], (new FunctionContext(flow_context()))->eval($rebuilt, [], schema()));
+ static::assertEquals(['1', '2', '3'], new FunctionContext(flow_context())->eval($rebuilt, [], schema()));
}
public function test_call_user_func_as_dsl(): void
{
- static::assertIsInt((new FunctionContext(flow_context()))->eval(
- call(lit('time'), type_integer()),
- [],
- schema(),
- ));
+ static::assertIsInt(new FunctionContext(flow_context())->eval(call(lit('time'), type_integer()), [], schema()));
}
public function test_a_non_scalar_function_cannot_replace_the_callable_child(): void
@@ -77,7 +73,7 @@ public function test_a_non_scalar_function_cannot_replace_the_callable_child():
public function test_call_user_func_with_array_callable(): void
{
- static::assertSame(3, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(3, new FunctionContext(flow_context())->eval(
ref('list')->call(lit([new StaticCalculator(), 'count']), type_integer()),
['list' => [
1,
@@ -90,7 +86,7 @@ public function test_call_user_func_with_array_callable(): void
public function test_call_user_func_with_native_function(): void
{
- static::assertSame(3, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(3, new FunctionContext(flow_context())->eval(
ref('list')->call(lit('count'), type_integer()),
['list' => [1, 2, 3]],
schema(list_schema('list', type_list(type_integer()))),
@@ -101,7 +97,7 @@ public function test_call_user_func_with_ref_alias_and_optional_arguments(): voi
{
static::assertEquals(
['1', '2', '3'],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('item_ids')->call(
lit('explode'),
type_list(type_string()),
@@ -118,7 +114,7 @@ public function test_call_user_func_with_ref_alias_and_optional_arguments_and_re
{
static::assertEquals(
[1, 2, 3],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('item_ids')->call(
lit('explode'),
type_list(type_integer()),
@@ -133,7 +129,7 @@ public function test_call_user_func_with_ref_alias_and_optional_arguments_and_re
public function test_call_user_func_with_static_method(): void
{
- static::assertSame(3, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(3, new FunctionContext(flow_context())->eval(
ref('list')->call(lit(StaticCalculator::class . '::count'), type_integer()),
['list' => [1, 2, 3]],
schema(list_schema('list', type_list(type_integer()))),
@@ -142,17 +138,17 @@ public function test_call_user_func_with_static_method(): void
public function test_a_callable_that_can_return_null_declares_a_nullable_column(): void
{
- static::assertSame('?string', (new CallUserFunc(lit('strtoupper'), type_string(), [ref(
+ static::assertSame('?string', new CallUserFunc(lit('strtoupper'), type_string(), [ref(
'name',
- )]))->returns()->toString());
+ )])->returns()->toString());
}
public function test_a_null_return_lands_in_a_nullable_column(): void
{
- $result = (new ScalarFunctionTransformer(
+ $result = new ScalarFunctionTransformer(
'out',
new CallUserFunc(lit([StaticCalculator::class, 'alwaysNull']), type_string(), []),
- ))->transform(array_to_rows([['name' => 'a']], schema(str_schema('name'))), flow_context()->backend());
+ )->transform(array_to_rows([['name' => 'a']], schema(str_schema('name'))), flow_context()->backend());
static::assertTrue($result->schema()->get('out')->isNullable());
static::assertNull($result->column('out')->value(0));
@@ -178,7 +174,7 @@ public function test_named_parameters_out_of_signature_order_survive_a_rebuild()
static::assertEquals(
['1', '2', '3'],
- (new FunctionContext(flow_context()))->eval($function->withChildren($function->children()), [], schema()),
+ new FunctionContext(flow_context())->eval($function->withChildren($function->children()), [], schema()),
);
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CapitalizeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CapitalizeTest.php
index bd6b5d571d..96ecd333da 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CapitalizeTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CapitalizeTest.php
@@ -18,7 +18,7 @@ final class CapitalizeTest extends FlowTestCase
{
public function test_capitalize_valid_string(): void
{
- static::assertSame('This Is A Value', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('This Is A Value', new FunctionContext(flow_context())->eval(
ref('string')->capitalize(),
['string' => 'this is a value'],
schema(str_schema('string')),
@@ -27,7 +27,7 @@ public function test_capitalize_valid_string(): void
public function test_capitalize_multibyte_words(): void
{
- static::assertSame('Żółw Ćma', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('Żółw Ćma', new FunctionContext(flow_context())->eval(
ref('string')->capitalize(),
['string' => 'żółw ćma'],
schema(str_schema('string')),
@@ -36,7 +36,7 @@ public function test_capitalize_multibyte_words(): void
public function test_capitalize_an_integer(): void
{
- static::assertSame('12', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('12', new FunctionContext(flow_context())->eval(
ref('number')->capitalize(),
['number' => 12],
schema(int_schema('number')),
@@ -48,7 +48,7 @@ public function test_capitalize_on_null(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Capitalize function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('string')->capitalize(),
['string' => null],
schema(str_schema('string', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CastTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CastTest.php
index 3449ef799d..c5349433d5 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CastTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CastTest.php
@@ -58,7 +58,7 @@ public function test_cast_of_a_null_value_throws(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Cast function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
cast(ref('value'), 'int'),
[
'value' => null,
@@ -80,7 +80,7 @@ public function test_casting_a_datetime_column_to_string_equals_casting_each_val
type_string()->cast($rows[0]['at']->setTimezone(new DateTimeZone($zone))),
type_string()->cast($rows[1]['at']->setTimezone(new DateTimeZone($zone))),
],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(cast(ref('at'), 'string'), $rows, schema(datetime_schema('at', zone: $zone)))
->values(),
);
@@ -91,7 +91,7 @@ public function test_casting_a_date_column_to_string(): void
{
static::assertSame(
['2026-01-02T00:00:00+00:00', null],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
cast(ref('on'), type_optional(type_string())),
[['on' => new DateTimeImmutable('2026-01-02')], ['on' => null]],
@@ -104,7 +104,7 @@ public function test_casting_a_date_column_to_string(): void
public function test_casting_a_null_datetime_to_string_is_refused_with_its_row_index(): void
{
try {
- (new FunctionContext(flow_context()))->column(
+ new FunctionContext(flow_context())->column(
cast(ref('at'), 'string'),
[['at' => new DateTimeImmutable('2026-01-02')], ['at' => null]],
schema(datetime_schema('at', nullable: true)),
@@ -121,7 +121,7 @@ public function test_casting_a_string_column_to_string_keeps_its_values(): void
{
static::assertSame(
['a', ''],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(cast(ref('s'), 'string'), [['s' => 'a'], ['s' => '']], schema(str_schema('s')))
->values(),
);
@@ -131,7 +131,7 @@ public function test_casting_a_nullable_string_column_to_an_optional_string(): v
{
static::assertSame(
['a', null],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
cast(ref('s'), type_optional(type_string())),
[['s' => 'a'], ['s' => null]],
@@ -144,7 +144,7 @@ public function test_casting_a_nullable_string_column_to_an_optional_string(): v
public function test_casting_a_null_string_to_string_is_refused_with_its_row_index(): void
{
try {
- (new FunctionContext(flow_context()))->column(
+ new FunctionContext(flow_context())->column(
cast(ref('s'), 'string'),
[['s' => 'a'], ['s' => null]],
schema(str_schema('s', nullable: true)),
@@ -163,7 +163,7 @@ public function test_casting_a_uuid_column_to_string_equals_casting_each_value()
static::assertSame(
[type_string()->cast($uuids[0]), type_string()->cast($uuids[1])],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(cast(ref('u'), 'string'), [['u' => $uuids[0]], ['u' => $uuids[1]]], schema(uuid_schema('u')))
->values(),
);
@@ -173,7 +173,7 @@ public function test_casting_a_null_uuid_to_an_optional_string_is_null(): void
{
static::assertSame(
['9b9b7c1e-0d4f-4a0b-8f3a-1b2c3d4e5f60', null],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
cast(ref('u'), type_optional(type_string())),
[['u' => new Uuid('9b9b7c1e-0d4f-4a0b-8f3a-1b2c3d4e5f60')], ['u' => null]],
@@ -186,7 +186,7 @@ public function test_casting_a_null_uuid_to_an_optional_string_is_null(): void
public function test_casting_a_null_uuid_to_string_is_refused_with_its_row_index(): void
{
try {
- (new FunctionContext(flow_context()))->column(
+ new FunctionContext(flow_context())->column(
cast(ref('u'), 'string'),
[['u' => new Uuid('9b9b7c1e-0d4f-4a0b-8f3a-1b2c3d4e5f60')], ['u' => null]],
schema(uuid_schema('u', nullable: true)),
@@ -203,7 +203,7 @@ public function test_casting_a_string_column_to_string_asks_the_backend_for_no_b
{
$schema = schema(str_schema('s'));
$backend = new SpyBackend();
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(cast(ref('s'), 'string'), $schema)
->eval(array_to_rows([['s' => 'a']], $schema, new PhpBackend()), $backend);
@@ -217,7 +217,7 @@ public function test_a_cast_to_string_evaluates_its_child_once(): void
static::assertSame(
['1', '2'],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(cast($spy, 'string'), [['v' => 1], ['v' => 2]], schema(int_schema('v')))
->values(),
);
@@ -226,7 +226,7 @@ public function test_a_cast_to_string_evaluates_its_child_once(): void
public function test_cast_of_a_null_value_to_an_optional_target_is_null(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
cast(ref('value'), type_optional(type_integer())),
[
'value' => null,
@@ -238,7 +238,7 @@ public function test_cast_of_a_null_value_to_an_optional_target_is_null(): void
public function test_a_refused_cast_keeps_the_casting_error_as_the_cause(): void
{
try {
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
cast(ref('value'), type_optional(type_datetime())),
['value' => 'abc'],
schema(str_schema('value')),
@@ -254,7 +254,7 @@ public function test_casting_an_unconvertible_value_to_an_optional_target_throws
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Cast function failed: Can\'t cast "string" into "datetime" type');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
cast(ref('value'), type_optional(type_datetime())),
[
'value' => 'abc',
@@ -273,14 +273,14 @@ public function test_constructor_rejects_a_non_representable_target(): void
public function test_double_and_real_resolve_to_float(): void
{
- static::assertSame(1.0, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(1.0, new FunctionContext(flow_context())->eval(
cast(ref('value'), 'double'),
[
'value' => '1',
],
schema(str_schema('value')),
));
- static::assertSame(1.0, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(1.0, new FunctionContext(flow_context())->eval(
cast(ref('value'), 'real'),
[
'value' => '1',
@@ -401,13 +401,13 @@ public static function cast_provider(): array
public function test_cast(mixed $from, Definition $definition, string $to, mixed $expected): void
{
// @mago-ignore analysis:mixed-assignment
- $resultRefCast = (new FunctionContext(flow_context()))->eval(
+ $resultRefCast = new FunctionContext(flow_context())->eval(
ref('value')->cast($to),
['value' => $from],
schema($definition),
);
// @mago-ignore analysis:mixed-assignment
- $resultCastRef = (new FunctionContext(flow_context()))->eval(
+ $resultCastRef = new FunctionContext(flow_context())->eval(
cast(ref('value'), $to),
['value' => $from],
schema($definition),
@@ -429,7 +429,7 @@ public function test_casting_a_scalar_to_array_names_the_remedy(): void
'Cast function failed: Can\'t cast "string" into "array" type: wrap the value first, e.g. type_list(type_string())',
);
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->cast('array'),
['value' => '1'],
schema(str_schema('value')),
@@ -441,7 +441,7 @@ public function test_casting_integer_to_timezone(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Cast function failed: Can\'t cast "int" into "timezone" type');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->cast('timezone'),
['value' => 123],
schema(int_schema('value')),
@@ -453,7 +453,7 @@ public function test_casting_integer_to_xml(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Cast function failed: Can\'t cast "int" into "xml" type');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->cast('xml'),
['value' => 1],
schema(int_schema('value')),
@@ -465,7 +465,7 @@ public function test_casting_invalid_string_to_timezone(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Cast function failed: Can\'t cast "string" into "timezone" type');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->cast('timezone'),
['value' => 'invalid-timezone'],
schema(str_schema('value')),
@@ -477,7 +477,7 @@ public function test_casting_non_xml_string_to_xml(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Cast function failed: Can\'t cast "string" into "xml" type');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->cast('xml'),
['value' => 'foo'],
schema(str_schema('value')),
@@ -512,7 +512,7 @@ public function test_a_rejected_target_keeps_the_definition_error_as_the_cause()
public function test_casting_an_xml_column_to_string_keeps_the_document_text(): void
{
- static::assertSame('a', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('a', new FunctionContext(flow_context())->eval(
ref('value')->cast('string'),
['value' => 'a'],
schema(xml_schema('value')),
@@ -521,7 +521,7 @@ public function test_casting_an_xml_column_to_string_keeps_the_document_text():
public function test_casting_a_json_column_to_string_keeps_the_json_text(): void
{
- static::assertSame('{"a":1}', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('{"a":1}', new FunctionContext(flow_context())->eval(
ref('value')->cast('string'),
['value' => '{"a":1}'],
schema(json_schema('value')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ChunkTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ChunkTest.php
index 297bd17126..2eaa35cebe 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ChunkTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ChunkTest.php
@@ -20,7 +20,7 @@ public function test_chunk_empty_string(): void
{
static::assertSame(
[],
- (new FunctionContext(flow_context()))->eval(ref('str')->chunk(3), ['str' => ''], schema(str_schema('str'))),
+ new FunctionContext(flow_context())->eval(ref('str')->chunk(3), ['str' => ''], schema(str_schema('str'))),
);
}
@@ -28,7 +28,7 @@ public function test_chunk_equal_to_string_length(): void
{
static::assertSame(
['hello'],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->chunk(5),
['str' => 'hello'],
schema(str_schema('str')),
@@ -40,7 +40,7 @@ public function test_chunk_larger_than_string_length(): void
{
static::assertSame(
['hello'],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->chunk(10),
['str' => 'hello'],
schema(str_schema('str')),
@@ -53,11 +53,7 @@ public function test_chunk_negative_size(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Chunk function requires non-null, positive size');
- (new FunctionContext(flow_context()))->eval(
- ref('str')->chunk(-1),
- ['str' => 'hello'],
- schema(str_schema('str')),
- );
+ new FunctionContext(flow_context())->eval(ref('str')->chunk(-1), ['str' => 'hello'], schema(str_schema('str')));
}
public function test_chunk_null_input(): void
@@ -65,7 +61,7 @@ public function test_chunk_null_input(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Chunk function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->chunk(3),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -76,7 +72,7 @@ public function test_chunk_string_basic_functionality(): void
{
static::assertSame(
['hel', 'lo '],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->chunk(3),
['str' => 'hello '],
schema(str_schema('str')),
@@ -89,7 +85,7 @@ public function test_chunk_with_null_size(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Chunk function requires non-null, positive size');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->chunk(ref('size')),
['str' => 'hello', 'size' => null],
schema(str_schema('str'), str_schema('size', nullable: true)),
@@ -100,7 +96,7 @@ public function test_chunk_with_scalar_function_size(): void
{
static::assertSame(
['he', 'll', 'o'],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->chunk(ref('size')),
['str' => 'hello', 'size' => 2],
schema(str_schema('str'), int_schema('size')),
@@ -113,10 +109,6 @@ public function test_chunk_zero_size(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Chunk function requires non-null, positive size');
- (new FunctionContext(flow_context()))->eval(
- ref('str')->chunk(0),
- ['str' => 'hello'],
- schema(str_schema('str')),
- );
+ new FunctionContext(flow_context())->eval(ref('str')->chunk(0), ['str' => 'hello'], schema(str_schema('str')));
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CoalesceTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CoalesceTest.php
index 332e393317..8302ab9725 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CoalesceTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CoalesceTest.php
@@ -33,13 +33,13 @@ final class CoalesceTest extends FlowTestCase
{
public function test_children_of_named_values_are_a_list(): void
{
- static::assertTrue(array_is_list((new Coalesce(...['a' => lit(1), 'b' => lit(2)]))->children()));
+ static::assertTrue(array_is_list(new Coalesce(...['a' => lit(1), 'b' => lit(2)])->children()));
}
public function test_a_non_nullable_branch_makes_the_result_not_nullable(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(
+ $resolved = new ReferenceResolver()->resolve(
coalesce(ref('name'), lit('N/A')),
schema(str_schema('name', nullable: true)),
);
@@ -50,7 +50,7 @@ public function test_a_non_nullable_branch_makes_the_result_not_nullable(): void
public function test_coalesce_entries(): void
{
// coalesce() of string and integer declares string: the value is cast to it
- static::assertSame('1', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('1', new FunctionContext(flow_context())->eval(
coalesce(ref('name'), ref('id'), lit('N/A')),
[
'name' => null,
@@ -62,7 +62,7 @@ public function test_coalesce_entries(): void
public function test_coalesce_on_null_entries_falls_through_to_lit(): void
{
- static::assertSame('N/A', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('N/A', new FunctionContext(flow_context())->eval(
coalesce(ref('name'), ref('string'), lit('N/A')),
[
'name' => null,
@@ -75,7 +75,7 @@ public function test_coalesce_on_null_entries_falls_through_to_lit(): void
public function test_coalesce_on_ref(): void
{
// coalesce() of string and integer declares string: the value is cast to it
- static::assertSame('1', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('1', new FunctionContext(flow_context())->eval(
ref('name')->coalesce(ref('id'), lit('N/A')),
['name' => null, 'id' => 1],
schema(str_schema('name', nullable: true), int_schema('id')),
@@ -86,7 +86,7 @@ public function test_a_throwing_branch_is_not_swallowed(): void
{
$this->expectException(InvalidArgumentException::class);
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
coalesce(ref('a')->upper(), ref('b')->upper()),
['a' => 1, 'b' => 2],
schema(int_schema('a'), int_schema('b')),
@@ -102,7 +102,7 @@ public function test_an_unreached_argument_that_would_throw_is_not_evaluated():
static::assertSame(
[1, 2],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(coalesce(ref('a'), new FailingOnValuesFunction(ref('v'), [99])), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
@@ -118,7 +118,7 @@ public function test_a_null_row_keeps_later_rows_of_the_first_argument(): void
static::assertSame(
[5, 1],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(coalesce(ref('a'), ref('b')), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
@@ -130,7 +130,7 @@ public function test_branches_without_a_common_type_refuse_to_declare(): void
$this->expectException(InvalidTypeException::class);
$this->expectExceptionMessage('Cannot combine types "integer", "list" - an explicit cast is required.');
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
coalesce(ref('integer'), ref('list')),
schema(int_schema('integer'), list_schema('list', type_list(type_string()))),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CodePointLengthTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CodePointLengthTest.php
index 7df8be093a..a0de3d8082 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CodePointLengthTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CodePointLengthTest.php
@@ -17,7 +17,7 @@ final class CodePointLengthTest extends FlowTestCase
{
public function test_code_point_length_ascii_string(): void
{
- static::assertSame(5, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(5, new FunctionContext(flow_context())->eval(
ref('str')->codePointLength(),
['str' => 'hello'],
schema(str_schema('str')),
@@ -26,7 +26,7 @@ public function test_code_point_length_ascii_string(): void
public function test_code_point_length_empty_string(): void
{
- static::assertSame(0, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(0, new FunctionContext(flow_context())->eval(
ref('str')->codePointLength(),
['str' => ''],
schema(str_schema('str')),
@@ -38,7 +38,7 @@ public function test_code_point_length_throws_on_null_input(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('CodePointLength function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->codePointLength(),
['str' => null],
schema(str_schema('str', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CollapseWhitespaceTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CollapseWhitespaceTest.php
index 257e45e3a5..923ca18e2c 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CollapseWhitespaceTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CollapseWhitespaceTest.php
@@ -17,7 +17,7 @@ final class CollapseWhitespaceTest extends FlowTestCase
{
public function test_empty_string(): void
{
- static::assertEquals('', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('', new FunctionContext(flow_context())->eval(
ref('str')->collapseWhitespace(),
['str' => ''],
schema(str_schema('str')),
@@ -26,7 +26,7 @@ public function test_empty_string(): void
public function test_leading_and_trailing_whitespace(): void
{
- static::assertEquals('Hello world', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('Hello world', new FunctionContext(flow_context())->eval(
ref('str')->collapseWhitespace(),
['str' => ' Hello world '],
schema(str_schema('str')),
@@ -35,7 +35,7 @@ public function test_leading_and_trailing_whitespace(): void
public function test_leading_whitespace(): void
{
- static::assertEquals('Hello world', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('Hello world', new FunctionContext(flow_context())->eval(
ref('str')->collapseWhitespace(),
['str' => ' Hello world'],
schema(str_schema('str')),
@@ -44,7 +44,7 @@ public function test_leading_whitespace(): void
public function test_mixed_whitespace_types(): void
{
- static::assertEquals('Hello world test', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('Hello world test', new FunctionContext(flow_context())->eval(
ref('str')->collapseWhitespace(),
['str' => "Hello\t\tworld\n\ntest"],
schema(str_schema('str')),
@@ -53,7 +53,7 @@ public function test_mixed_whitespace_types(): void
public function test_multiple_spaces_between_words(): void
{
- static::assertEquals('Hello world test', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('Hello world test', new FunctionContext(flow_context())->eval(
ref('str')->collapseWhitespace(),
['str' => 'Hello world test'],
schema(str_schema('str')),
@@ -65,7 +65,7 @@ public function test_null_value(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('CollapseWhitespace function requires non-null value');
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('str')->collapseWhitespace(),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -74,7 +74,7 @@ public function test_null_value(): void
public function test_single_spaces(): void
{
- static::assertEquals('Hello world test', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('Hello world test', new FunctionContext(flow_context())->eval(
ref('str')->collapseWhitespace(),
['str' => 'Hello world test'],
schema(str_schema('str')),
@@ -83,7 +83,7 @@ public function test_single_spaces(): void
public function test_single_word(): void
{
- static::assertEquals('Hello', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('Hello', new FunctionContext(flow_context())->eval(
ref('str')->collapseWhitespace(),
['str' => 'Hello'],
schema(str_schema('str')),
@@ -92,7 +92,7 @@ public function test_single_word(): void
public function test_trailing_whitespace(): void
{
- static::assertEquals('Hello world', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('Hello world', new FunctionContext(flow_context())->eval(
ref('str')->collapseWhitespace(),
['str' => 'Hello world '],
schema(str_schema('str')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CollectTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CollectTest.php
index f6e31249ab..75113de76c 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CollectTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CollectTest.php
@@ -89,7 +89,7 @@ public function test_a_nullable_source_column_yields_a_nullable_element_type():
{
static::assertSame(
'?list',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(collect(ref('v')), schema(int_schema('v', true)))
->returns()
->toString(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CombineTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CombineTest.php
index 02cab70399..9388e28e5f 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CombineTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CombineTest.php
@@ -27,7 +27,7 @@ final class CombineTest extends FlowTestCase
public function test_operands_that_are_not_lists_are_refused_at_bind(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(
+ $resolved = new ReferenceResolver()->resolve(
combine(ref('keys'), ref('values')),
schema(list_schema('keys', type_list(type_string())), str_schema('values')),
);
@@ -42,20 +42,20 @@ public function test_array_combine(): void
{
static::assertSame(
['a' => 1, 'b' => 2, 'c' => 3],
- (new FunctionContext(flow_context()))->eval(combine(lit(['a', 'b', 'c']), lit([1, 2, 3])), [], schema()),
+ new FunctionContext(flow_context())->eval(combine(lit(['a', 'b', 'c']), lit([1, 2, 3])), [], schema()),
);
}
public function test_array_combine_when_arrays_are_empty(): void
{
- static::assertSame([], (new FunctionContext(flow_context()))->eval(combine(lit([]), lit([])), [], schema()));
+ static::assertSame([], new FunctionContext(flow_context())->eval(combine(lit([]), lit([])), [], schema()));
}
public function test_an_empty_row_keeps_the_rows_after_it(): void
{
static::assertSame(
[[], ['a' => 1]],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
combine(ref('keys'), ref('values')),
[['keys' => [], 'values' => []], ['keys' => ['a'], 'values' => [1]]],
@@ -73,14 +73,14 @@ public function test_array_combine_when_keys_are_not_array(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "array", got "string".');
- (new FunctionContext(flow_context()))->eval(combine(lit('a'), lit([1, 2, 3])), [], schema());
+ new FunctionContext(flow_context())->eval(combine(lit('a'), lit([1, 2, 3])), [], schema());
}
public function test_array_combine_when_keys_are_not_unique(): void
{
static::assertSame(
['a' => 4, 'b' => 2, 'c' => 3],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
combine(lit(['a', 'b', 'c', 'a']), lit([1, 2, 3, 4])),
[],
schema(),
@@ -93,14 +93,14 @@ public function test_array_combine_when_one_of_arrays_is_empty(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Combine function requires keys and values arrays to have the same length');
- (new FunctionContext(flow_context()))->eval(combine(lit(['a', 'b', 'c']), lit([])), [], schema());
+ new FunctionContext(flow_context())->eval(combine(lit(['a', 'b', 'c']), lit([])), [], schema());
}
public function test_array_combine_with_a_single_key(): void
{
static::assertSame(
['a' => 1],
- (new FunctionContext(flow_context()))->eval(combine(lit(['a']), lit([1])), [], schema()),
+ new FunctionContext(flow_context())->eval(combine(lit(['a']), lit([1])), [], schema()),
);
}
@@ -109,7 +109,7 @@ public function test_array_combine_when_keys_are_null(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Combine function requires non-null arrays');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
combine(ref('keys'), ref('values')),
['keys' => null, 'values' => [1]],
schema(
@@ -124,7 +124,7 @@ public function test_array_combine_when_first_key_is_a_float_and_second_an_integ
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Combine function requires keys to be strings or integers');
- (new FunctionContext(flow_context()))->eval(combine(lit([1.5, 2]), lit([1, 2])), [], schema());
+ new FunctionContext(flow_context())->eval(combine(lit([1.5, 2]), lit([1, 2])), [], schema());
}
public function test_array_combine_when_the_only_key_is_a_float(): void
@@ -132,7 +132,7 @@ public function test_array_combine_when_the_only_key_is_a_float(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Combine function requires keys to be strings or integers');
- (new FunctionContext(flow_context()))->eval(combine(lit([1.5]), lit([1])), [], schema());
+ new FunctionContext(flow_context())->eval(combine(lit([1.5]), lit([1])), [], schema());
}
public function test_array_combine_when_a_later_key_is_a_float(): void
@@ -140,7 +140,7 @@ public function test_array_combine_when_a_later_key_is_a_float(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Combine function requires keys to be strings or integers');
- (new FunctionContext(flow_context()))->eval(combine(lit(['a', 1.5]), lit([1, 2])), [], schema());
+ new FunctionContext(flow_context())->eval(combine(lit(['a', 1.5]), lit([1, 2])), [], schema());
}
public function test_array_combine_when_a_later_key_is_a_boolean(): void
@@ -148,6 +148,6 @@ public function test_array_combine_when_a_later_key_is_a_boolean(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Combine function requires keys to be strings or integers');
- (new FunctionContext(flow_context()))->eval(combine(lit(['a', true]), lit([1, 2])), [], schema());
+ new FunctionContext(flow_context())->eval(combine(lit(['a', true]), lit([1, 2])), [], schema());
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ComparisonTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ComparisonTest.php
index d0c82fa5a5..b9c983cdf7 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ComparisonTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ComparisonTest.php
@@ -66,12 +66,12 @@ public function test_refuses_an_operator_that_does_not_compare_two_values(Operat
public function test_equality_casts_a_temporal_string(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('d')->equals(lit('2024-01-01')),
['d' => new DateTimeImmutable('2024-01-01')],
schema(date_schema('d')),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
ref('d')->notEquals(lit('2024-01-01')),
['d' => new DateTimeImmutable('2024-01-01')],
schema(date_schema('d')),
@@ -89,7 +89,7 @@ public function test_identity_refuses_a_temporal_string(Operator $operator): voi
. " string)' due to data type mismatch - an explicit cast is required.",
);
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(new Comparison(ref('d'), $operator, lit('2024-01-01')), schema(date_schema('d')))
->returns();
}
@@ -99,7 +99,7 @@ public function test_a_cast_error_names_the_column_read_never_the_alias(): void
$this->expectException(EvaluationException::class);
$this->expectExceptionMessage("Column \"a\" value 'x' cannot be cast to integer to compare");
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('a')->as('b')->equals(lit(1)),
['a' => 'x'],
schema(str_schema('a')),
@@ -110,7 +110,7 @@ public function test_a_cast_error_names_the_column_read_never_the_alias(): void
public function test_a_cast_error_message(Backend $backend): void
{
try {
- (new FunctionContext(flow_context(config_builder()->backend($backend)->build())))->eval(
+ new FunctionContext(flow_context(config_builder()->backend($backend)->build()))->eval(
ref('a')->equals(lit(1)),
['a' => 'x'],
schema(str_schema('a')),
@@ -126,12 +126,12 @@ public function test_a_cast_error_message(Backend $backend): void
public function test_negations_keep_null_unknown_and_identity_defined(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('a')->notEquals(lit(1)),
['a' => null],
schema(int_schema('a', nullable: true)),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('a')->notSame(lit(1)),
['a' => null],
schema(int_schema('a', nullable: true)),
@@ -140,12 +140,12 @@ public function test_negations_keep_null_unknown_and_identity_defined(): void
public function test_null_operand_yields_null(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('a')->equals(lit(1)),
['a' => null],
schema(str_schema('a', nullable: true)),
));
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('a')->equals(ref('b')),
['a' => null, 'b' => null],
schema(str_schema('a', nullable: true), str_schema('b', nullable: true)),
@@ -154,17 +154,17 @@ public function test_null_operand_yields_null(): void
public function test_equal_values(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('a')->equals(lit(1)),
['a' => 1],
schema(int_schema('a')),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('a')->equals(lit('x')),
['a' => 'x'],
schema(str_schema('a')),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
ref('a')->equals(lit(2)),
['a' => 1],
schema(int_schema('a')),
@@ -219,7 +219,7 @@ public static function values_of_one_type(): Generator
#[DataProvider('values_of_one_type')]
public function test_values_of_one_type_compare_by_value(Type $type, mixed $left, mixed $right, bool $equal): void
{
- static::assertSame($equal, (new FunctionContext(flow_context()))->eval(
+ static::assertSame($equal, new FunctionContext(flow_context())->eval(
ref('a')->equals(ref('b')),
['a' => $left, 'b' => $right],
schema(definition_from_type('a', $type), definition_from_type('b', $type)),
@@ -228,7 +228,7 @@ public function test_values_of_one_type_compare_by_value(Type $type, mixed $left
public function test_a_datetime_equals_a_literal_of_the_same_instant_in_another_zone(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('a')->equals(lit(new DateTimeImmutable('2024-01-01 13:00:00', new DateTimeZone('Europe/Warsaw')))),
['a' => new DateTimeImmutable('2024-01-01 12:00:00', new DateTimeZone('UTC'))],
schema(definition_from_type('a', type_datetime())),
@@ -240,7 +240,7 @@ public function test_a_uuid_is_not_comparable_with_a_string(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage("Can't compare '(uuid == string)' due to data type mismatch");
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('u')->equals(lit('00000000-0000-4000-8000-000000000001')),
schema(definition_from_type('u', type_uuid())),
@@ -251,12 +251,12 @@ public function test_a_uuid_is_not_comparable_with_a_string(): void
public function test_null_is_identical_to_null(): void
{
// PHP identity, not SQL equality - ->same() is the migration path for both-null checks.
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('a')->same(lit(null)),
['a' => null],
schema(str_schema('a', nullable: true)),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
ref('a')->same(lit(1)),
['a' => null],
schema(str_schema('a', nullable: true)),
@@ -303,7 +303,7 @@ public function test_identical_values_of_one_type_are_the_same_by_value(
mixed $right,
bool $same,
): void {
- static::assertSame($same, (new FunctionContext(flow_context()))->eval(
+ static::assertSame($same, new FunctionContext(flow_context())->eval(
ref('a')->same(ref('b')),
['a' => $left, 'b' => $right],
schema(definition_from_type('a', $type), definition_from_type('b', $type)),
@@ -313,7 +313,7 @@ public function test_identical_values_of_one_type_are_the_same_by_value(
public function test_an_integer_column_compared_to_a_string_literal_still_works(): void
{
// Comparator::comparable(integer, string) stays deliberately loose - 5 > '3' keeps working.
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('a')->greaterThan(lit('3')),
['a' => 5],
schema(int_schema('a')),
@@ -324,17 +324,17 @@ public function test_greater_than_arrays(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->greaterThan(lit([1, 0])),
['v' => [1, 9]],
schema(list_schema('v', type_list(type_integer()))),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->greaterThan(lit([1, 9])),
['v' => [1, 0]],
schema(list_schema('v', type_list(type_integer()))),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->greaterThan(lit([1, 0])),
['v' => [1, 0]],
schema(list_schema('v', type_list(type_integer()))),
@@ -345,21 +345,21 @@ public function test_greater_than_datetimes(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->greaterThan(lit(new DateTimeImmutable('2024-01-01'))),
[
'v' => new DateTimeImmutable('2024-06-01'),
],
schema(datetime_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->greaterThan(lit(new DateTimeImmutable('2024-01-01'))),
[
'v' => new DateTimeImmutable('2023-06-01'),
],
schema(datetime_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->greaterThan(lit(new DateTimeImmutable('2024-01-01'))),
[
'v' => new DateTimeImmutable('2024-01-01'),
@@ -372,17 +372,17 @@ public function test_greater_than_floats(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->greaterThan(lit(1.5)),
['v' => 2.5],
schema(float_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->greaterThan(lit(2.5)),
['v' => 1.5],
schema(float_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->greaterThan(lit(1.5)),
['v' => 1.5],
schema(float_schema('v')),
@@ -393,17 +393,17 @@ public function test_greater_than_integers(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->greaterThan(lit(10)),
['v' => 20],
schema(int_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->greaterThan(lit(20)),
['v' => 10],
schema(int_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->greaterThan(lit(10)),
['v' => 10],
schema(int_schema('v')),
@@ -412,7 +412,7 @@ public function test_greater_than_integers(): void
public function test_greater_than_returns_null_for_null_left(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->greaterThan(lit(10)),
['v' => null],
schema(str_schema('v', nullable: true)),
@@ -421,7 +421,7 @@ public function test_greater_than_returns_null_for_null_left(): void
public function test_greater_than_returns_null_for_null_right(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->greaterThan(ref('other')),
['v' => 10, 'other' => null],
schema(int_schema('v'), str_schema('other', nullable: true)),
@@ -430,7 +430,7 @@ public function test_greater_than_returns_null_for_null_right(): void
public function test_greater_than_returns_null_for_null_string(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->greaterThan(lit('a')),
['v' => null],
schema(str_schema('v', nullable: true)),
@@ -439,7 +439,7 @@ public function test_greater_than_returns_null_for_null_string(): void
public function test_greater_than_returns_null_for_null_datetime(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->greaterThan(lit(new DateTimeImmutable('2024-01-01'))),
['v' => null],
schema(datetime_schema('v', nullable: true)),
@@ -448,7 +448,7 @@ public function test_greater_than_returns_null_for_null_datetime(): void
public function test_greater_than_returns_null_for_null_time_interval(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->greaterThan(lit(new DateInterval('PT1H'))),
['v' => null],
schema(time_schema('v', nullable: true)),
@@ -457,7 +457,7 @@ public function test_greater_than_returns_null_for_null_time_interval(): void
public function test_greater_than_returns_null_for_null_array(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->greaterThan(lit([1, 0])),
['v' => null],
schema(list_schema('v', type_list(type_integer()), nullable: true)),
@@ -468,17 +468,17 @@ public function test_greater_than_strings(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->greaterThan(lit('apple')),
['v' => 'banana'],
schema(str_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->greaterThan(lit('banana')),
['v' => 'apple'],
schema(str_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->greaterThan(lit('apple')),
['v' => 'apple'],
schema(str_schema('v')),
@@ -496,17 +496,17 @@ public function test_greater_than_time_intervals(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->greaterThan(lit(new DateInterval('PT1H'))),
['v' => new DateInterval('PT5H')],
schema(time_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->greaterThan(lit(new DateInterval('PT5H'))),
['v' => new DateInterval('PT1H')],
schema(time_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->greaterThan(lit(new DateInterval('PT1H'))),
['v' => new DateInterval('PT1H')],
schema(time_schema('v')),
@@ -515,7 +515,7 @@ public function test_greater_than_time_intervals(): void
public function test_greater_than_orders_strings_by_bytes(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('a')->greaterThan(lit('10')),
['a' => '9'],
schema(str_schema('a')),
@@ -526,12 +526,12 @@ public function test_greater_than_orders_a_numeric_string_column_numerically():
{
$context = flow_context();
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('a')->greaterThan(lit('10')),
['a' => '9'],
schema(definition_from_type('a', type_numeric_string())),
));
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('a')->greaterThan(lit('18446744073709551614')),
['a' => '18446744073709551615'],
schema(definition_from_type('a', type_numeric_string())),
@@ -542,12 +542,12 @@ public function test_greater_than_ranks_nan_above_every_number(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('a')->greaterThan(lit(1.0)),
['a' => NAN],
schema(float_schema('a')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
lit(1.0)->greaterThan(ref('a')),
['a' => NAN],
schema(float_schema('a')),
@@ -558,17 +558,17 @@ public function test_greater_than_equal_arrays(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->greaterThanEqual(lit([1, 0])),
['v' => [1, 9]],
schema(list_schema('v', type_list(type_integer()))),
));
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->greaterThanEqual(lit([1, 0])),
['v' => [1, 0]],
schema(list_schema('v', type_list(type_integer()))),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->greaterThanEqual(lit([1, 9])),
['v' => [1, 0]],
schema(list_schema('v', type_list(type_integer()))),
@@ -579,21 +579,21 @@ public function test_greater_than_equal_datetimes(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->greaterThanEqual(lit(new DateTimeImmutable('2024-01-01'))),
[
'v' => new DateTimeImmutable('2024-06-01'),
],
schema(datetime_schema('v')),
));
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->greaterThanEqual(lit(new DateTimeImmutable('2024-01-01'))),
[
'v' => new DateTimeImmutable('2024-01-01'),
],
schema(datetime_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->greaterThanEqual(lit(new DateTimeImmutable('2024-06-01'))),
[
'v' => new DateTimeImmutable('2024-01-01'),
@@ -606,17 +606,17 @@ public function test_greater_than_equal_floats(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->greaterThanEqual(lit(1.5)),
['v' => 2.5],
schema(float_schema('v')),
));
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->greaterThanEqual(lit(1.5)),
['v' => 1.5],
schema(float_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->greaterThanEqual(lit(2.5)),
['v' => 1.5],
schema(float_schema('v')),
@@ -627,17 +627,17 @@ public function test_greater_than_equal_integers(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->greaterThanEqual(lit(10)),
['v' => 20],
schema(int_schema('v')),
));
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->greaterThanEqual(lit(10)),
['v' => 10],
schema(int_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->greaterThanEqual(lit(20)),
['v' => 10],
schema(int_schema('v')),
@@ -646,7 +646,7 @@ public function test_greater_than_equal_integers(): void
public function test_greater_than_equal_returns_null_for_null_array(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->greaterThanEqual(lit([1, 0])),
['v' => null],
schema(list_schema('v', type_list(type_integer()), nullable: true)),
@@ -655,7 +655,7 @@ public function test_greater_than_equal_returns_null_for_null_array(): void
public function test_greater_than_equal_returns_null_for_null_datetime(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->greaterThanEqual(lit(new DateTimeImmutable('2024-01-01'))),
['v' => null],
schema(datetime_schema('v', nullable: true)),
@@ -664,7 +664,7 @@ public function test_greater_than_equal_returns_null_for_null_datetime(): void
public function test_greater_than_equal_returns_null_for_null_left(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->greaterThanEqual(lit(10)),
['v' => null],
schema(str_schema('v', nullable: true)),
@@ -673,7 +673,7 @@ public function test_greater_than_equal_returns_null_for_null_left(): void
public function test_greater_than_equal_returns_null_for_null_right(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->greaterThanEqual(ref('other')),
['v' => 10, 'other' => null],
schema(int_schema('v'), str_schema('other', nullable: true)),
@@ -682,7 +682,7 @@ public function test_greater_than_equal_returns_null_for_null_right(): void
public function test_greater_than_equal_returns_null_for_null_string(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->greaterThanEqual(lit('a')),
['v' => null],
schema(str_schema('v', nullable: true)),
@@ -691,7 +691,7 @@ public function test_greater_than_equal_returns_null_for_null_string(): void
public function test_greater_than_equal_returns_null_for_null_time_interval(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->greaterThanEqual(lit(new DateInterval('PT1H'))),
['v' => null],
schema(time_schema('v', nullable: true)),
@@ -702,17 +702,17 @@ public function test_greater_than_equal_strings(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->greaterThanEqual(lit('apple')),
['v' => 'banana'],
schema(str_schema('v')),
));
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->greaterThanEqual(lit('apple')),
['v' => 'apple'],
schema(str_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->greaterThanEqual(lit('banana')),
['v' => 'apple'],
schema(str_schema('v')),
@@ -730,17 +730,17 @@ public function test_greater_than_equal_time_intervals(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->greaterThanEqual(lit(new DateInterval('PT1H'))),
['v' => new DateInterval('PT5H')],
schema(time_schema('v')),
));
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->greaterThanEqual(lit(new DateInterval('PT1H'))),
['v' => new DateInterval('PT1H')],
schema(time_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->greaterThanEqual(lit(new DateInterval('PT5H'))),
['v' => new DateInterval('PT1H')],
schema(time_schema('v')),
@@ -749,7 +749,7 @@ public function test_greater_than_equal_time_intervals(): void
public function test_greater_than_equal_orders_strings_by_bytes(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('a')->greaterThanEqual(lit('10')),
['a' => '9'],
schema(str_schema('a')),
@@ -760,12 +760,12 @@ public function test_greater_than_equal_orders_a_numeric_string_column_numerical
{
$context = flow_context();
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('a')->greaterThanEqual(lit('10')),
['a' => '9'],
schema(definition_from_type('a', type_numeric_string())),
));
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('a')->greaterThanEqual(lit('18446744073709551614')),
['a' => '18446744073709551615'],
schema(definition_from_type('a', type_numeric_string())),
@@ -776,12 +776,12 @@ public function test_greater_than_equal_ranks_nan_above_every_number(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('a')->greaterThanEqual(lit(1.0)),
['a' => NAN],
schema(float_schema('a')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
lit(1.0)->greaterThanEqual(ref('a')),
['a' => NAN],
schema(float_schema('a')),
@@ -792,17 +792,17 @@ public function test_less_than_arrays(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->lessThan(lit([1, 9])),
['v' => [1, 0]],
schema(list_schema('v', type_list(type_integer()))),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->lessThan(lit([1, 0])),
['v' => [1, 9]],
schema(list_schema('v', type_list(type_integer()))),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->lessThan(lit([1, 0])),
['v' => [1, 0]],
schema(list_schema('v', type_list(type_integer()))),
@@ -813,21 +813,21 @@ public function test_less_than_datetimes(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->lessThan(lit(new DateTimeImmutable('2024-06-01'))),
[
'v' => new DateTimeImmutable('2024-01-01'),
],
schema(datetime_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->lessThan(lit(new DateTimeImmutable('2024-01-01'))),
[
'v' => new DateTimeImmutable('2024-06-01'),
],
schema(datetime_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->lessThan(lit(new DateTimeImmutable('2024-01-01'))),
[
'v' => new DateTimeImmutable('2024-01-01'),
@@ -840,17 +840,17 @@ public function test_less_than_floats(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->lessThan(lit(2.5)),
['v' => 1.5],
schema(float_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->lessThan(lit(1.5)),
['v' => 2.5],
schema(float_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->lessThan(lit(1.5)),
['v' => 1.5],
schema(float_schema('v')),
@@ -861,17 +861,17 @@ public function test_less_than_integers(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->lessThan(lit(20)),
['v' => 10],
schema(int_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->lessThan(lit(10)),
['v' => 20],
schema(int_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->lessThan(lit(10)),
['v' => 10],
schema(int_schema('v')),
@@ -880,7 +880,7 @@ public function test_less_than_integers(): void
public function test_less_than_returns_null_for_null_array(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->lessThan(lit([1, 0])),
['v' => null],
schema(list_schema('v', type_list(type_integer()), nullable: true)),
@@ -889,7 +889,7 @@ public function test_less_than_returns_null_for_null_array(): void
public function test_less_than_returns_null_for_null_datetime(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->lessThan(lit(new DateTimeImmutable('2024-01-01'))),
['v' => null],
schema(datetime_schema('v', nullable: true)),
@@ -898,7 +898,7 @@ public function test_less_than_returns_null_for_null_datetime(): void
public function test_less_than_returns_null_for_null_left(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->lessThan(lit(10)),
['v' => null],
schema(str_schema('v', nullable: true)),
@@ -907,7 +907,7 @@ public function test_less_than_returns_null_for_null_left(): void
public function test_less_than_returns_null_for_null_right(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->lessThan(ref('other')),
['v' => 10, 'other' => null],
schema(int_schema('v'), str_schema('other', nullable: true)),
@@ -916,7 +916,7 @@ public function test_less_than_returns_null_for_null_right(): void
public function test_less_than_returns_null_for_null_string(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->lessThan(lit('a')),
['v' => null],
schema(str_schema('v', nullable: true)),
@@ -925,7 +925,7 @@ public function test_less_than_returns_null_for_null_string(): void
public function test_less_than_returns_null_for_null_time_interval(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->lessThan(lit(new DateInterval('PT1H'))),
['v' => null],
schema(time_schema('v', nullable: true)),
@@ -936,17 +936,17 @@ public function test_less_than_strings(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->lessThan(lit('banana')),
['v' => 'apple'],
schema(str_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->lessThan(lit('apple')),
['v' => 'banana'],
schema(str_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->lessThan(lit('apple')),
['v' => 'apple'],
schema(str_schema('v')),
@@ -964,17 +964,17 @@ public function test_less_than_time_intervals(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->lessThan(lit(new DateInterval('PT5H'))),
['v' => new DateInterval('PT1H')],
schema(time_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->lessThan(lit(new DateInterval('PT1H'))),
['v' => new DateInterval('PT5H')],
schema(time_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->lessThan(lit(new DateInterval('PT1H'))),
['v' => new DateInterval('PT1H')],
schema(time_schema('v')),
@@ -983,7 +983,7 @@ public function test_less_than_time_intervals(): void
public function test_less_than_orders_strings_by_bytes(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
ref('a')->lessThan(lit('10')),
['a' => '9'],
schema(str_schema('a')),
@@ -994,12 +994,12 @@ public function test_less_than_orders_a_numeric_string_column_numerically(): voi
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('a')->lessThan(lit('10')),
['a' => '9'],
schema(definition_from_type('a', type_numeric_string())),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('a')->lessThan(lit('18446744073709551614')),
['a' => '18446744073709551615'],
schema(definition_from_type('a', type_numeric_string())),
@@ -1010,12 +1010,12 @@ public function test_less_than_ranks_nan_above_every_number(): void
{
$context = flow_context();
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('a')->lessThan(lit(1.0)),
['a' => NAN],
schema(float_schema('a')),
));
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
lit(1.0)->lessThan(ref('a')),
['a' => NAN],
schema(float_schema('a')),
@@ -1026,17 +1026,17 @@ public function test_less_than_equal_arrays(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->lessThanEqual(lit([1, 9])),
['v' => [1, 0]],
schema(list_schema('v', type_list(type_integer()))),
));
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->lessThanEqual(lit([1, 0])),
['v' => [1, 0]],
schema(list_schema('v', type_list(type_integer()))),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->lessThanEqual(lit([1, 0])),
['v' => [1, 9]],
schema(list_schema('v', type_list(type_integer()))),
@@ -1047,21 +1047,21 @@ public function test_less_than_equal_datetimes(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->lessThanEqual(lit(new DateTimeImmutable('2024-06-01'))),
[
'v' => new DateTimeImmutable('2024-01-01'),
],
schema(datetime_schema('v')),
));
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->lessThanEqual(lit(new DateTimeImmutable('2024-01-01'))),
[
'v' => new DateTimeImmutable('2024-01-01'),
],
schema(datetime_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->lessThanEqual(lit(new DateTimeImmutable('2024-01-01'))),
[
'v' => new DateTimeImmutable('2024-06-01'),
@@ -1074,17 +1074,17 @@ public function test_less_than_equal_floats(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->lessThanEqual(lit(2.5)),
['v' => 1.5],
schema(float_schema('v')),
));
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->lessThanEqual(lit(1.5)),
['v' => 1.5],
schema(float_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->lessThanEqual(lit(1.5)),
['v' => 2.5],
schema(float_schema('v')),
@@ -1095,17 +1095,17 @@ public function test_less_than_equal_integers(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->lessThanEqual(lit(20)),
['v' => 10],
schema(int_schema('v')),
));
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->lessThanEqual(lit(10)),
['v' => 10],
schema(int_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->lessThanEqual(lit(10)),
['v' => 20],
schema(int_schema('v')),
@@ -1114,7 +1114,7 @@ public function test_less_than_equal_integers(): void
public function test_less_than_equal_returns_null_for_null_array(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->lessThanEqual(lit([1, 0])),
['v' => null],
schema(list_schema('v', type_list(type_integer()), nullable: true)),
@@ -1123,7 +1123,7 @@ public function test_less_than_equal_returns_null_for_null_array(): void
public function test_less_than_equal_returns_null_for_null_datetime(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->lessThanEqual(lit(new DateTimeImmutable('2024-01-01'))),
['v' => null],
schema(datetime_schema('v', nullable: true)),
@@ -1132,7 +1132,7 @@ public function test_less_than_equal_returns_null_for_null_datetime(): void
public function test_less_than_equal_returns_null_for_null_left(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->lessThanEqual(lit(10)),
['v' => null],
schema(str_schema('v', nullable: true)),
@@ -1141,7 +1141,7 @@ public function test_less_than_equal_returns_null_for_null_left(): void
public function test_less_than_equal_returns_null_for_null_right(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->lessThanEqual(ref('other')),
['v' => 10, 'other' => null],
schema(int_schema('v'), str_schema('other', nullable: true)),
@@ -1150,7 +1150,7 @@ public function test_less_than_equal_returns_null_for_null_right(): void
public function test_less_than_equal_returns_null_for_null_string(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->lessThanEqual(lit('a')),
['v' => null],
schema(str_schema('v', nullable: true)),
@@ -1159,7 +1159,7 @@ public function test_less_than_equal_returns_null_for_null_string(): void
public function test_less_than_equal_returns_null_for_null_time_interval(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('v')->lessThanEqual(lit(new DateInterval('PT1H'))),
['v' => null],
schema(time_schema('v', nullable: true)),
@@ -1170,17 +1170,17 @@ public function test_less_than_equal_strings(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->lessThanEqual(lit('banana')),
['v' => 'apple'],
schema(str_schema('v')),
));
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->lessThanEqual(lit('apple')),
['v' => 'apple'],
schema(str_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->lessThanEqual(lit('apple')),
['v' => 'banana'],
schema(str_schema('v')),
@@ -1198,17 +1198,17 @@ public function test_less_than_equal_time_intervals(): void
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->lessThanEqual(lit(new DateInterval('PT5H'))),
['v' => new DateInterval('PT1H')],
schema(time_schema('v')),
));
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('v')->lessThanEqual(lit(new DateInterval('PT1H'))),
['v' => new DateInterval('PT1H')],
schema(time_schema('v')),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('v')->lessThanEqual(lit(new DateInterval('PT1H'))),
['v' => new DateInterval('PT5H')],
schema(time_schema('v')),
@@ -1217,7 +1217,7 @@ public function test_less_than_equal_time_intervals(): void
public function test_less_than_equal_orders_strings_by_bytes(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
ref('a')->lessThanEqual(lit('10')),
['a' => '9'],
schema(str_schema('a')),
@@ -1228,12 +1228,12 @@ public function test_less_than_equal_orders_a_numeric_string_column_numerically(
{
$context = flow_context();
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
ref('a')->lessThanEqual(lit('10')),
['a' => '9'],
schema(definition_from_type('a', type_numeric_string())),
));
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('a')->lessThanEqual(lit('18446744073709551614')),
['a' => '18446744073709551615'],
schema(definition_from_type('a', type_numeric_string())),
@@ -1244,12 +1244,12 @@ public function test_less_than_equal_ranks_nan_above_every_number(): void
{
$context = flow_context();
- static::assertFalse((new FunctionContext($context))->eval(
+ static::assertFalse(new FunctionContext($context)->eval(
ref('a')->lessThanEqual(lit(1.0)),
['a' => NAN],
schema(float_schema('a')),
));
- static::assertTrue((new FunctionContext($context))->eval(
+ static::assertTrue(new FunctionContext($context)->eval(
lit(1.0)->lessThanEqual(ref('a')),
['a' => NAN],
schema(float_schema('a')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ConcatTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ConcatTest.php
index 8d433f9039..42c7f2ef75 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ConcatTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ConcatTest.php
@@ -26,12 +26,12 @@ final class ConcatTest extends FlowTestCase
{
public function test_children_of_named_parts_are_a_list(): void
{
- static::assertTrue(array_is_list((new Concat(...['p' => 'a', 'q' => lit('b')]))->children()));
+ static::assertTrue(array_is_list(new Concat(...['p' => 'a', 'q' => lit('b')])->children()));
}
public function test_concat_arrays(): void
{
- static::assertSame('["a"]["b","c"]', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('["a"]["b","c"]', new FunctionContext(flow_context())->eval(
concat(ref('array_1'), ref('array_2')),
[
'array_1' => ['a'],
@@ -43,7 +43,7 @@ public function test_concat_arrays(): void
public function test_concat_different_types_of_values(): void
{
- static::assertSame('1abc["a","b"]', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('1abc["a","b"]', new FunctionContext(flow_context())->eval(
concat(lit(1), lit('a'), lit('b'), lit('c'), lit(['a', 'b'])),
[],
schema(),
@@ -52,7 +52,7 @@ public function test_concat_different_types_of_values(): void
public function test_concat_string_values(): void
{
- static::assertSame('abc', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('abc', new FunctionContext(flow_context())->eval(
concat(lit('a'), lit('b'), lit('c')),
[],
schema(),
@@ -61,7 +61,7 @@ public function test_concat_string_values(): void
public function test_concat_skips_nulls(): void
{
- static::assertSame('ac', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('ac', new FunctionContext(flow_context())->eval(
concat(ref('a'), ref('b'), lit('c')),
['a' => 'a', 'b' => null],
schema(str_schema('a'), str_schema('b', true)),
@@ -70,7 +70,7 @@ public function test_concat_skips_nulls(): void
public function test_concat_without_arguments_is_an_empty_string(): void
{
- static::assertSame('', (new FunctionContext(flow_context()))->eval(concat(), [], schema()));
+ static::assertSame('', new FunctionContext(flow_context())->eval(concat(), [], schema()));
}
public function test_concat_without_arguments_gives_one_empty_string_per_row(): void
@@ -86,7 +86,7 @@ public function test_concat_without_arguments_gives_one_empty_string_per_row():
public function test_string_parts_are_literals(): void
{
- static::assertSame('ab', (new FunctionContext(flow_context()))->eval(concat('a', lit('b')), [], schema()));
+ static::assertSame('ab', new FunctionContext(flow_context())->eval(concat('a', lit('b')), [], schema()));
}
public function test_describe_round_trips(): void
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ConcatWithSeparatorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ConcatWithSeparatorTest.php
index ce2a757007..5e4a840e79 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ConcatWithSeparatorTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ConcatWithSeparatorTest.php
@@ -24,12 +24,12 @@ final class ConcatWithSeparatorTest extends FlowTestCase
{
public function test_children_of_named_parts_are_a_list(): void
{
- static::assertTrue(array_is_list((new ConcatWithSeparator('-', ...['p' => 'a', 'q' => lit('b')]))->children()));
+ static::assertTrue(array_is_list(new ConcatWithSeparator('-', ...['p' => 'a', 'q' => lit('b')])->children()));
}
public function test_concat_with_separator(): void
{
- static::assertSame('a,1', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('a,1', new FunctionContext(flow_context())->eval(
concat_ws(lit(','), ref('string'), ref('integer')),
[
'string' => 'a',
@@ -41,7 +41,7 @@ public function test_concat_with_separator(): void
public function test_a_null_value_is_skipped(): void
{
- static::assertSame('a', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('a', new FunctionContext(flow_context())->eval(
concat_ws(lit(','), ref('string'), ref('missing_value')),
[
'string' => 'a',
@@ -53,7 +53,7 @@ public function test_a_null_value_is_skipped(): void
public function test_string_parts_are_literals(): void
{
- static::assertSame('a,b', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('a,b', new FunctionContext(flow_context())->eval(
concat_ws(',', 'a', lit('b')),
[],
schema(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ConjunctsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ConjunctsTest.php
index b4785ca7a5..c797b1b129 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ConjunctsTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ConjunctsTest.php
@@ -18,7 +18,7 @@ public function test_a_function_that_is_not_an_and_is_its_only_conjunct(): void
{
$function = ref('id')->greaterThan(lit(1));
- static::assertSame([$function], (new Conjuncts())->of($function));
+ static::assertSame([$function], new Conjuncts()->of($function));
}
public function test_a_nested_and_is_flattened(): void
@@ -28,7 +28,7 @@ public function test_a_nested_and_is_flattened(): void
$c = ref('c')->equals(lit(3));
$d = ref('d')->equals(lit(4));
- static::assertSame([$a, $b, $c, $d], (new Conjuncts())->of(new All($a, new All($b, new All($c)), $d)));
+ static::assertSame([$a, $b, $c, $d], new Conjuncts()->of(new All($a, new All($b, new All($c)), $d)));
}
public function test_an_or_is_kept_whole(): void
@@ -36,6 +36,6 @@ public function test_an_or_is_kept_whole(): void
$a = ref('a')->equals(lit(1));
$or = new Any(ref('b')->equals(lit(2)), new All(ref('c')->equals(lit(3)), ref('d')->equals(lit(4))));
- static::assertSame([$a, $or], (new Conjuncts())->of(new All($a, $or)));
+ static::assertSame([$a, $or], new Conjuncts()->of(new All($a, $or)));
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ContainsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ContainsTest.php
index 8170077e43..bca334d7e4 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ContainsTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ContainsTest.php
@@ -29,7 +29,7 @@ public function test_a_column_needle(): void
{
static::assertSame(
[true, null, null, true, true, true, false],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
ref('h')->contains(ref('n')),
[
@@ -51,7 +51,7 @@ public function test_a_literal_needle(): void
{
static::assertSame(
[true, null, false, false, false, false, true],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
ref('h')->contains(lit('x')),
[
@@ -71,7 +71,7 @@ public function test_a_literal_needle(): void
public function test_the_result_is_a_boolean_column(): void
{
- $column = (new FunctionContext(flow_context()))->column(
+ $column = new FunctionContext(flow_context())->column(
ref('h')->contains(ref('n')),
[
['h' => 'abcx', 'n' => 'x'],
@@ -90,7 +90,7 @@ public function test_an_empty_batch_gives_an_empty_column(): void
{
static::assertSame(
[],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(ref('h')->contains(lit('x')), [], schema(str_schema('h', nullable: true)))
->values(),
);
@@ -99,7 +99,7 @@ public function test_an_empty_batch_gives_an_empty_column(): void
public function test_a_haystack_that_is_not_a_string_is_refused_with_its_row(): void
{
try {
- (new FunctionContext(flow_context()))->column(
+ new FunctionContext(flow_context())->column(
ref('i')->contains(lit('1')),
[['i' => null], ['i' => 12]],
schema(int_schema('i', nullable: true)),
@@ -115,7 +115,7 @@ public function test_a_haystack_that_is_not_a_string_is_refused_with_its_row():
public function test_a_needle_that_is_not_a_string_is_refused_with_its_row(): void
{
try {
- (new FunctionContext(flow_context()))->column(
+ new FunctionContext(flow_context())->column(
ref('h')->contains(ref('i')),
[['h' => 'a1', 'i' => 1]],
schema(str_schema('h'), int_schema('i')),
@@ -132,7 +132,7 @@ public function test_a_list_haystack_holds_the_needle(): void
{
static::assertSame(
[true, false, null],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
ref('l')->contains(lit('b')),
[['l' => ['a', 'b']], ['l' => ['c']], ['l' => null]],
@@ -146,7 +146,7 @@ public function test_string_columns_are_matched_by_the_backend_without_a_builder
{
$schema = schema(str_schema('h'), str_schema('n'));
$backend = new SpyBackend();
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(ref('h')->contains(ref('n')), $schema)
->eval(array_to_rows([['h' => 'ax', 'n' => 'x']], $schema, new PhpBackend()), $backend);
@@ -157,7 +157,7 @@ public function test_a_null_list_haystack_keeps_the_rows_after_it(): void
{
static::assertSame(
[null, true],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
ref('l')->contains(lit('b')),
[['l' => null], ['l' => ['a', 'b']]],
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CountsByGroupTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CountsByGroupTest.php
index 6609b1bfb6..6f2ea2c2e8 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CountsByGroupTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CountsByGroupTest.php
@@ -76,8 +76,8 @@ public function test_it_absorbs_only_other_grouped_counts(): void
{
$this->expectException(InvalidArgumentException::class);
- (new CountsByGroup(null, (new PhpBackend())->groupedCounts()))->absorbEarlier(
- new TotalsByGroup(sum(ref('v')), (new PhpBackend())->groupedTotals()),
+ new CountsByGroup(null, new PhpBackend()->groupedCounts())->absorbEarlier(
+ new TotalsByGroup(sum(ref('v')), new PhpBackend()->groupedTotals()),
[],
new PhpBackend(),
);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementAttributeValueTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementAttributeValueTest.php
index 809afb29ad..54ec6b2ff6 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementAttributeValueTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementAttributeValueTest.php
@@ -10,7 +10,6 @@
use DOMElement;
use Flow\ETL\Foundation\Exception\InvalidArgumentException;
use Flow\ETL\Tests\Context\FunctionContext;
-use PHPUnit\Framework\Attributes\RequiresPhp;
use PHPUnit\Framework\TestCase;
use function Flow\ETL\DSL\flow_context;
@@ -24,17 +23,15 @@
final class DOMElementAttributeValueTest extends TestCase
{
- #[RequiresPhp('>= 8.4.0')]
public function test_html_extracting_attribute_from_dom_element_entry(): void
{
- // @mago-ignore analysis:unavailable-method
$element = HTMLDocument::createFromString(
'foobar',
LIBXML_HTML_NOIMPLIED | LIBXML_NOERROR,
);
static::assertInstanceOf(HTMLElement::class, $element->documentElement);
- static::assertEquals('foobar', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('foobar', new FunctionContext(flow_context())->eval(
ref('value')->domElementAttributeValue('id'),
[
'value' => $element->documentElement,
@@ -43,14 +40,12 @@ public function test_html_extracting_attribute_from_dom_element_entry(): void
));
}
- #[RequiresPhp('>= 8.4.0')]
public function test_html_extracting_non_existing_attribute_from_dom_element_entry(): void
{
- // @mago-ignore analysis:unavailable-method
$element = HTMLDocument::createFromString('foobar', LIBXML_HTML_NOIMPLIED | LIBXML_NOERROR);
static::assertInstanceOf(HTMLElement::class, $element->documentElement);
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('value')->domElementAttributeValue('id'),
[
'value' => $element->documentElement,
@@ -65,7 +60,7 @@ public function test_xml_extracting_attribute_from_dom_element_entry(): void
$xml->loadXML('bar');
static::assertInstanceOf(DOMElement::class, $xml->documentElement);
- static::assertEquals('buz', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('buz', new FunctionContext(flow_context())->eval(
ref('value')->domElementAttributeValue('baz'),
[
'value' => $xml->documentElement->firstChild,
@@ -80,7 +75,7 @@ public function test_xml_extracting_non_existing_attribute_from_dom_element_entr
$xml->loadXML('bar');
static::assertInstanceOf(DOMElement::class, $xml->documentElement);
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('value')->domElementAttributeValue('bar'),
[
'value' => $xml->documentElement->firstChild,
@@ -97,7 +92,7 @@ public function test_a_missing_attribute_keeps_the_rows_after_it(): void
static::assertInstanceOf(DOMElement::class, $xml->documentElement);
static::assertSame(
[null, 'buz'],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
ref('value')->domElementAttributeValue('baz'),
[['value' => $xml->documentElement->firstChild], ['value' => $xml->documentElement->lastChild]],
@@ -112,7 +107,7 @@ public function test_xml_extracting_attribute_from_null_entry(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('DOMElementAttributeValue requires non-null DOMNode');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->domElementAttributeValue('baz'),
['value' => null],
schema(xml_element_schema('value', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementAttributesCountTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementAttributesCountTest.php
index 541c992734..de7f147695 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementAttributesCountTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementAttributesCountTest.php
@@ -10,7 +10,6 @@
use DOMElement;
use Flow\ETL\Foundation\Exception\InvalidArgumentException;
use Flow\ETL\Tests\Context\FunctionContext;
-use PHPUnit\Framework\Attributes\RequiresPhp;
use PHPUnit\Framework\TestCase;
use function Flow\ETL\DSL\flow_context;
@@ -24,17 +23,15 @@
final class DOMElementAttributesCountTest extends TestCase
{
- #[RequiresPhp('>= 8.4.0')]
public function test_html_attributes_count_on_element_with_multiple_attributes(): void
{
- // @mago-ignore analysis:unavailable-method
$element = HTMLDocument::createFromString(
'foobar',
LIBXML_HTML_NOIMPLIED | LIBXML_NOERROR,
);
static::assertInstanceOf(HTMLElement::class, $element->documentElement);
- static::assertSame(3, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(3, new FunctionContext(flow_context())->eval(
ref('value')->domElementAttributesCount(),
[
'value' => $element->documentElement,
@@ -43,17 +40,15 @@ public function test_html_attributes_count_on_element_with_multiple_attributes()
));
}
- #[RequiresPhp('>= 8.4.0')]
public function test_html_attributes_count_on_element_with_one_attribute(): void
{
- // @mago-ignore analysis:unavailable-method
$element = HTMLDocument::createFromString(
'foobar',
LIBXML_HTML_NOIMPLIED | LIBXML_NOERROR,
);
static::assertInstanceOf(HTMLElement::class, $element->documentElement);
- static::assertSame(1, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(1, new FunctionContext(flow_context())->eval(
ref('value')->domElementAttributesCount(),
[
'value' => $element->documentElement,
@@ -62,14 +57,12 @@ public function test_html_attributes_count_on_element_with_one_attribute(): void
));
}
- #[RequiresPhp('>= 8.4.0')]
public function test_html_attributes_count_on_element_with_zero_attributes(): void
{
- // @mago-ignore analysis:unavailable-method
$element = HTMLDocument::createFromString('foobar', LIBXML_HTML_NOIMPLIED | LIBXML_NOERROR);
static::assertInstanceOf(HTMLElement::class, $element->documentElement);
- static::assertSame(0, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(0, new FunctionContext(flow_context())->eval(
ref('value')->domElementAttributesCount(),
[
'value' => $element->documentElement,
@@ -84,7 +77,7 @@ public function test_xml_attributes_count_on_element_with_multiple_attributes():
$xml->loadXML('bar');
static::assertInstanceOf(DOMElement::class, $xml->documentElement);
- static::assertSame(3, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(3, new FunctionContext(flow_context())->eval(
ref('value')->domElementAttributesCount(),
[
'value' => $xml->documentElement->firstChild,
@@ -99,7 +92,7 @@ public function test_xml_attributes_count_on_element_with_one_attribute(): void
$xml->loadXML('bar');
static::assertInstanceOf(DOMElement::class, $xml->documentElement);
- static::assertSame(1, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(1, new FunctionContext(flow_context())->eval(
ref('value')->domElementAttributesCount(),
[
'value' => $xml->documentElement->firstChild,
@@ -114,7 +107,7 @@ public function test_xml_attributes_count_on_element_with_zero_attributes(): voi
$xml->loadXML('bar');
static::assertInstanceOf(DOMElement::class, $xml->documentElement);
- static::assertSame(0, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(0, new FunctionContext(flow_context())->eval(
ref('value')->domElementAttributesCount(),
[
'value' => $xml->documentElement->firstChild,
@@ -128,7 +121,7 @@ public function test_xml_attributes_count_on_null_entry(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('DOMElementAttributesCount requires non-null DOMElement');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->domElementAttributesCount(),
['value' => null],
schema(xml_element_schema('value', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementNamespaceValueTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementNamespaceValueTest.php
index 8234e253f4..a9be211d6f 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementNamespaceValueTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementNamespaceValueTest.php
@@ -10,7 +10,6 @@
use DOMElement;
use Flow\ETL\Foundation\Exception\InvalidArgumentException;
use Flow\ETL\Tests\Context\FunctionContext;
-use PHPUnit\Framework\Attributes\RequiresPhp;
use PHPUnit\Framework\TestCase;
use function Flow\ETL\DSL\flow_context;
@@ -33,16 +32,14 @@ final class DOMElementNamespaceValueTest extends TestCase
XML;
- #[RequiresPhp('>= 8.4.0')]
public function test_html_getting_element_namespace(): void
{
- // @mago-ignore analysis:unavailable-method
$element = XMLDocument::createFromString(self::XML, LIBXML_HTML_NOIMPLIED | LIBXML_NOERROR);
static::assertInstanceOf(Element::class, $element->documentElement);
- static::assertSame('urn:oasis:names:specification:ubl:schema:xsd:Invoice-2', (new FunctionContext(
+ static::assertSame('urn:oasis:names:specification:ubl:schema:xsd:Invoice-2', new FunctionContext(
flow_context(),
- ))->eval(
+ )->eval(
ref('node')->domElementNamespace(),
[
'node' => $element->documentElement,
@@ -57,9 +54,9 @@ public function test_xml_getting_element_namespace(): void
$xml->loadXML(self::XML);
static::assertInstanceOf(DOMElement::class, $xml->documentElement);
- static::assertSame('urn:oasis:names:specification:ubl:schema:xsd:Invoice-2', (new FunctionContext(
+ static::assertSame('urn:oasis:names:specification:ubl:schema:xsd:Invoice-2', new FunctionContext(
flow_context(),
- ))->eval(
+ )->eval(
ref('node')->domElementNamespace(),
[
'node' => $xml->documentElement,
@@ -74,9 +71,9 @@ public function test_xml_getting_element_non_default_namespace(): void
$xml->loadXML(self::XML);
static::assertInstanceOf(DOMElement::class, $xml->documentElement);
- static::assertSame('http://www.unece.org/cefact/nodes/StandardBusinessDocumentHeader', (new FunctionContext(
+ static::assertSame('http://www.unece.org/cefact/nodes/StandardBusinessDocumentHeader', new FunctionContext(
flow_context(),
- ))->eval(
+ )->eval(
ref('node')->domElementNamespace('xmlns:sh'),
[
'node' => $xml->documentElement,
@@ -90,7 +87,7 @@ public function test_xml_getting_namespace_of_null_entry(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('DOMElementNamespaceValue requires non-null DOMNode');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('node')->domElementNamespace(),
['node' => null],
schema(xml_element_schema('node', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementParentTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementParentTest.php
index d61cdd56c9..79663dc8c9 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementParentTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementParentTest.php
@@ -8,7 +8,6 @@
use DOMDocument;
use Flow\ETL\Foundation\Exception\InvalidArgumentException;
use Flow\ETL\Tests\Context\FunctionContext;
-use PHPUnit\Framework\Attributes\RequiresPhp;
use PHPUnit\Framework\TestCase;
use function Flow\ETL\DSL\config;
@@ -25,15 +24,13 @@
final class DOMElementParentTest extends TestCase
{
- #[RequiresPhp('>= 8.4.0')]
public function test_html_fails_when_parent_not_available_in_strict_mode(): void
{
- // @mago-ignore analysis:unavailable-method
$element = HTMLDocument::createFromString('bar', LIBXML_HTML_NOIMPLIED | LIBXML_NOERROR);
$context = flow_context(config());
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('DOMElementParent requires non-null DOMNode or HTMLElement.');
- (new FunctionContext($context))->eval(
+ new FunctionContext($context)->eval(
ref('value')->domElementParent(),
[
// @mago-ignore analysis:possibly-null-property-access
@@ -43,17 +40,15 @@ public function test_html_fails_when_parent_not_available_in_strict_mode(): void
);
}
- #[RequiresPhp('>= 8.4.0')]
public function test_html_getting_parent_element(): void
{
- // @mago-ignore analysis:unavailable-method
$element = HTMLDocument::createFromString(
'',
LIBXML_HTML_NOIMPLIED | LIBXML_NOERROR,
);
static::assertEquals(
$element->documentElement,
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
lit($element->querySelector('span'))->domElementParent(),
[],
schema(),
@@ -61,12 +56,10 @@ public function test_html_getting_parent_element(): void
);
}
- #[RequiresPhp('>= 8.4.0')]
public function test_html_getting_parent_element_when_not_available(): void
{
- // @mago-ignore analysis:unavailable-method
$element = HTMLDocument::createFromString('bar', LIBXML_HTML_NOIMPLIED | LIBXML_NOERROR);
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
lit($element->documentElement)->domElementParent(),
[],
schema(),
@@ -80,7 +73,7 @@ public function test_xml_fails_when_parent_not_available_in_strict_mode(): void
$context = flow_context(config());
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('DOMElementParent requires non-null DOMNode or HTMLElement.');
- static::assertEquals($xml, (new FunctionContext($context))->eval(
+ static::assertEquals($xml, new FunctionContext($context)->eval(
ref('value')->domElementParent(),
[
'value' => $xml->parentNode,
@@ -97,7 +90,7 @@ public function test_xml_getting_parent_element(): void
$xml->documentElement,
// a batch stores the element's markup, so the parent is only reachable on the live node
// @mago-ignore analysis:possibly-null-property-access
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
lit($xml->documentElement->firstChild)->domElementParent(),
[],
schema(),
@@ -109,7 +102,7 @@ public function test_xml_getting_parent_element_when_not_available(): void
{
$xml = new DOMDocument();
$xml->loadXML('foobar');
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('value')->domElementParent(),
[
'value' => $xml->documentElement,
@@ -122,7 +115,7 @@ public function test_xml_getting_parent_element_when_passing_document(): void
{
$xml = new DOMDocument();
$xml->loadXML('foobar');
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('value')->domElementParent(),
['value' => $xml],
schema(xml_schema('value')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementValueTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementValueTest.php
index 4163942ca4..aca3ce6dec 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementValueTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementValueTest.php
@@ -11,7 +11,6 @@
use Flow\ETL\Functions\ReferenceResolver;
use Flow\ETL\Tests\Context\FunctionContext;
use Flow\ETL\Tests\FlowTestCase;
-use PHPUnit\Framework\Attributes\RequiresPhp;
use function Flow\ETL\DSL\array_to_rows;
use function Flow\ETL\DSL\flow_context;
@@ -39,21 +38,19 @@ public function test_xml_getting_element_values_over_two_rows(): void
static::assertSame(
['x', 'y'],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(ref('value')->domElementValue(), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
);
}
- #[RequiresPhp('>= 8.4.0')]
public function test_html_getting_element_value_with_children(): void
{
- // @mago-ignore analysis:unavailable-method
$element = HTMLDocument::createFromString('foobar
', LIBXML_HTML_NOIMPLIED | LIBXML_NOERROR);
static::assertInstanceOf(HTMLElement::class, $element->documentElement);
- static::assertEquals('foobar', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('foobar', new FunctionContext(flow_context())->eval(
ref('value')->domElementValue(),
[
'value' => $element->documentElement,
@@ -62,14 +59,12 @@ public function test_html_getting_element_value_with_children(): void
));
}
- #[RequiresPhp('>= 8.4.0')]
public function test_html_getting_simple_element_value(): void
{
- // @mago-ignore analysis:unavailable-method
$element = HTMLDocument::createFromString('bar', LIBXML_HTML_NOIMPLIED | LIBXML_NOERROR);
static::assertInstanceOf(HTMLElement::class, $element->documentElement);
- static::assertEquals('bar', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('bar', new FunctionContext(flow_context())->eval(
ref('value')->domElementValue(),
[
'value' => $element->documentElement,
@@ -84,7 +79,7 @@ public function test_xml_getting_element_value_with_children(): void
$xml->loadXML('baz');
static::assertInstanceOf(DOMElement::class, $xml->documentElement);
- static::assertEquals('baz', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('baz', new FunctionContext(flow_context())->eval(
ref('value')->domElementValue(),
[
'value' => $xml->documentElement->firstChild,
@@ -99,7 +94,7 @@ public function test_xml_getting_simple_element_value(): void
$xml->loadXML('bar');
static::assertInstanceOf(DOMElement::class, $xml->documentElement);
- static::assertEquals('bar', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('bar', new FunctionContext(flow_context())->eval(
ref('value')->domElementValue(),
[
'value' => $xml->documentElement->firstChild,
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DateTimeFormatTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DateTimeFormatTest.php
index 6003a681ca..c8a464b316 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DateTimeFormatTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DateTimeFormatTest.php
@@ -25,7 +25,7 @@ final class DateTimeFormatTest extends FlowTestCase
{
public function test_date_time_format(): void
{
- static::assertEquals('2020-01-01 00:00:00', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('2020-01-01 00:00:00', new FunctionContext(flow_context())->eval(
date_time_format(ref('date_time'), 'Y-m-d H:i:s'),
['date_time' => new DateTimeImmutable('2020-01-01 00:00:00', new DateTimeZone('UTC'))],
schema(datetime_schema('date_time')),
@@ -36,7 +36,7 @@ public function test_a_format_read_from_a_column_formats_each_row_with_its_own_f
{
static::assertSame(
['2020', '01'],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
new DateTimeFormat(ref('date_time'), ref('format')),
[
@@ -62,7 +62,7 @@ public function test_a_literal_format_over_a_zoned_column_equals_formatting_each
$rows[0]['at']->setTimezone(new DateTimeZone($zone))->format('Y-m-d\TH:i:s.uP T e'),
$rows[1]['at']->setTimezone(new DateTimeZone($zone))->format('Y-m-d\TH:i:s.uP T e'),
],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
date_time_format(ref('at'), 'Y-m-d\TH:i:s.uP T e'),
$rows,
@@ -77,7 +77,7 @@ public function test_a_literal_format_over_a_date_column(): void
{
static::assertSame(
['02/01/2026 00:00', '01/01/1970 00:00'],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
date_time_format(ref('on'), 'd/m/Y H:i'),
[['on' => new DateTimeImmutable('2026-01-02')], ['on' => new DateTimeImmutable('1970-01-01')]],
@@ -90,7 +90,7 @@ public function test_a_literal_format_over_a_date_column(): void
public function test_a_null_in_a_datetime_column_is_refused_with_its_row_index(): void
{
try {
- (new FunctionContext(flow_context()))->column(
+ new FunctionContext(flow_context())->column(
date_time_format(ref('at'), 'Y-m-d'),
[['at' => new DateTimeImmutable('2026-01-02')], ['at' => null], ['at' => null]],
schema(datetime_schema('at', nullable: true)),
@@ -106,7 +106,7 @@ public function test_a_null_in_a_datetime_column_is_refused_with_its_row_index()
public function test_a_null_datetime_with_a_column_format_is_refused(): void
{
try {
- (new FunctionContext(flow_context()))->column(
+ new FunctionContext(flow_context())->column(
new DateTimeFormat(ref('at'), ref('format')),
[['at' => null, 'format' => 'Y']],
schema(datetime_schema('at', nullable: true), str_schema('format')),
@@ -119,7 +119,7 @@ public function test_a_null_datetime_with_a_column_format_is_refused(): void
public function test_formatting_now(): void
{
- static::assertInstanceOf(DateTimeImmutable::class, (new FunctionContext(flow_context()))->eval(
+ static::assertInstanceOf(DateTimeImmutable::class, new FunctionContext(flow_context())->eval(
now(),
['date_time' => new DateTimeImmutable('2020-01-01 00:00:00', new DateTimeZone('UTC'))],
schema(datetime_schema('date_time')),
@@ -131,7 +131,7 @@ public function test_invalid_date_time_format(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "object", got "string".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
date_time_format(ref('date_time'), 'Y-m-d H:i:s'),
[
'date_time' => '2020-01-01 00:00:00',
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EndsWithTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EndsWithTest.php
index 4029f9f217..aa4afa6ea5 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EndsWithTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EndsWithTest.php
@@ -26,7 +26,7 @@ public function test_a_column_needle(): void
{
static::assertSame(
[true, null, null, true, true, true, false],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
ref('h')->endsWith(ref('n')),
[
@@ -48,7 +48,7 @@ public function test_a_literal_needle(): void
{
static::assertSame(
[true, null, false, false, false, false, true],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
ref('h')->endsWith(lit('x')),
[
@@ -68,7 +68,7 @@ public function test_a_literal_needle(): void
public function test_the_result_is_a_boolean_column(): void
{
- $column = (new FunctionContext(flow_context()))->column(
+ $column = new FunctionContext(flow_context())->column(
ref('h')->endsWith(ref('n')),
[
['h' => 'abcx', 'n' => 'x'],
@@ -87,7 +87,7 @@ public function test_an_empty_batch_gives_an_empty_column(): void
{
static::assertSame(
[],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(ref('h')->endsWith(lit('x')), [], schema(str_schema('h', nullable: true)))
->values(),
);
@@ -96,7 +96,7 @@ public function test_an_empty_batch_gives_an_empty_column(): void
public function test_a_haystack_that_is_not_a_string_is_refused_with_its_row(): void
{
try {
- (new FunctionContext(flow_context()))->column(
+ new FunctionContext(flow_context())->column(
ref('i')->endsWith(lit('1')),
[['i' => null], ['i' => 12]],
schema(int_schema('i', nullable: true)),
@@ -112,7 +112,7 @@ public function test_a_haystack_that_is_not_a_string_is_refused_with_its_row():
public function test_a_needle_that_is_not_a_string_is_refused_with_its_row(): void
{
try {
- (new FunctionContext(flow_context()))->column(
+ new FunctionContext(flow_context())->column(
ref('h')->endsWith(ref('i')),
[['h' => 'a1', 'i' => 1]],
schema(str_schema('h'), int_schema('i')),
@@ -129,7 +129,7 @@ public function test_string_columns_are_matched_by_the_backend_without_a_builder
{
$schema = schema(str_schema('h'), str_schema('n'));
$backend = new SpyBackend();
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(ref('h')->endsWith(ref('n')), $schema)
->eval(array_to_rows([['h' => 'ax', 'n' => 'x']], $schema, new PhpBackend()), $backend);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnsureEndTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnsureEndTest.php
index 98741690fa..2200a38d0b 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnsureEndTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnsureEndTest.php
@@ -26,7 +26,7 @@ public function test_a_null_suffix_row_does_not_stop_later_rows(): void
static::assertSame(
['a', 'ax'],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(ref('str')->ensureEnd(ref('suffix')), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
@@ -35,7 +35,7 @@ public function test_a_null_suffix_row_does_not_stop_later_rows(): void
public function test_empty_string_with_suffix(): void
{
- static::assertEquals('_suffix', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('_suffix', new FunctionContext(flow_context())->eval(
ref('str')->ensureEnd('_suffix'),
['str' => ''],
schema(str_schema('str')),
@@ -44,7 +44,7 @@ public function test_empty_string_with_suffix(): void
public function test_null_suffix(): void
{
- static::assertEquals('hello', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('hello', new FunctionContext(flow_context())->eval(
ref('str')->ensureEnd(ref('suffix')),
['str' => 'hello', 'suffix' => null],
schema(str_schema('str'), str_schema('suffix', nullable: true)),
@@ -56,7 +56,7 @@ public function test_null_value(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('EnsureEnd function requires non-null value');
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('str')->ensureEnd('_suffix'),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -65,7 +65,7 @@ public function test_null_value(): void
public function test_string_already_ends_with_suffix(): void
{
- static::assertEquals('document.txt', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('document.txt', new FunctionContext(flow_context())->eval(
ref('str')->ensureEnd('.txt'),
['str' => 'document.txt'],
schema(str_schema('str')),
@@ -74,7 +74,7 @@ public function test_string_already_ends_with_suffix(): void
public function test_string_doesnt_end_with_suffix(): void
{
- static::assertEquals('document.txt', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('document.txt', new FunctionContext(flow_context())->eval(
ref('str')->ensureEnd('.txt'),
['str' => 'document'],
schema(str_schema('str')),
@@ -83,7 +83,7 @@ public function test_string_doesnt_end_with_suffix(): void
public function test_string_with_empty_suffix(): void
{
- static::assertEquals('hello', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('hello', new FunctionContext(flow_context())->eval(
ref('str')->ensureEnd(''),
['str' => 'hello'],
schema(str_schema('str')),
@@ -92,7 +92,7 @@ public function test_string_with_empty_suffix(): void
public function test_with_scalar_function_parameter(): void
{
- static::assertEquals('document.pdf', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('document.pdf', new FunctionContext(flow_context())->eval(
ref('str')->ensureEnd(ref('suffix')),
['str' => 'document', 'suffix' => '.pdf'],
schema(str_schema('str'), str_schema('suffix')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnsureStartTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnsureStartTest.php
index cb08068df1..12b32bd8aa 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnsureStartTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnsureStartTest.php
@@ -26,7 +26,7 @@ public function test_a_null_prefix_row_does_not_stop_later_rows(): void
static::assertSame(
['a', 'xa'],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(ref('str')->ensureStart(ref('prefix')), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
@@ -35,7 +35,7 @@ public function test_a_null_prefix_row_does_not_stop_later_rows(): void
public function test_empty_string_with_prefix(): void
{
- static::assertEquals('prefix_', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('prefix_', new FunctionContext(flow_context())->eval(
ref('str')->ensureStart('prefix_'),
['str' => ''],
schema(str_schema('str')),
@@ -44,7 +44,7 @@ public function test_empty_string_with_prefix(): void
public function test_null_prefix(): void
{
- static::assertEquals('hello', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('hello', new FunctionContext(flow_context())->eval(
ref('str')->ensureStart(ref('prefix')),
['str' => 'hello', 'prefix' => null],
schema(str_schema('str'), str_schema('prefix', nullable: true)),
@@ -56,7 +56,7 @@ public function test_null_value(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('EnsureStart function requires non-null value');
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('str')->ensureStart('prefix_'),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -65,7 +65,7 @@ public function test_null_value(): void
public function test_string_already_starts_with_prefix(): void
{
- static::assertEquals('https://example.com', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('https://example.com', new FunctionContext(flow_context())->eval(
ref('str')->ensureStart('https://'),
['str' => 'https://example.com'],
schema(str_schema('str')),
@@ -74,7 +74,7 @@ public function test_string_already_starts_with_prefix(): void
public function test_string_doesnt_start_with_prefix(): void
{
- static::assertEquals('https://example.com', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('https://example.com', new FunctionContext(flow_context())->eval(
ref('str')->ensureStart('https://'),
['str' => 'example.com'],
schema(str_schema('str')),
@@ -83,7 +83,7 @@ public function test_string_doesnt_start_with_prefix(): void
public function test_string_with_empty_prefix(): void
{
- static::assertEquals('hello', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('hello', new FunctionContext(flow_context())->eval(
ref('str')->ensureStart(''),
['str' => 'hello'],
schema(str_schema('str')),
@@ -92,7 +92,7 @@ public function test_string_with_empty_prefix(): void
public function test_with_scalar_function_parameter(): void
{
- static::assertEquals('https://example.com', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('https://example.com', new FunctionContext(flow_context())->eval(
ref('str')->ensureStart(ref('prefix')),
['str' => 'example.com', 'prefix' => 'https://'],
schema(str_schema('str'), str_schema('prefix')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnumNameTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnumNameTest.php
index 2fb6a43a9e..f05f75375a 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnumNameTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnumNameTest.php
@@ -26,7 +26,7 @@ final class EnumNameTest extends FlowTestCase
{
public function test_enum_name_accepts_literal_enum(): void
{
- static::assertSame('one', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('one', new FunctionContext(flow_context())->eval(
enum_name(BackedStringEnum::one),
[],
schema(),
@@ -40,7 +40,7 @@ public function test_enum_name_carries_string_type(): void
public function test_enum_name_from_scalar_function_chain(): void
{
- static::assertSame('one', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('one', new FunctionContext(flow_context())->eval(
ref('e')->enumName(),
[
'e' => BackedIntEnum::one,
@@ -54,7 +54,7 @@ public function test_enum_name_from_scalar_function_chain(): void
#[TestWith([BasicEnum::one])]
public function test_enum_name_returns_case_name(UnitEnum $enum): void
{
- static::assertSame('one', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('one', new FunctionContext(flow_context())->eval(
enum_name(ref('e')),
['e' => $enum],
schema(enum_schema('e', $enum::class)),
@@ -69,6 +69,6 @@ public function test_enum_name_throws_in_strict_mode(mixed $input): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('EnumName function requires a UnitEnum value');
- (new FunctionContext(flow_context(config())))->eval(enum_name($input), [], schema());
+ new FunctionContext(flow_context(config()))->eval(enum_name($input), [], schema());
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnumValueTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnumValueTest.php
index 61f3ca50e0..b92b18a609 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnumValueTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnumValueTest.php
@@ -31,16 +31,12 @@ final class EnumValueTest extends FlowTestCase
{
public function test_enum_value_accepts_literal_enum(): void
{
- static::assertSame(1, (new FunctionContext(flow_context()))->eval(
- enum_value(BackedIntEnum::one),
- [],
- schema(),
- ));
+ static::assertSame(1, new FunctionContext(flow_context())->eval(enum_value(BackedIntEnum::one), [], schema()));
}
public function test_enum_value_from_scalar_function_chain(): void
{
- static::assertSame(1, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(1, new FunctionContext(flow_context())->eval(
ref('e')->enumValue(),
[
'e' => BackedIntEnum::one,
@@ -53,7 +49,7 @@ public function test_enum_value_from_scalar_function_chain(): void
#[TestWith([BackedIntEnum::one, 1])]
public function test_enum_value_returns_backing_value(UnitEnum $enum, int|string $expected): void
{
- static::assertSame($expected, (new FunctionContext(flow_context()))->eval(
+ static::assertSame($expected, new FunctionContext(flow_context())->eval(
enum_value(ref('e')),
['e' => $enum],
schema(enum_schema('e', $enum::class)),
@@ -69,13 +65,13 @@ public function test_enum_value_throws_in_strict_mode(mixed $input): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('EnumValue function requires a BackedEnum value');
- (new FunctionContext(flow_context(config())))->eval(enum_value($input), [], schema());
+ new FunctionContext(flow_context(config()))->eval(enum_value($input), [], schema());
}
public function test_a_non_enum_operand_is_refused_at_bind(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(enum_value(ref('e')), schema(str_schema('e')));
+ $resolved = new ReferenceResolver()->resolve(enum_value(ref('e')), schema(str_schema('e')));
$this->expectException(SchemaNotDerivableException::class);
$this->expectExceptionMessage('which is not an enum');
@@ -86,7 +82,7 @@ public function test_a_non_enum_operand_is_refused_at_bind(): void
public function test_enum_value_type_is_derived_from_int_backing_value(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(
+ $resolved = new ReferenceResolver()->resolve(
enum_value(ref('e')),
schema(enum_schema('e', BackedIntEnum::class)),
);
@@ -97,7 +93,7 @@ enum_value(ref('e')),
public function test_enum_value_type_is_derived_from_string_backing_value(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(
+ $resolved = new ReferenceResolver()->resolve(
enum_value(ref('e')),
schema(enum_schema('e', BackedStringEnum::class)),
);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Evaluation/ResultColumnTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Evaluation/ResultColumnTest.php
index 2f24ebe7e5..d0c294feea 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Evaluation/ResultColumnTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Evaluation/ResultColumnTest.php
@@ -45,7 +45,7 @@ final class ResultColumnTest extends TestCase
{
public function test_a_not_null_return_still_accepts_null(): void
{
- $column = (new ResultColumn(new PhpBackend()))->of(lit(5), [5, null]);
+ $column = new ResultColumn(new PhpBackend())->of(lit(5), [5, null]);
static::assertSame([5, null], $column->values());
static::assertEquals(type_integer(), $column->type());
@@ -55,27 +55,27 @@ public function test_an_unresolved_tree_throws(): void
{
$this->expectException(InvalidLogicException::class);
- (new ResultColumn(new PhpBackend()))->of(ref('a'), [1]);
+ new ResultColumn(new PhpBackend())->of(ref('a'), [1]);
}
public function test_casts_each_value_into_the_returned_type(): void
{
- static::assertSame([5, 6], (new ResultColumn(new PhpBackend()))->of(lit(1), ['5', 6])->values());
+ static::assertSame([5, 6], new ResultColumn(new PhpBackend())->of(lit(1), ['5', 6])->values());
}
public function test_builds_through_the_backend_it_was_given(): void
{
$backend = new SpyBackend();
- (new ResultColumn($backend))->of(lit(1), [1, 2]);
- (new ResultColumn($backend))->of(lit(1), ['1', 2]);
+ new ResultColumn($backend)->of(lit(1), [1, 2]);
+ new ResultColumn($backend)->of(lit(1), ['1', 2]);
static::assertSame(2, $backend->builders());
}
public function test_null_type_builds_a_null_column(): void
{
- $column = (new ResultColumn(new PhpBackend()))->of(lit(null), [null, null]);
+ $column = new ResultColumn(new PhpBackend())->of(lit(null), [null, null]);
static::assertEquals(type_null(), $column->type());
static::assertSame(2, $column->nullCount());
@@ -84,7 +84,7 @@ public function test_null_type_builds_a_null_column(): void
public function test_refusal_names_the_row_of_the_value(): void
{
try {
- (new ResultColumn(new PhpBackend()))->of(lit(1), [1, 2, 'x']);
+ new ResultColumn(new PhpBackend())->of(lit(1), [1, 2, 'x']);
static::fail('expected a SchemaMismatchException');
} catch (SchemaMismatchException $e) {
static::assertSame(2, $e->rowIndex);
@@ -93,7 +93,7 @@ public function test_refusal_names_the_row_of_the_value(): void
public function test_type_without_a_column_kind_is_an_untyped_column(): void
{
- $column = (new ResultColumn(new PhpBackend()))->of(call(lit('strval'), type_instance_of(ArrayObject::class)), [
+ $column = new ResultColumn(new PhpBackend())->of(call(lit('strval'), type_instance_of(ArrayObject::class)), [
new ArrayObject(),
null,
]);
@@ -104,8 +104,8 @@ public function test_type_without_a_column_kind_is_an_untyped_column(): void
public function test_underivable_return_is_an_untyped_column(): void
{
- $column = (new ResultColumn(new PhpBackend()))->of(
- (new ReferenceResolver())->resolve(ref('j')->jsonDecode()->arrayGet('name'), schema(json_schema('j'))),
+ $column = new ResultColumn(new PhpBackend())->of(
+ new ReferenceResolver()->resolve(ref('j')->jsonDecode()->arrayGet('name'), schema(json_schema('j'))),
['a', ['b' => 1]],
);
@@ -137,13 +137,13 @@ public function test_a_typed_column_holds_an_intermediate_only_when_it_keeps_the
Type $type,
bool $holds,
): void {
- static::assertSame($holds, (new ResultColumn(new PhpBackend()))->holdsLosslessly($type));
+ static::assertSame($holds, new ResultColumn(new PhpBackend())->holdsLosslessly($type));
}
public function test_an_untyped_array_keeps_its_objects(): void
{
$object = new ArrayObject();
- $column = (new ResultColumn(new PhpBackend()))->typed(type_optional(type_array()), [[$object, 'count']]);
+ $column = new ResultColumn(new PhpBackend())->typed(type_optional(type_array()), [[$object, 'count']]);
static::assertInstanceOf(ValueColumn::class, $column);
static::assertSame([[$object, 'count']], $column->values());
@@ -151,7 +151,7 @@ public function test_an_untyped_array_keeps_its_objects(): void
public function test_lists_of_an_expand_are_a_list_column(): void
{
- $column = (new ResultColumn(new PhpBackend()))->lists(lit(1), [[1, 2], []]);
+ $column = new ResultColumn(new PhpBackend())->lists(lit(1), [[1, 2], []]);
static::assertEquals(type_list(type_integer()), $column->type());
static::assertSame([[1, 2], []], $column->values());
@@ -192,7 +192,7 @@ public static function valuesOfTheColumnTypePerBackend(): Generator
#[DataProvider('valuesOfTheColumnTypePerBackend')]
public function test_values_of_the_column_type_stay_unchanged(Backend $backend, Type $type, array $values): void
{
- $column = (new ResultColumn($backend))->typed(type_optional($type), $values);
+ $column = new ResultColumn($backend)->typed(type_optional($type), $values);
static::assertSame($values, $column->physicals());
static::assertSame(1, $column->nullCount());
@@ -220,7 +220,7 @@ public function test_mixed_values_are_cast_into_the_column_type(
): void {
static::assertSame(
$expected,
- (new ResultColumn($backend))
+ new ResultColumn($backend)
->typed(type_optional($type), $values)
->physicals(),
);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Evaluation/SelectionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Evaluation/SelectionTest.php
index 73fd402c9b..cf84f61da1 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Evaluation/SelectionTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Evaluation/SelectionTest.php
@@ -43,8 +43,8 @@ public function test_all_rows_evaluate_the_batch_itself(): void
static::assertSame(
[1, 2],
- (new Selection([0, 1]))
- ->evaluate((new ReferenceResolver())->resolve($spy, $rows->schema()), $rows, flow_context()->backend())
+ new Selection([0, 1])
+ ->evaluate(new ReferenceResolver()->resolve($spy, $rows->schema()), $rows, flow_context()->backend())
->values(),
);
static::assertSame($rows, $spy->seen[0]);
@@ -55,8 +55,8 @@ public function test_an_error_names_the_row_of_the_batch(): void
$rows = array_to_rows([['v' => 1], ['v' => 2], ['v' => 3], ['v' => 4]], schema(int_schema('v')));
try {
- (new Selection([1, 3]))->evaluate(
- (new ReferenceResolver())->resolve(new FailingOnValuesFunction(ref('v'), [4]), $rows->schema()),
+ new Selection([1, 3])->evaluate(
+ new ReferenceResolver()->resolve(new FailingOnValuesFunction(ref('v'), [4]), $rows->schema()),
$rows,
flow_context()->backend(),
);
@@ -77,8 +77,8 @@ public function test_a_subset_holds_only_the_selected_rows_of_the_referenced_col
static::assertSame(
[1, 3],
- (new Selection([0, 2]))
- ->evaluate((new ReferenceResolver())->resolve($spy, $rows->schema()), $rows, flow_context()->backend())
+ new Selection([0, 2])
+ ->evaluate(new ReferenceResolver()->resolve($spy, $rows->schema()), $rows, flow_context()->backend())
->values(),
);
static::assertSame(['v'], array_keys($spy->seen[0]->columns()));
@@ -113,8 +113,8 @@ public function test_truths_are_the_php_truthiness_of_each_logical_value(
'v' => $value,
], $values), schema($definition));
- static::assertSame($truths, (new Selection(array_keys($values)))->truths(
- (new ReferenceResolver())->resolve(ref('v'), $rows->schema()),
+ static::assertSame($truths, new Selection(array_keys($values))->truths(
+ new ReferenceResolver()->resolve(ref('v'), $rows->schema()),
$rows,
flow_context()->backend(),
));
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Evaluation/TolerantEvaluationTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Evaluation/TolerantEvaluationTest.php
index f87f9575b2..ec1f76579a 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Evaluation/TolerantEvaluationTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Evaluation/TolerantEvaluationTest.php
@@ -26,8 +26,8 @@ public function test_an_empty_batch_has_no_failures_and_no_values(): void
static::assertSame(
['failed' => [], 'values' => []],
- (new TolerantEvaluation())->evaluate(
- (new ReferenceResolver())->resolve(new FailingOnValuesFunction(ref('id')), $rows->schema()),
+ new TolerantEvaluation()->evaluate(
+ new ReferenceResolver()->resolve(new FailingOnValuesFunction(ref('id')), $rows->schema()),
$rows,
flow_context()->backend(),
),
@@ -41,8 +41,8 @@ public function test_every_row_evaluates_in_one_batch_when_none_fails(): void
static::assertSame(
['failed' => [], 'values' => [0 => 1, 1 => 2, 2 => 3]],
- (new TolerantEvaluation())->evaluate(
- (new ReferenceResolver())->resolve($spy, $rows->schema()),
+ new TolerantEvaluation()->evaluate(
+ new ReferenceResolver()->resolve($spy, $rows->schema()),
$rows,
flow_context()->backend(),
),
@@ -57,8 +57,8 @@ public function test_failing_rows_are_reported_and_left_out_of_the_values(): voi
static::assertEquals(
['failed' => [1 => true, 3 => true], 'values' => [0 => 1, 2 => 3, 4 => 5]],
- (new TolerantEvaluation())->evaluate(
- (new ReferenceResolver())->resolve($spy, $rows->schema()),
+ new TolerantEvaluation()->evaluate(
+ new ReferenceResolver()->resolve($spy, $rows->schema()),
$rows,
flow_context()->backend(),
),
@@ -71,8 +71,8 @@ public function test_rows_past_the_retry_limit_go_one_by_one(): void
$spy = new FailingOnValuesFunction(ref('id'), range(1, 9));
$rows = IdRows::batches(range(1, 10))->current();
- $evaluated = (new TolerantEvaluation())->evaluate(
- (new ReferenceResolver())->resolve($spy, $rows->schema()),
+ $evaluated = new TolerantEvaluation()->evaluate(
+ new ReferenceResolver()->resolve($spy, $rows->schema()),
$rows,
flow_context()->backend(),
);
@@ -89,8 +89,8 @@ public function test_row_by_row_evaluates_each_given_row_alone(): void
static::assertSame(
['failed' => [1 => true], 'values' => [0 => 1, 3 => 4]],
- (new TolerantEvaluation())->rowByRow(
- (new ReferenceResolver())->resolve($spy, $rows->schema()),
+ new TolerantEvaluation()->rowByRow(
+ new ReferenceResolver()->resolve($spy, $rows->schema()),
$rows,
[0, 1, 3],
flow_context()->backend(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ExistsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ExistsTest.php
index 67ae7dc102..4abb955117 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ExistsTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ExistsTest.php
@@ -27,7 +27,7 @@ final class ExistsTest extends FlowTestCase
{
public function test_a_throwing_operand_means_the_reference_does_not_exist(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
new Exists(ref('value')->upper()),
[
'value' => 1,
@@ -38,7 +38,7 @@ public function test_a_throwing_operand_means_the_reference_does_not_exist(): vo
public function test_if_reference_exists(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('value')->exists(),
['value' => 'test'],
schema(str_schema('value')),
@@ -47,12 +47,12 @@ public function test_if_reference_exists(): void
public function test_that_lit_function_exists(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(new Exists(lit('val')), [], schema()));
+ static::assertTrue(new FunctionContext(flow_context())->eval(new Exists(lit('val')), [], schema()));
}
public function test_that_null_reference_to_null_entry_exists(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('value')->exists(),
['value' => null],
schema(str_schema('value', nullable: true)),
@@ -61,7 +61,7 @@ public function test_that_null_reference_to_null_entry_exists(): void
public function test_that_reference_does_not_exists(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(ref('value')->exists(), [], schema()));
+ static::assertFalse(new FunctionContext(flow_context())->eval(ref('value')->exists(), [], schema()));
}
/**
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ExpandingFunctionsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ExpandingFunctionsTest.php
index e64a8c6439..45108f3da5 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ExpandingFunctionsTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ExpandingFunctionsTest.php
@@ -20,14 +20,14 @@ final class ExpandingFunctionsTest extends FlowTestCase
{
public function test_in_is_empty_without_an_expand(): void
{
- static::assertSame([], (new ExpandingFunctions())->in(concat(ref('id'), lit('x'))));
+ static::assertSame([], new ExpandingFunctions()->in(concat(ref('id'), lit('x'))));
}
public function test_in_includes_the_root(): void
{
$expand = ref('tags')->expand();
- static::assertSame([$expand], (new ExpandingFunctions())->in($expand));
+ static::assertSame([$expand], new ExpandingFunctions()->in($expand));
}
public function test_in_lists_expands_in_pre_order(): void
@@ -37,7 +37,7 @@ public function test_in_lists_expands_in_pre_order(): void
static::assertSame(
[$tags, $nums],
- (new ExpandingFunctions())->in(structure(['a' => $tags, 'b' => concat(lit('-'), $nums)])),
+ new ExpandingFunctions()->in(structure(['a' => $tags, 'b' => concat(lit('-'), $nums)])),
);
}
@@ -45,10 +45,7 @@ public function test_in_finds_an_expand_that_is_an_on_each_operand(): void
{
$expand = ref('lists')->expand();
- static::assertSame(
- [$expand],
- (new ExpandingFunctions())->in($expand->onEach(concat(ref('element'), lit('!')))),
- );
+ static::assertSame([$expand], new ExpandingFunctions()->in($expand->onEach(concat(ref('element'), lit('!')))));
}
public function test_refuse_names_the_site(): void
@@ -58,14 +55,14 @@ public function test_refuse_names_the_site(): void
'filter() cannot contain array_expand(), it turns one row into many rows. Expand with withColumn() first, then use the new column.',
);
- (new ExpandingFunctions())->refuse(ref('tags')->expand()->equals(lit('x')), 'filter');
+ new ExpandingFunctions()->refuse(ref('tags')->expand()->equals(lit('x')), 'filter');
}
public function test_refuse_passes_a_tree_without_an_expand(): void
{
$this->expectNotToPerformAssertions();
- (new ExpandingFunctions())->refuse(ref('id')->equals(lit('x')), 'filter');
+ new ExpandingFunctions()->refuse(ref('id')->equals(lit('x')), 'filter');
}
#[DataProvider('expand_inside_expand_provider')]
@@ -76,7 +73,7 @@ public function test_refuse_nested_refuses_an_expand_below_an_expand(ScalarFunct
'array_expand() cannot contain another array_expand(). Expand one level per withColumn().',
);
- (new ExpandingFunctions())->refuseNested($tree);
+ new ExpandingFunctions()->refuseNested($tree);
}
/**
@@ -93,7 +90,7 @@ public function test_refuse_nested_passes_sibling_expands(): void
{
$this->expectNotToPerformAssertions();
- (new ExpandingFunctions())->refuseNested(structure([
+ new ExpandingFunctions()->refuseNested(structure([
'n' => ref('nums')->expand(),
't' => ref('tags')->expand(),
]));
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/FirstTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/FirstTest.php
index 34fdfa0197..4612c7e556 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/FirstTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/FirstTest.php
@@ -91,7 +91,7 @@ public function test_first_over_an_int_column_declares_optional_integer(): void
{
static::assertSame(
'?integer',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(first(ref('v')), schema(int_schema('v')))
->returns()
->toString(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/GreatestTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/GreatestTest.php
index d33c9efd02..0c34fefa45 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/GreatestTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/GreatestTest.php
@@ -26,13 +26,13 @@ final class GreatestTest extends FlowTestCase
{
public function test_children_of_keyed_values_are_a_list(): void
{
- static::assertTrue(array_is_list((new Greatest(['a' => lit(1), 'b' => lit(2)]))->children()));
+ static::assertTrue(array_is_list(new Greatest(['a' => lit(1), 'b' => lit(2)])->children()));
}
public function test_a_non_nullable_operand_makes_the_result_not_nullable(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(
+ $resolved = new ReferenceResolver()->resolve(
greatest(ref('int'), lit(10)),
schema(int_schema('int', nullable: true)),
);
@@ -42,7 +42,7 @@ public function test_a_non_nullable_operand_makes_the_result_not_nullable(): voi
public function test_greatest_value(): void
{
- static::assertSame(55, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(55, new FunctionContext(flow_context())->eval(
greatest(10, 20, ref('int'), 40),
['int' => 55],
schema(int_schema('int')),
@@ -65,7 +65,7 @@ public function test_an_integer_and_a_string_column_have_no_common_type(): void
public function test_nulls_are_skipped(): void
{
- static::assertSame(20, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(20, new FunctionContext(flow_context())->eval(
greatest(null, 20, ref('int')),
[
'int' => 4,
@@ -76,7 +76,7 @@ public function test_nulls_are_skipped(): void
public function test_null_only_when_every_argument_is_null(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
greatest(null, null),
[
'int' => 4,
@@ -87,7 +87,7 @@ public function test_null_only_when_every_argument_is_null(): void
public function test_greatest_with_null(): void
{
- static::assertSame(1257, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(1257, new FunctionContext(flow_context())->eval(
greatest(null, 20, ref('int'), 1257),
[
'int' => 55,
@@ -98,7 +98,7 @@ public function test_greatest_with_null(): void
public function test_greatest_orders_strings_by_bytes(): void
{
- static::assertSame('9', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('9', new FunctionContext(flow_context())->eval(
greatest(ref('a'), lit('10'), lit('9')),
['a' => null],
schema(str_schema('a', nullable: true)),
@@ -107,7 +107,7 @@ public function test_greatest_orders_strings_by_bytes(): void
public function test_greatest_orders_a_numeric_string_column_numerically(): void
{
- static::assertSame('10', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('10', new FunctionContext(flow_context())->eval(
greatest(ref('a'), ref('b')),
['a' => '9', 'b' => '10'],
schema(definition_from_type('a', type_numeric_string()), definition_from_type('b', type_numeric_string())),
@@ -116,7 +116,7 @@ public function test_greatest_orders_a_numeric_string_column_numerically(): void
public function test_greatest_keeps_the_first_of_equal_values(): void
{
- static::assertSame('10', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('10', new FunctionContext(flow_context())->eval(
greatest(ref('a'), ref('b')),
['a' => '10', 'b' => '10.0'],
schema(definition_from_type('a', type_numeric_string()), definition_from_type('b', type_numeric_string())),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/HTMLQuerySelectorAllTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/HTMLQuerySelectorAllTest.php
index a9896c51f3..6bdaf46f64 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/HTMLQuerySelectorAllTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/HTMLQuerySelectorAllTest.php
@@ -7,13 +7,11 @@
use Dom\Element;
use Dom\HTMLDocument;
use Flow\ETL\Foundation\Exception\InvalidArgumentException;
-use Flow\ETL\Foundation\Exception\RequiredPHPVersionException;
use Flow\ETL\Functions\HTMLQuerySelectorAll;
use Flow\ETL\Tests\Context\DescribeRoundTrip;
use Flow\ETL\Tests\Context\FunctionContext;
use Flow\ETL\Tests\Context\ScalarFunctionFixtures;
use Flow\ETL\Values\Column\PhpBackend;
-use PHPUnit\Framework\Attributes\RequiresPhp;
use PHPUnit\Framework\TestCase;
use function Flow\ETL\DSL\flow_context;
@@ -25,26 +23,13 @@
final class HTMLQuerySelectorAllTest extends TestCase
{
- #[RequiresPhp('< 8.4.0')]
- public function test_getting_element_for_older_versions(): void
- {
- $this->expectException(RequiredPHPVersionException::class);
- (new FunctionContext(flow_context()))->eval(
- ref('value')->htmlQuerySelectorAll('body div p'),
- ['value' => ''],
- schema(str_schema('value')),
- );
- }
-
- #[RequiresPhp('>= 8.4.0')]
public function test_getting_elements_for_given_path(): void
{
- // @mago-ignore analysis:unavailable-method
$html = HTMLDocument::createFromString(
'foobar
',
);
/** @var array $result */
- $result = (new FunctionContext(flow_context()))->eval(
+ $result = new FunctionContext(flow_context())->eval(
ref('value')->htmlQuerySelectorAll('body div span'),
['value' => $html],
schema(html_schema('value')),
@@ -53,27 +38,24 @@ public function test_getting_elements_for_given_path(): void
static::assertInstanceOf(Element::class, $result[0]);
}
- #[RequiresPhp('>= 8.4.0')]
public function test_getting_null_when_nothing_found(): void
{
- // @mago-ignore analysis:unavailable-method
$html = HTMLDocument::createFromString(
'foobar
',
);
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('value')->htmlQuerySelectorAll('body div p'),
['value' => $html],
schema(html_schema('value')),
));
}
- #[RequiresPhp('>= 8.4.0')]
public function test_invalid_value(): void
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected one of');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->htmlQuerySelectorAll('body div span'),
['value' => ''],
schema(str_schema('value')),
@@ -84,11 +66,7 @@ public function test_describe_round_trips(): void
{
$context = new FunctionContext();
- try {
- $function = new HTMLQuerySelectorAll(ref('html'), lit('div'));
- } catch (RequiredPHPVersionException $e) {
- static::markTestSkipped($e->getMessage());
- }
+ $function = new HTMLQuerySelectorAll(ref('html'), lit('div'));
$rebuilt = DescribeRoundTrip::rebuilt($function);
$rows = ScalarFunctionFixtures::rows(new PhpBackend());
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/HTMLQuerySelectorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/HTMLQuerySelectorTest.php
index cd911678f9..0621b2d11c 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/HTMLQuerySelectorTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/HTMLQuerySelectorTest.php
@@ -7,13 +7,11 @@
use Dom\Element;
use Dom\HTMLDocument;
use Flow\ETL\Foundation\Exception\InvalidArgumentException;
-use Flow\ETL\Foundation\Exception\RequiredPHPVersionException;
use Flow\ETL\Functions\HTMLQuerySelector;
use Flow\ETL\Tests\Context\DescribeRoundTrip;
use Flow\ETL\Tests\Context\FunctionContext;
use Flow\ETL\Tests\Context\ScalarFunctionFixtures;
use Flow\ETL\Values\Column\PhpBackend;
-use PHPUnit\Framework\Attributes\RequiresPhp;
use PHPUnit\Framework\TestCase;
use function Flow\ETL\DSL\flow_context;
@@ -25,52 +23,36 @@
final class HTMLQuerySelectorTest extends TestCase
{
- #[RequiresPhp('< 8.4.0')]
- public function test_getting_element_for_older_versions(): void
- {
- $this->expectException(RequiredPHPVersionException::class);
- (new FunctionContext(flow_context()))->eval(
- ref('value')->htmlQuerySelector('body div p'),
- ['value' => ''],
- schema(str_schema('value')),
- );
- }
-
- #[RequiresPhp('>= 8.4.0')]
public function test_getting_elements_for_given_path(): void
{
- // @mago-ignore analysis:unavailable-method
$html = HTMLDocument::createFromString(
'foobar
',
);
- static::assertInstanceOf(Element::class, (new FunctionContext(flow_context()))->eval(
+ static::assertInstanceOf(Element::class, new FunctionContext(flow_context())->eval(
ref('value')->htmlQuerySelector('body div span'),
['value' => $html],
schema(html_schema('value')),
));
}
- #[RequiresPhp('>= 8.4.0')]
public function test_getting_null_when_nothing_found(): void
{
- // @mago-ignore analysis:unavailable-method
$html = HTMLDocument::createFromString(
'foobar
',
);
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('value')->htmlQuerySelector('body div p'),
['value' => $html],
schema(html_schema('value')),
));
}
- #[RequiresPhp('>= 8.4.0')]
public function test_invalid_value(): void
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected one of');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->htmlQuerySelector('body div span'),
['value' => ''],
schema(str_schema('value')),
@@ -81,11 +63,7 @@ public function test_describe_round_trips(): void
{
$context = new FunctionContext();
- try {
- $function = new HTMLQuerySelector(ref('html'), lit('div'));
- } catch (RequiredPHPVersionException $e) {
- static::markTestSkipped($e->getMessage());
- }
+ $function = new HTMLQuerySelector(ref('html'), lit('div'));
$rebuilt = DescribeRoundTrip::rebuilt($function);
$rows = ScalarFunctionFixtures::rows(new PhpBackend());
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/HashTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/HashTest.php
index 8c6a44a7a7..fa109c86ee 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/HashTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/HashTest.php
@@ -152,7 +152,7 @@ public function test_hash_output_is_pinned_per_value_kind_and_algorithm(
HashAlgorithm $algorithm,
?string $expected,
): void {
- static::assertSame($expected, (new FunctionContext(flow_context()))->eval(
+ static::assertSame($expected, new FunctionContext(flow_context())->eval(
ref('value')->hash($algorithm),
['value' => $value],
$schema,
@@ -161,7 +161,7 @@ public function test_hash_output_is_pinned_per_value_kind_and_algorithm(
public function test_hashing_concat(): void
{
- static::assertSame('5d22af35c78f30e5d85f3b65d988f8fb', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('5d22af35c78f30e5d85f3b65d988f8fb', new FunctionContext(flow_context())->eval(
hash(concat(ref('value'), lit('_'), ref('value')), HashAlgorithm::xxh128),
[
'value' => 'test',
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IndexOfLastTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IndexOfLastTest.php
index d8084390e2..eb76d05fb0 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IndexOfLastTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IndexOfLastTest.php
@@ -24,7 +24,7 @@ public function test_index_of_last_ignoring_case_over_two_rows(): void
static::assertSame(
[1, 0],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(ref('str')->indexOfLast('A', ignoreCase: true), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
@@ -33,7 +33,7 @@ public function test_index_of_last_ignoring_case_over_two_rows(): void
public function test_index_of_last_with_null_ignore_case_is_case_sensitive(): void
{
- static::assertSame(0, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(0, new FunctionContext(flow_context())->eval(
ref('str')->indexOfLast('A', ref('ignore_case')),
['str' => 'Aa', 'ignore_case' => null],
schema(str_schema('str'), bool_schema('ignore_case', nullable: true)),
@@ -42,7 +42,7 @@ public function test_index_of_last_with_null_ignore_case_is_case_sensitive(): vo
public function test_index_of_last_basic(): void
{
- static::assertSame(9, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(9, new FunctionContext(flow_context())->eval(
ref('str')->indexOfLast('l'),
['str' => 'hello world'],
schema(str_schema('str')),
@@ -51,7 +51,7 @@ public function test_index_of_last_basic(): void
public function test_index_of_last_is_case_sensitive_by_default(): void
{
- static::assertSame(0, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(0, new FunctionContext(flow_context())->eval(
ref('s')->indexOfLast('A'),
['s' => 'Aa'],
schema(str_schema('s')),
@@ -60,7 +60,7 @@ public function test_index_of_last_is_case_sensitive_by_default(): void
public function test_index_of_last_searches_from_the_start_by_default(): void
{
- static::assertSame(0, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(0, new FunctionContext(flow_context())->eval(
ref('s')->indexOfLast('a'),
['s' => 'ab'],
schema(str_schema('s')),
@@ -69,7 +69,7 @@ public function test_index_of_last_searches_from_the_start_by_default(): void
public function test_index_of_last_not_found(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('str')->indexOfLast('x'),
['str' => 'hello world'],
schema(str_schema('str')),
@@ -81,7 +81,7 @@ public function test_index_of_last_throws_on_null_needle(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('IndexOfLast function requires non-null string and needle');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->indexOfLast(ref('needle')),
['str' => 'hello', 'needle' => null],
schema(str_schema('str'), str_schema('needle', nullable: true)),
@@ -93,7 +93,7 @@ public function test_index_of_last_throws_on_null_string(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('IndexOfLast function requires non-null string and needle');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->indexOfLast('l'),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -102,7 +102,7 @@ public function test_index_of_last_throws_on_null_string(): void
public function test_index_of_last_with_scalar_function_parameters(): void
{
- static::assertSame(9, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(9, new FunctionContext(flow_context())->eval(
ref('str')->indexOfLast(ref('needle'), ref('ignore_case')),
['str' => 'hello world', 'needle' => 'L', 'ignore_case' => true],
schema(str_schema('str'), str_schema('needle'), bool_schema('ignore_case')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IndexOfTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IndexOfTest.php
index 56028bd589..d3a542d4ca 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IndexOfTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IndexOfTest.php
@@ -24,7 +24,7 @@ public function test_index_of_ignoring_case_over_two_rows(): void
static::assertSame(
[0, 1],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(ref('str')->indexOf('a', ignoreCase: true), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
@@ -33,25 +33,25 @@ public function test_index_of_ignoring_case_over_two_rows(): void
public function test_index_of(): void
{
- static::assertSame(5, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(5, new FunctionContext(flow_context())->eval(
ref('str')->indexOf('x', offset: 5),
['str' => 'AbBAsxa'],
schema(str_schema('str')),
));
- static::assertSame(0, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(0, new FunctionContext(flow_context())->eval(
ref('str')->indexOf('A', ignoreCase: true),
['str' => 'abbbbb'],
schema(str_schema('str')),
));
- static::assertSame(5, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(5, new FunctionContext(flow_context())->eval(
ref('str')->indexOf('x', offset: 5),
['str' => 'AbBAsxa'],
schema(str_schema('str')),
));
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('str')->indexOf('x', offset: 2),
['str' => 'Abba'],
schema(str_schema('str')),
@@ -60,7 +60,7 @@ public function test_index_of(): void
public function test_index_of_with_null_ignore_case_is_case_sensitive(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('str')->indexOf('a', ref('ignore_case')),
['str' => 'Abc', 'ignore_case' => null],
schema(str_schema('str'), bool_schema('ignore_case', nullable: true)),
@@ -69,7 +69,7 @@ public function test_index_of_with_null_ignore_case_is_case_sensitive(): void
public function test_index_of_is_case_sensitive_by_default(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('s')->indexOf('a'),
['s' => 'Abc'],
schema(str_schema('s')),
@@ -81,7 +81,7 @@ public function test_index_of_throws_on_null_needle(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('IndexOf function requires non-null string and needle');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->indexOf(ref('needle')),
['str' => 'x', 'needle' => null],
schema(str_schema('str'), str_schema('needle', nullable: true)),
@@ -93,7 +93,7 @@ public function test_index_of_throws_on_null_string(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('IndexOf function requires non-null string and needle');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->indexOf('x'),
['str' => null],
schema(str_schema('str', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsEmptyTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsEmptyTest.php
index 568a91785a..31eee6e780 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsEmptyTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsEmptyTest.php
@@ -22,7 +22,7 @@ public function test_a_null_row_does_not_stop_later_rows(): void
static::assertSame(
[null, true],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(ref('str')->isEmpty(), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
@@ -31,7 +31,7 @@ public function test_a_null_row_does_not_stop_later_rows(): void
public function test_is_empty_empty_string(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('str')->isEmpty(),
['str' => ''],
schema(str_schema('str')),
@@ -40,7 +40,7 @@ public function test_is_empty_empty_string(): void
public function test_is_empty_non_empty_string(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
ref('str')->isEmpty(),
['str' => 'hello'],
schema(str_schema('str')),
@@ -49,7 +49,7 @@ public function test_is_empty_non_empty_string(): void
public function test_is_empty_returns_null_for_null_input(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('str')->isEmpty(),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -58,7 +58,7 @@ public function test_is_empty_returns_null_for_null_input(): void
public function test_is_empty_single_character_string(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
ref('str')->isEmpty(),
['str' => 'a'],
schema(str_schema('str')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsInTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsInTest.php
index 19a7470e5a..95893bfc4e 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsInTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsInTest.php
@@ -57,13 +57,13 @@ public function test_a_heterogeneous_haystack_casts_every_candidate_to_the_needl
"Column \"needle\" value 'a' cannot be cast to integer to compare: \"a\" is not a number (row 0)",
);
- (new FunctionContext(flow_context()))->eval(lit('a')->isIn(lit([1, 'a'])), [], schema());
+ new FunctionContext(flow_context())->eval(lit('a')->isIn(lit([1, 'a'])), [], schema());
}
public function test_is_in_matches_two_equal_datetimes(): void
{
// in_array(strict: true) compared these by identity and answered false
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
lit(new DateTimeImmutable('2024-01-01 10:00:00'))
->isIn(lit([new DateTimeImmutable('2024-01-01 10:00:00')])),
[],
@@ -74,12 +74,12 @@ public function test_is_in_matches_two_equal_datetimes(): void
public function test_is_in_matches_two_equal_date_intervals_by_value(): void
{
// a time list of the needle's type compares by the physical form, as equals() does
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
lit(new DateInterval('PT1H'))->equals(lit(new DateInterval('PT60M'))),
[],
schema(),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
lit(new DateInterval('PT1H'))->isIn(lit([new DateInterval('PT60M')])),
[],
schema(),
@@ -89,17 +89,17 @@ public function test_is_in_matches_two_equal_date_intervals_by_value(): void
public function test_is_in_over_an_empty_haystack(): void
{
static::assertSame('boolean', lit('a')->isIn(lit([]))->returns()->toString());
- static::assertFalse((new FunctionContext(flow_context()))->eval(lit('a')->isIn(lit([])), [], schema()));
+ static::assertFalse(new FunctionContext(flow_context())->eval(lit('a')->isIn(lit([])), [], schema()));
}
public function test_is_in_agrees_with_equals_on_numeric_operands(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('a')->equals(lit(1)),
['a' => '1'],
schema(str_schema('a')),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('a')->isIn(lit([1])),
['a' => '1'],
schema(str_schema('a')),
@@ -108,7 +108,7 @@ public function test_is_in_agrees_with_equals_on_numeric_operands(): void
public function test_a_string_candidate_casts_to_the_needle_type(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('n')->isIn(lit(['1'])),
['n' => 1],
schema(int_schema('n')),
@@ -117,7 +117,7 @@ public function test_a_string_candidate_casts_to_the_needle_type(): void
public function test_a_number_candidate_widens_with_the_needle(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('n')->isIn(lit([1.0])),
['n' => 1],
schema(int_schema('n')),
@@ -134,11 +134,7 @@ public function test_a_candidate_that_does_not_cast_to_the_needle_type_throws(ar
$this->expectException(EvaluationException::class);
$this->expectExceptionMessage("value 'x' cannot be cast to integer to compare");
- (new FunctionContext(flow_context()))->eval(
- ref('n')->isIn(lit($haystack)),
- ['n' => 1],
- schema(int_schema('n')),
- );
+ new FunctionContext(flow_context())->eval(ref('n')->isIn(lit($haystack)), ['n' => 1], schema(int_schema('n')));
}
public function test_a_cast_error_names_the_needle_column_read_never_the_alias(): void
@@ -146,7 +142,7 @@ public function test_a_cast_error_names_the_needle_column_read_never_the_alias()
$this->expectException(EvaluationException::class);
$this->expectExceptionMessage("Column \"n\" value 'x' cannot be cast to integer to compare");
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('n')->as('m')->isIn(lit([1])),
['n' => 'x'],
schema(str_schema('n')),
@@ -165,27 +161,27 @@ public function test_is_in_refuses_an_incomparable_element_type(): void
public function test_a_match_beats_a_null_element(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(lit(5)->isIn(lit([1, null, 5])), [], schema()));
+ static::assertTrue(new FunctionContext(flow_context())->eval(lit(5)->isIn(lit([1, null, 5])), [], schema()));
}
public function test_no_match_with_a_null_element_is_null(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(lit(7)->isIn(lit([1, null, 5])), [], schema()));
+ static::assertNull(new FunctionContext(flow_context())->eval(lit(7)->isIn(lit([1, null, 5])), [], schema()));
}
public function test_no_match_without_a_null_element_is_false(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(lit(7)->isIn(lit([1, 3, 5])), [], schema()));
+ static::assertFalse(new FunctionContext(flow_context())->eval(lit(7)->isIn(lit([1, 3, 5])), [], schema()));
}
public function test_a_null_needle_is_null(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(lit(null)->isIn(lit([1, 3, 5])), [], schema()));
+ static::assertNull(new FunctionContext(flow_context())->eval(lit(null)->isIn(lit([1, 3, 5])), [], schema()));
}
public function test_a_null_haystack_is_null(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(lit(5)->isIn(lit(null)), [], schema()));
+ static::assertNull(new FunctionContext(flow_context())->eval(lit(5)->isIn(lit(null)), [], schema()));
}
/**
@@ -240,7 +236,7 @@ public function test_a_list_of_the_needle_type_matches_by_value(
mixed $element,
bool $in,
): void {
- static::assertSame($in, (new FunctionContext(flow_context()))->eval(
+ static::assertSame($in, new FunctionContext(flow_context())->eval(
ref('a')->isIn(ref('h')),
['a' => $needle, 'h' => [$element]],
schema(definition_from_type('a', $type), definition_from_type('h', type_list($type))),
@@ -257,7 +253,7 @@ public function test_a_map_of_the_needle_type_matches_by_value(
mixed $element,
bool $in,
): void {
- static::assertSame($in, (new FunctionContext(flow_context()))->eval(
+ static::assertSame($in, new FunctionContext(flow_context())->eval(
ref('a')->isIn(ref('h')),
['a' => $needle, 'h' => ['k' => $element]],
schema(definition_from_type('a', $type), definition_from_type('h', type_map(type_string(), $type))),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsNotNullTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsNotNullTest.php
index 1c06bcf862..76dc464d56 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsNotNullTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsNotNullTest.php
@@ -23,7 +23,7 @@ final class IsNotNullTest extends TestCase
#[DataProviderExternal(BackendsContext::class, 'backends')]
public function test_answers_per_row(Backend $backend): void
{
- $column = (new FunctionContext(flow_context(config_builder()->backend($backend)->build())))->column(
+ $column = new FunctionContext(flow_context(config_builder()->backend($backend)->build()))->column(
ref('a')->isNotNull(),
[['a' => 1], ['a' => null], ['a' => 3]],
schema(int_schema('a', nullable: true)),
@@ -37,7 +37,7 @@ public function test_answers_per_row(Backend $backend): void
#[DataProviderExternal(BackendsContext::class, 'backends')]
public function test_a_column_without_nulls_answers(Backend $backend): void
{
- $column = (new FunctionContext(flow_context(config_builder()->backend($backend)->build())))->column(
+ $column = new FunctionContext(flow_context(config_builder()->backend($backend)->build()))->column(
ref('a')->isNotNull(),
[['a' => 1], ['a' => 2]],
schema(int_schema('a', nullable: true)),
@@ -51,7 +51,7 @@ public function test_no_rows_answer_with_an_empty_column(): void
{
static::assertSame(
0,
- (new FunctionContext(flow_context(config_builder()->backend(new PhpBackend())->build())))
+ new FunctionContext(flow_context(config_builder()->backend(new PhpBackend())->build()))
->column(ref('a')->isNotNull(), [], schema(int_schema('a', nullable: true)))
->count(),
);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsNotNumericTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsNotNumericTest.php
index c5434754c8..4f3d78dde7 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsNotNumericTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsNotNumericTest.php
@@ -21,7 +21,7 @@ public function test_a_null_row_does_not_stop_later_rows(): void
static::assertSame(
[null, true],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(ref('str')->isNotNumeric(), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsNullTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsNullTest.php
index dbd3f79d0d..7719775b07 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsNullTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsNullTest.php
@@ -23,7 +23,7 @@ final class IsNullTest extends TestCase
#[DataProviderExternal(BackendsContext::class, 'backends')]
public function test_answers_per_row(Backend $backend): void
{
- $column = (new FunctionContext(flow_context(config_builder()->backend($backend)->build())))->column(
+ $column = new FunctionContext(flow_context(config_builder()->backend($backend)->build()))->column(
ref('a')->isNull(),
[['a' => 1], ['a' => null], ['a' => 3]],
schema(int_schema('a', nullable: true)),
@@ -37,7 +37,7 @@ public function test_answers_per_row(Backend $backend): void
#[DataProviderExternal(BackendsContext::class, 'backends')]
public function test_a_column_without_nulls_answers(Backend $backend): void
{
- $column = (new FunctionContext(flow_context(config_builder()->backend($backend)->build())))->column(
+ $column = new FunctionContext(flow_context(config_builder()->backend($backend)->build()))->column(
ref('a')->isNull(),
[['a' => 1], ['a' => 2]],
schema(int_schema('a', nullable: true)),
@@ -51,7 +51,7 @@ public function test_no_rows_answer_with_an_empty_column(): void
{
static::assertSame(
0,
- (new FunctionContext(flow_context(config_builder()->backend(new PhpBackend())->build())))
+ new FunctionContext(flow_context(config_builder()->backend(new PhpBackend())->build()))
->column(ref('a')->isNull(), [], schema(int_schema('a', nullable: true)))
->count(),
);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsNumericTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsNumericTest.php
index ea13c9344b..1da1f5aa20 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsNumericTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsNumericTest.php
@@ -21,7 +21,7 @@ public function test_a_null_row_does_not_stop_later_rows(): void
static::assertSame(
[null, true],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(ref('str')->isNumeric(), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsTypeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsTypeTest.php
index 4950924274..2ad73f96cb 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsTypeTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsTypeTest.php
@@ -34,7 +34,7 @@ public function test_a_null_row_does_not_stop_later_rows(): void
{
static::assertSame(
[null, true, true],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
ref('value')->isType(type_integer(), type_integer()),
[['value' => null], ['value' => 1], ['value' => 2]],
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsUtf8Test.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsUtf8Test.php
index 866a38a131..4075612e3a 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsUtf8Test.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsUtf8Test.php
@@ -22,7 +22,7 @@ public function test_a_null_row_does_not_stop_later_rows(): void
static::assertSame(
[null, true],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(ref('str')->isUtf8(), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
@@ -31,7 +31,7 @@ public function test_a_null_row_does_not_stop_later_rows(): void
public function test_is_utf8_returns_null(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('str')->isUtf8(),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -40,13 +40,13 @@ public function test_is_utf8_returns_null(): void
public function test_is_utf_8(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('str')->isUtf8(),
['str' => 'Lorem Ipsum'],
schema(str_schema('str')),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
ref('str')->isUtf8(),
['str' => "\xc3\x28"],
schema(str_schema('str')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/AllTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/AllTest.php
index afaef0e500..c76545ddcc 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/AllTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/AllTest.php
@@ -32,7 +32,7 @@ public function test_from_description_without_comparisons_is_refused(): void
public function test_from_description_takes_string_keyed_comparisons(): void
{
- $described = (new Equal('a', 'b'))->describe();
+ $described = new Equal('a', 'b')->describe();
static::assertNotNull($described);
static::assertEquals(
@@ -43,7 +43,7 @@ public function test_from_description_takes_string_keyed_comparisons(): void
public function test_describe_lists_comparisons_given_by_name(): void
{
- $described = (new All(new Equal('a', 'b'), x: new Equal('c', 'd')))->describe();
+ $described = new All(new Equal('a', 'b'), x: new Equal('c', 'd'))->describe();
static::assertNotNull($described);
static::assertTrue(array_is_list(type_array()->assert(
@@ -53,12 +53,12 @@ public function test_describe_lists_comparisons_given_by_name(): void
public function test_left_lists_a_shared_column_once(): void
{
- static::assertEquals([ref('a')], (new All(new Equal('a', 'b'), new Equal('a', 'c')))->left());
+ static::assertEquals([ref('a')], new All(new Equal('a', 'b'), new Equal('a', 'c'))->left());
}
public function test_right_lists_a_shared_column_once(): void
{
- static::assertEquals([ref('b')], (new All(new Equal('a', 'b'), new Equal('c', 'b')))->right());
+ static::assertEquals([ref('b')], new All(new Equal('a', 'b'), new Equal('c', 'b'))->right());
}
public function test_describe_round_trips(): void
@@ -83,7 +83,7 @@ public function test_failure(): void
{
static::assertSame(
[false],
- (new All(new ConstantComparison(true), new ConstantComparison(false)))->compare(
+ new All(new ConstantComparison(true), new ConstantComparison(false))->compare(
array_to_rows([['id' => 1]], schema(int_schema('id'))),
array_to_rows([['id' => 2]], schema(int_schema('id'))),
),
@@ -94,7 +94,7 @@ public function test_success(): void
{
static::assertSame(
[true],
- (new All(new ConstantComparison(true), new ConstantComparison(true)))->compare(
+ new All(new ConstantComparison(true), new ConstantComparison(true))->compare(
array_to_rows([['id' => 1]], schema(int_schema('id'))),
array_to_rows([['id' => 2]], schema(int_schema('id'))),
),
@@ -105,7 +105,7 @@ public function test_combines_children_element_wise(): void
{
static::assertSame(
[true, false, false],
- (new All(new Equal('a', 'a'), new Equal('b', 'b')))->compare(
+ new All(new Equal('a', 'a'), new Equal('b', 'b'))->compare(
array_to_rows(
[['a' => 1, 'b' => 1], ['a' => 1, 'b' => 2], ['a' => 3, 'b' => 3]],
schema(int_schema('a'), int_schema('b')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/AnyTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/AnyTest.php
index b5d36da7e0..a68628002f 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/AnyTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/AnyTest.php
@@ -32,7 +32,7 @@ public function test_from_description_without_comparisons_is_refused(): void
public function test_from_description_takes_string_keyed_comparisons(): void
{
- $described = (new Equal('a', 'b'))->describe();
+ $described = new Equal('a', 'b')->describe();
static::assertNotNull($described);
static::assertEquals(
@@ -43,7 +43,7 @@ public function test_from_description_takes_string_keyed_comparisons(): void
public function test_describe_lists_comparisons_given_by_name(): void
{
- $described = (new Any(new Equal('a', 'b'), x: new Equal('c', 'd')))->describe();
+ $described = new Any(new Equal('a', 'b'), x: new Equal('c', 'd'))->describe();
static::assertNotNull($described);
static::assertTrue(array_is_list(type_array()->assert(
@@ -53,12 +53,12 @@ public function test_describe_lists_comparisons_given_by_name(): void
public function test_left_lists_a_shared_column_once(): void
{
- static::assertEquals([ref('a')], (new Any(new Equal('a', 'b'), new Equal('a', 'c')))->left());
+ static::assertEquals([ref('a')], new Any(new Equal('a', 'b'), new Equal('a', 'c'))->left());
}
public function test_right_lists_a_shared_column_once(): void
{
- static::assertEquals([ref('b')], (new Any(new Equal('a', 'b'), new Equal('c', 'b')))->right());
+ static::assertEquals([ref('b')], new Any(new Equal('a', 'b'), new Equal('c', 'b'))->right());
}
public function test_describe_round_trips(): void
@@ -83,7 +83,7 @@ public function test_failure(): void
{
static::assertSame(
[false],
- (new Any(new ConstantComparison(false), new ConstantComparison(false)))->compare(
+ new Any(new ConstantComparison(false), new ConstantComparison(false))->compare(
array_to_rows([['id' => 1]], schema(int_schema('id'))),
array_to_rows([['id' => 2]], schema(int_schema('id'))),
),
@@ -94,7 +94,7 @@ public function test_success(): void
{
static::assertSame(
[true],
- (new Any(new ConstantComparison(true), new ConstantComparison(false)))->compare(
+ new Any(new ConstantComparison(true), new ConstantComparison(false))->compare(
array_to_rows([['id' => 1]], schema(int_schema('id'))),
array_to_rows([['id' => 2]], schema(int_schema('id'))),
),
@@ -105,7 +105,7 @@ public function test_combines_children_element_wise(): void
{
static::assertSame(
[true, true, false],
- (new Any(new Equal('a', 'a'), new Equal('b', 'b')))->compare(
+ new Any(new Equal('a', 'a'), new Equal('b', 'b'))->compare(
array_to_rows(
[['a' => 1, 'b' => 1], ['a' => 1, 'b' => 2], ['a' => 3, 'b' => 3]],
schema(int_schema('a'), int_schema('b')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/EqualTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/EqualTest.php
index 39fd8bb1f5..915abdc1ba 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/EqualTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/EqualTest.php
@@ -42,7 +42,7 @@ public function test_failure(): void
{
static::assertSame(
[false],
- (new Equal('datetime', 'datetime'))->compare(
+ new Equal('datetime', 'datetime')->compare(
array_to_rows([[
'datetime' => new DateTimeImmutable('2022-10-01 00:00:00'),
]], schema(datetime_schema('datetime'))),
@@ -57,7 +57,7 @@ public function test_null_is_not_equal_to_null(): void
{
static::assertSame(
[false],
- (new Equal('id', 'id'))->compare(
+ new Equal('id', 'id')->compare(
array_to_rows([['id' => null]], schema(str_schema('id', nullable: true))),
array_to_rows([['id' => null]], schema(str_schema('id', nullable: true))),
),
@@ -68,14 +68,14 @@ public function test_null_is_not_equal_to_value(): void
{
static::assertSame(
[false],
- (new Equal('id', 'id'))->compare(
+ new Equal('id', 'id')->compare(
array_to_rows([['id' => null]], schema(int_schema('id', nullable: true))),
array_to_rows([['id' => 1]], schema(int_schema('id'))),
),
);
static::assertSame(
[false],
- (new Equal('id', 'id'))->compare(
+ new Equal('id', 'id')->compare(
array_to_rows([['id' => 1]], schema(int_schema('id'))),
array_to_rows([['id' => null]], schema(int_schema('id', nullable: true))),
),
@@ -89,7 +89,7 @@ public function test_a_string_that_does_not_cast_to_the_other_side_throws(): voi
'Column "id" value \'f47ac10b-58cc-4372-a567-0e02b2c3d479\' cannot be cast to integer',
);
- (new Equal('id', 'id'))->compare(
+ new Equal('id', 'id')->compare(
array_to_rows([['id' => 'f47ac10b-58cc-4372-a567-0e02b2c3d479']], schema(str_schema('id'))),
array_to_rows([['id' => 1]], schema(int_schema('id'))),
);
@@ -99,7 +99,7 @@ public function test_an_integral_string_past_two_to_the_53_casts_exactly(): void
{
static::assertSame(
[true, false],
- (new Equal('id', 'id'))->compare(
+ new Equal('id', 'id')->compare(
array_to_rows([['id' => '9007199254740993'], ['id' => '9007199254740993']], schema(str_schema('id'))),
array_to_rows([
['id' => 9_007_199_254_740_993],
@@ -113,7 +113,7 @@ public function test_a_numeric_string_casts_to_the_other_side(): void
{
static::assertSame(
[true, false],
- (new Equal('id', 'id'))->compare(
+ new Equal('id', 'id')->compare(
array_to_rows([['id' => '1'], ['id' => '1.5']], schema(str_schema('id'))),
array_to_rows([['id' => 1], ['id' => 1]], schema(int_schema('id'))),
),
@@ -124,7 +124,7 @@ public function test_uuid_objects_with_different_values_are_not_equal(): void
{
static::assertSame(
[false],
- (new Equal('id', 'id'))->compare(
+ new Equal('id', 'id')->compare(
array_to_rows([['id' => 'f47ac10b-58cc-4372-a567-0e02b2c3d479']], schema(str_schema('id'))),
array_to_rows([['id' => '00000000-0000-4000-8000-000000000000']], schema(str_schema('id'))),
),
@@ -135,7 +135,7 @@ public function test_uuid_objects_with_same_value_are_equal(): void
{
static::assertSame(
[true],
- (new Equal('id', 'id'))->compare(
+ new Equal('id', 'id')->compare(
array_to_rows([['id' => 'f47ac10b-58cc-4372-a567-0e02b2c3d479']], schema(str_schema('id'))),
array_to_rows([['id' => 'f47ac10b-58cc-4372-a567-0e02b2c3d479']], schema(str_schema('id'))),
),
@@ -146,7 +146,7 @@ public function test_success(): void
{
static::assertSame(
[true],
- (new Equal('datetime', 'datetime'))->compare(
+ new Equal('datetime', 'datetime')->compare(
array_to_rows([[
'datetime' => $datetime = new DateTimeImmutable('2022-10-01 00:00:00'),
]], schema(datetime_schema('datetime'))),
@@ -159,7 +159,7 @@ public function test_compares_pair_aligned_batches(): void
{
static::assertSame(
[true, false, false, true],
- (new Equal('a', 'b'))->compare(
+ new Equal('a', 'b')->compare(
array_to_rows([
['a' => 1],
['a' => 2],
@@ -175,7 +175,7 @@ public function test_numeric_strings_are_equal_only_when_identical_as_under_equa
{
static::assertSame(
[false, true],
- (new Equal('k', 'k'))->compare(
+ new Equal('k', 'k')->compare(
array_to_rows([['k' => '1'], ['k' => '1']], schema(str_schema('k'))),
array_to_rows([['k' => '1.0'], ['k' => '1']], schema(str_schema('k'))),
),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/IdenticalTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/IdenticalTest.php
index 55419fe86e..61416af3dc 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/IdenticalTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/IdenticalTest.php
@@ -41,7 +41,7 @@ public function test_failure(): void
{
static::assertSame(
[false],
- (new Identical('id', 'id'))->compare(
+ new Identical('id', 'id')->compare(
array_to_rows([['id' => 1]], schema(int_schema('id'))),
array_to_rows([['id' => 2]], schema(int_schema('id'))),
),
@@ -52,7 +52,7 @@ public function test_null_is_not_identical_to_null(): void
{
static::assertSame(
[false],
- (new Identical('id', 'id'))->compare(
+ new Identical('id', 'id')->compare(
array_to_rows([['id' => null]], schema(str_schema('id', nullable: true))),
array_to_rows([['id' => null]], schema(str_schema('id', nullable: true))),
),
@@ -63,14 +63,14 @@ public function test_null_is_not_identical_to_value(): void
{
static::assertSame(
[false],
- (new Identical('id', 'id'))->compare(
+ new Identical('id', 'id')->compare(
array_to_rows([['id' => null]], schema(int_schema('id', nullable: true))),
array_to_rows([['id' => 1]], schema(int_schema('id'))),
),
);
static::assertSame(
[false],
- (new Identical('id', 'id'))->compare(
+ new Identical('id', 'id')->compare(
array_to_rows([['id' => 1]], schema(int_schema('id'))),
array_to_rows([['id' => null]], schema(int_schema('id', nullable: true))),
),
@@ -81,7 +81,7 @@ public function test_success(): void
{
static::assertSame(
[true],
- (new Identical('id', 'id'))->compare(
+ new Identical('id', 'id')->compare(
array_to_rows([['id' => 1]], schema(int_schema('id'))),
array_to_rows([['id' => 1]], schema(int_schema('id'))),
),
@@ -92,7 +92,7 @@ public function test_compares_pair_aligned_batches(): void
{
static::assertSame(
[true, false, false],
- (new Identical('id', 'id'))->compare(
+ new Identical('id', 'id')->compare(
array_to_rows([['id' => 1], ['id' => 2], ['id' => null]], schema(int_schema('id', nullable: true))),
array_to_rows([['id' => 1], ['id' => 3], ['id' => null]], schema(int_schema('id', nullable: true))),
),
@@ -103,7 +103,7 @@ public function test_equal_datetimes_are_identical(): void
{
static::assertSame(
[true],
- (new Identical('at', 'at'))->compare(
+ new Identical('at', 'at')->compare(
array_to_rows([['at' => new DateTimeImmutable('2024-01-01 00:00:00')]], schema(datetime_schema('at'))),
array_to_rows([['at' => new DateTimeImmutable('2024-01-01 00:00:00')]], schema(datetime_schema('at'))),
),
@@ -114,7 +114,7 @@ public function test_equal_uuids_are_identical(): void
{
static::assertSame(
[true, false],
- (new Identical('id', 'id'))->compare(
+ new Identical('id', 'id')->compare(
array_to_rows([
['id' => '00000000-0000-4000-8000-000000000001'],
['id' => '00000000-0000-4000-8000-000000000001'],
@@ -131,7 +131,7 @@ public function test_values_of_different_types_are_not_identical(): void
{
static::assertSame(
[false],
- (new Identical('id', 'id'))->compare(
+ new Identical('id', 'id')->compare(
array_to_rows([['id' => 1]], schema(int_schema('id'))),
array_to_rows([['id' => '1']], schema(str_schema('id'))),
),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/JsonDecodeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/JsonDecodeTest.php
index f007078664..c469a14969 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/JsonDecodeTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/JsonDecodeTest.php
@@ -25,7 +25,7 @@ public function test_json_decode_expression(): void
{
static::assertSame(
['value' => 1],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->jsonDecode(),
['value' => '{"value": 1}'],
schema(str_schema('value')),
@@ -37,7 +37,7 @@ public function test_null_flags_decode_without_flags(): void
{
static::assertSame(
['value' => 1],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->jsonDecode(ref('flags')),
['value' => '{"value": 1}', 'flags' => null],
schema(str_schema('value'), int_schema('flags', nullable: true)),
@@ -49,7 +49,7 @@ public function test_every_json_row_is_decoded(): void
{
static::assertSame(
[['a' => 1], ['b' => 2]],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
ref('value')->jsonDecode(),
[['value' => new Json('{"a": 1}')], ['value' => new Json('{"b": 2}')]],
@@ -61,7 +61,7 @@ public function test_every_json_row_is_decoded(): void
public function test_json_with_511_nested_containers_is_decoded(): void
{
- static::assertIsArray((new FunctionContext(flow_context()))->eval(
+ static::assertIsArray(new FunctionContext(flow_context())->eval(
ref('value')->jsonDecode(),
['value' => str_repeat('[', 511) . str_repeat(']', 511)],
schema(str_schema('value')),
@@ -73,7 +73,7 @@ public function test_json_with_512_nested_containers_is_refused(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('JsonDecode error: Maximum stack depth exceeded');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->jsonDecode(),
['value' => str_repeat('[', 512) . str_repeat(']', 512)],
schema(str_schema('value')),
@@ -85,7 +85,7 @@ public function test_json_decode_expression_with_invalid_json(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('JsonDecode error: Syntax error');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->jsonDecode(),
['value' => '{"value": 1'],
schema(str_schema('value')),
@@ -95,7 +95,7 @@ public function test_json_decode_expression_with_invalid_json(): void
public function test_invalid_json_keeps_the_decoder_error_as_the_cause(): void
{
try {
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->jsonDecode(),
['value' => '{"value": 1'],
schema(str_schema('value')),
@@ -111,7 +111,7 @@ public function test_json_decode_on_non_json_value(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('JsonDecode function requires string, array, or Json value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->jsonDecode(),
['value' => 125],
schema(int_schema('value')),
@@ -125,7 +125,7 @@ public function test_json_decode_on_scalar_json_throws(): void
'JsonDecode function requires JSON that decodes to an array, cast scalar JSON instead',
);
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->jsonDecode(),
['value' => '5'],
schema(str_schema('value')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/JsonEncodeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/JsonEncodeTest.php
index ef6a1b478e..341c7c6d55 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/JsonEncodeTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/JsonEncodeTest.php
@@ -32,9 +32,9 @@ final class JsonEncodeTest extends FlowTestCase
public function test_json_encode_on_datetime(): void
{
// json_encode() of a non-container operand declares string, so the encoded object is a string
- static::assertSame('{"date":"2021-01-01 00:00:00.000000","timezone_type":3,"timezone":"UTC"}', (new FunctionContext(
+ static::assertSame('{"date":"2021-01-01 00:00:00.000000","timezone_type":3,"timezone":"UTC"}', new FunctionContext(
flow_context(),
- ))->eval(
+ )->eval(
ref('value')->jsonEncode(),
[
'value' => new DateTimeImmutable('2021-01-01'),
@@ -45,7 +45,7 @@ public function test_json_encode_on_datetime(): void
public function test_null_flags_encode_without_flags(): void
{
- static::assertSame('1', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('1', new FunctionContext(flow_context())->eval(
ref('value')->jsonEncode(ref('flags')),
['value' => 1, 'flags' => null],
schema(int_schema('value'), int_schema('flags', nullable: true)),
@@ -54,7 +54,7 @@ public function test_null_flags_encode_without_flags(): void
public function test_json_encode_on_integer(): void
{
- static::assertSame('125', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('125', new FunctionContext(flow_context())->eval(
ref('value')->jsonEncode(),
['value' => 125],
schema(int_schema('value')),
@@ -63,7 +63,7 @@ public function test_json_encode_on_integer(): void
public function test_json_encode_on_string(): void
{
- static::assertSame('"test"', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('"test"', new FunctionContext(flow_context())->eval(
ref('value')->jsonEncode(),
['value' => 'test'],
schema(str_schema('value')),
@@ -74,7 +74,7 @@ public function test_a_structure_declares_optional_json(): void
{
static::assertEquals(
type_optional(type_json()),
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('value')->jsonEncode(),
schema(structure_schema('value', type_structure(['a' => type_integer()]))),
@@ -87,7 +87,7 @@ public function test_every_row_after_a_null_is_encoded_to_json(): void
{
static::assertEquals(
[null, new Json('[1]'), new Json('[2]')],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
ref('value')->jsonEncode(),
[['value' => null], ['value' => [1]], ['value' => [2]]],
@@ -100,7 +100,7 @@ public function test_every_row_after_a_null_is_encoded_to_json(): void
public function test_json_encode_on_valid_associative_array(): void
{
// @mago-ignore analysis:mixed-assignment
- $result = (new FunctionContext(flow_context()))->eval(
+ $result = new FunctionContext(flow_context())->eval(
ref('value')->jsonEncode(),
['value' => [
'value' => 1,
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LastBatchColumnTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LastBatchColumnTest.php
index 3d9315daf1..4cc5798f38 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LastBatchColumnTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LastBatchColumnTest.php
@@ -33,7 +33,7 @@ public function test_another_batch_resolves_its_own_column(): void
public function test_a_batch_without_the_column_has_none(): void
{
- static::assertNull((new LastBatchColumn('missing'))->of(array_to_rows([[
+ static::assertNull(new LastBatchColumn('missing')->of(array_to_rows([[
'id' => 1,
]], schema(int_schema('id')))));
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LastTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LastTest.php
index 93c9d4aa07..63d60c14db 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LastTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LastTest.php
@@ -91,7 +91,7 @@ public function test_last_over_an_int_column_declares_optional_integer(): void
{
static::assertSame(
'?integer',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(last(ref('v')), schema(int_schema('v')))
->returns()
->toString(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LeastTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LeastTest.php
index 3adc13cdec..b6f9dde60d 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LeastTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LeastTest.php
@@ -26,13 +26,13 @@ final class LeastTest extends FlowTestCase
{
public function test_children_of_keyed_values_are_a_list(): void
{
- static::assertTrue(array_is_list((new Least(['a' => lit(1), 'b' => lit(2)]))->children()));
+ static::assertTrue(array_is_list(new Least(['a' => lit(1), 'b' => lit(2)])->children()));
}
public function test_a_non_nullable_operand_makes_the_result_not_nullable(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(
+ $resolved = new ReferenceResolver()->resolve(
least(ref('int'), lit(10)),
schema(int_schema('int', nullable: true)),
);
@@ -56,7 +56,7 @@ public function test_an_integer_and_a_string_column_have_no_common_type(): void
public function test_null_only_when_every_argument_is_null(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
least(null, null),
[
'int' => 4,
@@ -67,7 +67,7 @@ public function test_null_only_when_every_argument_is_null(): void
public function test_least_value(): void
{
- static::assertSame(10, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(10, new FunctionContext(flow_context())->eval(
least(10, 20, ref('int'), 40),
['int' => 55],
schema(int_schema('int')),
@@ -76,7 +76,7 @@ public function test_least_value(): void
public function test_least_with_null(): void
{
- static::assertSame(4, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(4, new FunctionContext(flow_context())->eval(
least(null, 20, ref('int'), 1257),
[
'int' => 4,
@@ -87,7 +87,7 @@ public function test_least_with_null(): void
public function test_least_orders_strings_by_bytes(): void
{
- static::assertSame('10', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('10', new FunctionContext(flow_context())->eval(
least(ref('a'), lit('10'), lit('9')),
['a' => null],
schema(str_schema('a', nullable: true)),
@@ -96,7 +96,7 @@ public function test_least_orders_strings_by_bytes(): void
public function test_least_orders_a_numeric_string_column_numerically(): void
{
- static::assertSame('9', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('9', new FunctionContext(flow_context())->eval(
least(ref('a'), ref('b')),
['a' => '9', 'b' => '10'],
schema(definition_from_type('a', type_numeric_string()), definition_from_type('b', type_numeric_string())),
@@ -105,7 +105,7 @@ public function test_least_orders_a_numeric_string_column_numerically(): void
public function test_least_keeps_the_first_of_equal_values(): void
{
- static::assertSame('10', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('10', new FunctionContext(flow_context())->eval(
least(ref('a'), ref('b')),
['a' => '10', 'b' => '10.0'],
schema(definition_from_type('a', type_numeric_string()), definition_from_type('b', type_numeric_string())),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ListSelectTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ListSelectTest.php
index 78cfece86d..5d58a382b1 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ListSelectTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ListSelectTest.php
@@ -29,7 +29,7 @@ final class ListSelectTest extends FlowTestCase
public function test_selecting_from_a_list_of_maps_declares_optional_map_value_types(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(
+ $resolved = new ReferenceResolver()->resolve(
new ListSelect(ref('list'), 'field'),
schema(list_schema('list', type_list(type_map(type_string(), type_integer())))),
);
@@ -40,7 +40,7 @@ public function test_selecting_from_a_list_of_maps_declares_optional_map_value_t
public function test_selecting_from_a_list_of_maps_of_mixed_keeps_the_value_mixed(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(
+ $resolved = new ReferenceResolver()->resolve(
new ListSelect(ref('list'), 'field'),
schema(list_schema('list', type_list(type_map(type_string(), type_mixed())))),
);
@@ -51,7 +51,7 @@ public function test_selecting_from_a_list_of_maps_of_mixed_keeps_the_value_mixe
public function test_selecting_from_a_list_of_scalars_declares_null_element_types(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(
+ $resolved = new ReferenceResolver()->resolve(
new ListSelect(ref('list'), 'field'),
schema(list_schema('list', type_list(type_string()))),
);
@@ -67,7 +67,7 @@ public function test_selecting_non_existing_value_from_list_using_alias(): void
['id' => 2, 'mail' => null],
['id' => 3, 'mail' => null],
],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
new ListSelect(ref('list'), ref('id'), ref('mail')),
[
'list' => [
@@ -92,7 +92,7 @@ public function test_selecting_value_from_list(): void
['id' => 2],
['id' => 3],
],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
new ListSelect(ref('list'), 'id'),
[
'list' => [
@@ -113,7 +113,7 @@ public function test_a_null_list_does_not_stop_the_next_row(): void
{
static::assertEquals(
[null, [['id' => 1]]],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
new ListSelect(ref('list'), 'id'),
[['list' => null], ['list' => [['id' => 1, 'name' => 'test']]]],
@@ -135,7 +135,7 @@ public function test_selecting_value_from_list_using_alias(): void
['new_id' => 2],
['new_id' => 3],
],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
new ListSelect(ref('list'), ref('id')->as('new_id')),
[
'list' => [
@@ -161,7 +161,7 @@ public function test_selecting_value_from_simple_list(): void
['id' => null],
['id' => null],
],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
new ListSelect(ref('list'), ref('id')),
['list' => [
'a',
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LiteralValueTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LiteralValueTest.php
index 52c9ae7147..5e7344f019 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LiteralValueTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LiteralValueTest.php
@@ -97,7 +97,7 @@ public function test_a_dom_node_does_not_encode(): void
$document = new DOMDocument();
$document->loadXML('1');
- static::assertNull((new LiteralValue())->encode($document->documentElement));
+ static::assertNull(new LiteralValue()->encode($document->documentElement));
}
public function test_an_array_with_a_dom_node_does_not_encode(): void
@@ -105,14 +105,14 @@ public function test_an_array_with_a_dom_node_does_not_encode(): void
$document = new DOMDocument();
$document->loadXML('1');
- static::assertNull((new LiteralValue())->encode(['node' => $document->documentElement]));
+ static::assertNull(new LiteralValue()->encode(['node' => $document->documentElement]));
}
public function test_decode_refuses_an_unknown_shape(): void
{
$this->expectException(InvalidArgumentException::class);
- (new LiteralValue())->decode(['type' => ['type' => 'float'], 'value' => 'not a float']);
+ new LiteralValue()->decode(['type' => ['type' => 'float'], 'value' => 'not a float']);
}
public function test_decode_refuses_a_missing_key(): void
@@ -120,13 +120,13 @@ public function test_decode_refuses_a_missing_key(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('A literal value is encoded as {type, value}');
- (new LiteralValue())->decode(['type' => ['type' => 'integer']]);
+ new LiteralValue()->decode(['type' => ['type' => 'integer']]);
}
public function test_decode_refuses_an_unknown_enum_case(): void
{
$this->expectException(InvalidArgumentException::class);
- (new LiteralValue())->decode(['type' => ['type' => 'enum', 'class' => Boundary::class], 'value' => 'NOPE']);
+ new LiteralValue()->decode(['type' => ['type' => 'enum', 'class' => Boundary::class], 'value' => 'NOPE']);
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LogicalFunctionsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LogicalFunctionsTest.php
index 716a26b5ec..1466fbf3ea 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LogicalFunctionsTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LogicalFunctionsTest.php
@@ -17,22 +17,22 @@ final class LogicalFunctionsTest extends FlowTestCase
{
public function test_logical_operations(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
ref('id')->isEven()->andNot(ref('id')->equals(lit(1))),
['id' => 1],
schema(int_schema('id')),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('id')->isOdd()->and(ref('id')->equals(lit(1))),
['id' => 1],
schema(int_schema('id')),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('id')->isEven()->or(ref('id')->equals(lit(1))),
['id' => 1],
schema(int_schema('id')),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
ref('id')->isOdd()->andNot(ref('id')->equals(lit(1))),
['id' => 1],
schema(int_schema('id')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MatchCasesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MatchCasesTest.php
index 5c4045b3bd..7c88c01308 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MatchCasesTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MatchCasesTest.php
@@ -40,10 +40,10 @@ public function test_children_of_keyed_cases_are_a_list(): void
{
static::assertTrue(
array_is_list(
- (new MatchCases([
+ new MatchCases([
'a' => match_condition(lit(true), lit(1)),
'b' => match_condition(lit(false), lit(2)),
- ]))->children(),
+ ])->children(),
),
);
}
@@ -53,7 +53,7 @@ public function test_no_matching_case_without_a_default_still_throws(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Not a single case matches row, consider using default parameter');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
match_cases([
match_condition(ref('string')->contains('_'), ref('string')->strReplace('_', ' ')),
]),
@@ -69,14 +69,14 @@ public function test_case_match(): void
match_condition(ref('string')->contains('-'), ref('string')->strReplace('-', ' ')),
]);
- static::assertSame('this is slug', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('this is slug', new FunctionContext(flow_context())->eval(
$match,
[
'string' => 'this-is-slug',
],
schema(str_schema('string')),
));
- static::assertSame('this is slug', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('this is slug', new FunctionContext(flow_context())->eval(
$match,
[
'string' => 'this_is_slug',
@@ -92,7 +92,7 @@ public function test_not_matching_anything_in_strict_mode(): void
'Not a single case matches row, consider using default parameter, row: {"string":"weirdstring"}',
);
- (new FunctionContext(flow_context(config())))->eval(
+ new FunctionContext(flow_context(config()))->eval(
match_cases([
match_condition(ref('string')->contains('_'), ref('string')->strReplace('_', ' ')),
match_condition(ref('string')->contains('-'), ref('string')->strReplace('-', ' ')),
@@ -104,7 +104,7 @@ public function test_not_matching_anything_in_strict_mode(): void
public function test_not_matching_anything_with_default(): void
{
- static::assertEquals('normal string', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('normal string', new FunctionContext(flow_context())->eval(
match_cases([
match_condition(ref('string')->contains('_'), ref('string')->strReplace('_', ' ')),
match_condition(ref('string')->contains('-'), ref('string')->strReplace('-', ' ')),
@@ -134,7 +134,7 @@ public function test_a_condition_that_gives_an_array_is_refused(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "boolean", got "array".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
match_cases([match_condition(ref('list'), lit(1))], default: lit(0)),
['list' => [1]],
schema(list_schema('list', type_list(type_integer()))),
@@ -150,10 +150,10 @@ public function test_a_later_case_runs_only_on_the_rows_no_earlier_case_took():
static::assertSame(
[0, 2],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(match_cases([
match_condition(ref('c'), lit(0)),
- match_condition((new FailingOnValuesFunction(ref('v'), [99]))->isNotNull(), ref('v')),
+ match_condition(new FailingOnValuesFunction(ref('v'), [99])->isNotNull(), ref('v')),
]), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MathTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MathTest.php
index 84540f8a38..2658f8856f 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MathTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MathTest.php
@@ -26,7 +26,7 @@ final class MathTest extends FlowTestCase
{
public function test_divide(): void
{
- static::assertSame(10.0, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(10.0, new FunctionContext(flow_context())->eval(
new Divide(ref('a'), ref('b')),
['a' => 100, 'b' => 10],
schema(int_schema('a'), int_schema('b')),
@@ -38,7 +38,7 @@ public function test_divide_with_null_right_value(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Divide function requires non-null values');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('a')->divide(ref('b')),
['a' => 100, 'b' => null],
schema(int_schema('a'), int_schema('b', nullable: true)),
@@ -50,7 +50,7 @@ public function test_divide_by_zero(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Divide function cannot divide by zero');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('a')->divide(ref('b')),
['a' => 100, 'b' => 0],
schema(int_schema('a'), int_schema('b')),
@@ -59,7 +59,7 @@ public function test_divide_by_zero(): void
public function test_minus(): void
{
- static::assertSame(0, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(0, new FunctionContext(flow_context())->eval(
new Minus(ref('a'), ref('b'), false),
['a' => 100, 'b' => 100],
schema(int_schema('a'), int_schema('b')),
@@ -68,7 +68,7 @@ public function test_minus(): void
public function test_modulo(): void
{
- static::assertSame(10, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(10, new FunctionContext(flow_context())->eval(
new Mod(ref('a'), ref('b')),
['a' => 110, 'b' => 100],
schema(int_schema('a'), int_schema('b')),
@@ -77,7 +77,7 @@ public function test_modulo(): void
public function test_multiple_operations(): void
{
- static::assertSame(200, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(200, new FunctionContext(flow_context())->eval(
ref('a')->plus(lit(100))->plus(lit(100))->minus(ref('b')),
['a' => 100, 'b' => 100],
schema(int_schema('a'), int_schema('b')),
@@ -86,7 +86,7 @@ public function test_multiple_operations(): void
public function test_multiply(): void
{
- static::assertSame(10_000, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(10_000, new FunctionContext(flow_context())->eval(
new Multiply(ref('a'), ref('b'), false),
['a' => 100, 'b' => 100],
schema(int_schema('a'), int_schema('b')),
@@ -95,7 +95,7 @@ public function test_multiply(): void
public function test_plus(): void
{
- static::assertSame(200, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(200, new FunctionContext(flow_context())->eval(
new Plus(ref('a'), ref('b'), false),
['a' => 100, 'b' => 100],
schema(int_schema('a'), int_schema('b')),
@@ -104,7 +104,7 @@ public function test_plus(): void
public function test_power(): void
{
- static::assertSame(1, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(1, new FunctionContext(flow_context())->eval(
new Power(ref('a'), ref('b')),
['a' => 1, 'b' => 2],
schema(int_schema('a'), int_schema('b')),
@@ -113,7 +113,7 @@ public function test_power(): void
public function test_round(): void
{
- static::assertSame(1.01, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(1.01, new FunctionContext(flow_context())->eval(
new Round(ref('a'), ref('b')),
['a' => 1.009, 'b' => 2],
schema(float_schema('a'), int_schema('b')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MaxTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MaxTest.php
index 2703493e65..fe388d6de1 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MaxTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MaxTest.php
@@ -220,7 +220,7 @@ public function test_max_over_an_int_column_declares_optional_integer(): void
{
static::assertSame(
'?integer',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(max(ref('int')), schema(int_schema('int')))
->returns()
->toString(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MinTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MinTest.php
index d1934bba29..a1668894ac 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MinTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MinTest.php
@@ -227,7 +227,7 @@ public function test_min_over_an_int_column_declares_optional_integer(): void
{
static::assertSame(
'?integer',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(min(ref('int')), schema(int_schema('int')))
->returns()
->toString(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MinusTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MinusTest.php
index 7e528e438b..f82bb883b9 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MinusTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MinusTest.php
@@ -26,7 +26,7 @@ final class MinusTest extends FlowTestCase
{
public function test_exact_keeps_decimal_arithmetic(): void
{
- static::assertSame(0.2, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(0.2, new FunctionContext(flow_context())->eval(
ref('a')->minus(ref('b'), exact: true),
['a' => 0.3, 'b' => 0.1],
schema(float_schema('a'), float_schema('b')),
@@ -35,7 +35,7 @@ public function test_exact_keeps_decimal_arithmetic(): void
public function test_floats_use_ieee_arithmetic(): void
{
- static::assertSame(0.19999999999999998, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(0.19999999999999998, new FunctionContext(flow_context())->eval(
ref('a')->minus(ref('b')),
['a' => 0.3, 'b' => 0.1],
schema(float_schema('a'), float_schema('b')),
@@ -44,7 +44,7 @@ public function test_floats_use_ieee_arithmetic(): void
public function test_integers_stay_integers(): void
{
- static::assertSame(2, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(2, new FunctionContext(flow_context())->eval(
ref('a')->minus(ref('b')),
['a' => 5, 'b' => 3],
schema(int_schema('a'), int_schema('b')),
@@ -56,7 +56,7 @@ public function test_integer_overflow_names_its_row(): void
$this->expectException(EvaluationException::class);
$this->expectExceptionMessage('Minus function integer overflow (row 0)');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('a')->minus(ref('b')),
['a' => PHP_INT_MIN, 'b' => 1],
schema(int_schema('a'), int_schema('b')),
@@ -87,7 +87,7 @@ public static function refusalsPerBackend(): Generator
public function test_a_refusal_message(Backend $backend, array $row, string $message): void
{
try {
- (new FunctionContext(flow_context(config_builder()->backend($backend)->build())))->eval(
+ new FunctionContext(flow_context(config_builder()->backend($backend)->build()))->eval(
ref('a')->minus(ref('b')),
$row,
schema(int_schema('a', nullable: true), int_schema('b', nullable: true)),
@@ -103,7 +103,7 @@ public function test_exact_refuses_a_null_right_operand(): void
$this->expectException(EvaluationException::class);
$this->expectExceptionMessage('Minus function requires non-null values (row 0)');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('a')->minus(ref('b'), exact: true),
['a' => 5, 'b' => null],
schema(int_schema('a'), int_schema('b', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ModTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ModTest.php
index 67d3aff329..5b0c569e64 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ModTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ModTest.php
@@ -45,7 +45,7 @@ public static function refusalsPerBackend(): Generator
public function test_a_refusal_message(Backend $backend, array $row, string $message): void
{
try {
- (new FunctionContext(flow_context(config_builder()->backend($backend)->build())))->eval(
+ new FunctionContext(flow_context(config_builder()->backend($backend)->build()))->eval(
ref('a')->mod(ref('b')),
$row,
schema(int_schema('a', nullable: true), int_schema('b', nullable: true)),
@@ -60,7 +60,7 @@ public function test_a_negative_remainder_folds_back_under_a_positive_modulus():
{
static::assertSame(
[2, 1, 0],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
ref('a')->mod(ref('b')),
[['a' => -7, 'b' => 3], ['a' => 7, 'b' => 3], ['a' => PHP_INT_MIN, 'b' => 2]],
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ModifyDateTimeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ModifyDateTimeTest.php
index 47ea7091a0..1b0fc41b63 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ModifyDateTimeTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ModifyDateTimeTest.php
@@ -26,7 +26,7 @@ public function test_modify_date(): void
{
static::assertEquals(
new DateTimeImmutable('2025-01-01 12:00:00 +00:00'),
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('datetime')->modifyDateTime('noon'),
[
'datetime' => type_date()->cast('2025-01-01'),
@@ -40,7 +40,7 @@ public function test_modify_datetime(): void
{
static::assertEquals(
new DateTimeImmutable('2025-01-01 00:00:00 +00:00'),
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('datetime')->modifyDateTime('midnight'),
[
'datetime' => type_datetime()->cast('2025-01-01 10:00:23 +00:00'),
@@ -55,7 +55,7 @@ public function test_modify_using_invalid_modifier(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "string", got "integer".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('datetime')->modifyDateTime(lit(1)),
[
'datetime' => type_datetime()->cast('2025-01-01 10:00:23 +00:00'),
@@ -69,7 +69,7 @@ public function test_a_null_modifier_is_refused(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ModifyDateTime function requires non-null values');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('datetime')->modifyDateTime(ref('modifier')),
[
'datetime' => type_datetime()->cast('2025-01-01 10:00:23 +00:00'),
@@ -83,7 +83,7 @@ public function test_zone_of_the_reference_is_kept(): void
{
static::assertSame(
'datetime',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(ref('at')->modifyDateTime('+1 day'), schema(datetime_schema('at', zone: 'Europe/Warsaw')))
->returns()
->toString(),
@@ -94,7 +94,7 @@ public function test_zone_of_a_nullable_reference_is_kept(): void
{
static::assertSame(
'datetime',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('at')->modifyDateTime('+1 day'),
schema(datetime_schema('at', nullable: true, zone: 'Europe/Warsaw')),
@@ -108,7 +108,7 @@ public function test_non_datetime_reference_returns_utc_datetime(): void
{
static::assertSame(
'datetime',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(ref('at')->modifyDateTime('+1 day'), schema(str_schema('at')))
->returns()
->toString(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MultiplyTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MultiplyTest.php
index 09e9c53dd7..e5b8c23c14 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MultiplyTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MultiplyTest.php
@@ -25,7 +25,7 @@ final class MultiplyTest extends FlowTestCase
{
public function test_exact_keeps_decimal_arithmetic(): void
{
- static::assertSame(0.3, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(0.3, new FunctionContext(flow_context())->eval(
ref('a')->multiply(ref('b'), exact: true),
['a' => 0.1, 'b' => 3],
schema(float_schema('a'), int_schema('b')),
@@ -34,7 +34,7 @@ public function test_exact_keeps_decimal_arithmetic(): void
public function test_floats_use_ieee_arithmetic(): void
{
- static::assertSame(0.30000000000000004, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(0.30000000000000004, new FunctionContext(flow_context())->eval(
ref('a')->multiply(ref('b')),
['a' => 0.1, 'b' => 3],
schema(float_schema('a'), int_schema('b')),
@@ -43,7 +43,7 @@ public function test_floats_use_ieee_arithmetic(): void
public function test_integers_stay_integers(): void
{
- static::assertSame(15, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(15, new FunctionContext(flow_context())->eval(
ref('a')->multiply(ref('b')),
['a' => 5, 'b' => 3],
schema(int_schema('a'), int_schema('b')),
@@ -55,7 +55,7 @@ public function test_integer_overflow_names_its_row(): void
$this->expectException(EvaluationException::class);
$this->expectExceptionMessage('Multiply function integer overflow (row 0)');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('a')->multiply(ref('b')),
['a' => PHP_INT_MAX, 'b' => 2],
schema(int_schema('a'), int_schema('b')),
@@ -86,7 +86,7 @@ public static function refusalsPerBackend(): Generator
public function test_a_refusal_message(Backend $backend, array $row, string $message): void
{
try {
- (new FunctionContext(flow_context(config_builder()->backend($backend)->build())))->eval(
+ new FunctionContext(flow_context(config_builder()->backend($backend)->build()))->eval(
ref('a')->multiply(ref('b')),
$row,
schema(int_schema('a', nullable: true), int_schema('b', nullable: true)),
@@ -102,7 +102,7 @@ public function test_exact_refuses_a_null_right_operand(): void
$this->expectException(EvaluationException::class);
$this->expectExceptionMessage('Multiply function requires non-null values (row 0)');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('a')->multiply(ref('b'), exact: true),
['a' => 5, 'b' => null],
schema(int_schema('a'), int_schema('b', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MultisetHashesByGroupTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MultisetHashesByGroupTest.php
index 1af1f4b00a..f9c09bb62d 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MultisetHashesByGroupTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MultisetHashesByGroupTest.php
@@ -88,7 +88,7 @@ public function test_it_absorbs_only_grouped_multiset_hashes(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Grouped multiset hashes absorb only other grouped multiset hashes');
- (new MultisetHashesByGroup([], $backend->groupedMultisetHashes(HashAlgorithm::xxh128)))->absorbEarlier(
+ new MultisetHashesByGroup([], $backend->groupedMultisetHashes(HashAlgorithm::xxh128))->absorbEarlier(
new CountsByGroup(null, $backend->groupedCounts()),
[0 => 0],
$backend,
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NotTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NotTest.php
index 841b791bca..a4cfe7c2cc 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NotTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NotTest.php
@@ -54,17 +54,17 @@ public function test_not_over_a_null_predicate_drops_the_row(): void
public function test_not_expression_on_array_true_value(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(not(lit([1, 2, 3])), [], schema()));
+ static::assertFalse(new FunctionContext(flow_context())->eval(not(lit([1, 2, 3])), [], schema()));
}
public function test_not_expression_on_boolean_true_value(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(not(lit(true)), [], schema()));
+ static::assertFalse(new FunctionContext(flow_context())->eval(not(lit(true)), [], schema()));
}
public function test_not_expression_on_is_in_expression(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
not(ref('value')->isIn(ref('array'))),
['array' => [1, 2, 3], 'value' => 10],
schema(list_schema('array', type_list(type_integer())), int_schema('value')),
@@ -73,22 +73,22 @@ public function test_not_expression_on_is_in_expression(): void
public function test_not_expression_with_and_operator(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
not(ref('value')->isNull()->or(ref('value')->isType(type_integer()))),
['value' => '10'],
schema(str_schema('value')),
));
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
not(ref('value')->isNull()->or(ref('value')->isType(type_integer()))),
['value' => null],
schema(str_schema('value', nullable: true)),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
not(ref('value')->isNull()->and(ref('value')->size()->between(1, 10))),
['value' => 'abcd'],
schema(str_schema('value')),
));
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
not(ref('value')->isNull()->or(ref('value')->size()->equals(1))),
['value' => 'abcd'],
schema(str_schema('value')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NowTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NowTest.php
index 1181800110..2d72160ff0 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NowTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NowTest.php
@@ -38,7 +38,7 @@ public function test_value_is_in_the_zone(): void
static::assertSame(
'Europe/Warsaw',
type_datetime()
- ->assert((new FunctionContext(flow_context()))->eval(
+ ->assert(new FunctionContext(flow_context())->eval(
now(new DateTimeZone('Europe/Warsaw')),
[],
schema(),
@@ -53,7 +53,7 @@ public function test_function_zone_value_is_in_the_declared_zone(): void
static::assertSame(
'UTC',
type_datetime()
- ->assert((new FunctionContext(flow_context()))->eval(
+ ->assert(new FunctionContext(flow_context())->eval(
now(ref('tz')),
[
'tz' => new DateTimeZone('Europe/Warsaw'),
@@ -70,7 +70,7 @@ public function test_function_zone_null_is_refused(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Now function requires valid DateTimeZone');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
now(ref('tz')),
['tz' => null],
schema(str_schema('tz', nullable: true)),
@@ -82,7 +82,7 @@ public function test_utc_alias_zone_lands_in_utc(): void
static::assertSame(
'UTC',
type_datetime()
- ->assert((new FunctionContext(flow_context()))->eval(now(new DateTimeZone('GMT')), [], schema()))
+ ->assert(new FunctionContext(flow_context())->eval(now(new DateTimeZone('GMT')), [], schema()))
->getTimezone()
->getName(),
);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NumberFormatTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NumberFormatTest.php
index 30981ea4fc..292a8a7e31 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NumberFormatTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NumberFormatTest.php
@@ -23,7 +23,7 @@ final class NumberFormatTest extends FlowTestCase
{
public function test_number_format(): void
{
- static::assertSame('1,234.57', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('1,234.57', new FunctionContext(flow_context())->eval(
new NumberFormat(ref('value'), ref('decimals'), ref('decimal_separator'), ref('thousands_separator')),
[
'value' => 1234.5678,
@@ -42,7 +42,7 @@ public function test_number_format(): void
public function test_number_format_dsl(): void
{
- static::assertSame('1,234.57', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('1,234.57', new FunctionContext(flow_context())->eval(
number_format(ref('value'), lit(2), lit('.'), lit(',')),
[
'value' => 1234.5678,
@@ -56,7 +56,7 @@ public function test_number_format_on_decimals_that_are_not_integer(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "integer", got "float".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
new NumberFormat(ref('value'), ref('decimals'), ref('decimal_separator'), ref('thousands_separator')),
[
'value' => 1234.5678,
@@ -86,7 +86,7 @@ public function test_number_format_on_null_parameter(
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('NumberFormat function requires non-null values');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
new NumberFormat(ref('value'), ref('decimals'), ref('decimal_separator'), ref('thousands_separator')),
[
'value' => $value,
@@ -108,7 +108,7 @@ public function test_number_format_on_non_int_entry(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "numeric", got "string".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
new NumberFormat(ref('value'), ref('decimals'), ref('decimal_separator'), ref('thousands_separator')),
[
'value' => 'test',
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NumericTotalTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NumericTotalTest.php
index 44e19ed75b..c52aac168d 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NumericTotalTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NumericTotalTest.php
@@ -80,7 +80,7 @@ public function test_a_single_row_is_added_without_taking_the_column(): void
public function test_nothing_added_has_no_sum(): void
{
- static::assertNull((new NumericTotal())->sum());
+ static::assertNull(new NumericTotal()->sum());
}
public function test_a_partial_merged_into_a_fresh_total_restores_it(): void
@@ -89,7 +89,7 @@ public function test_a_partial_merged_into_a_fresh_total_restores_it(): void
$total->aggregate(array_to_rows([['v' => 4], ['v' => 5]], schema(int_schema('v')))->column('v'), [0, 1]);
$restored = new NumericTotal();
$restored->merge($total->partial());
- $restored->merge((new NumericTotal())->partial());
+ $restored->merge(new NumericTotal()->partial());
static::assertSame(9, $restored->sum());
static::assertSame(2, $restored->count());
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/OnEachElementSchemaTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/OnEachElementSchemaTest.php
index d5576b1f1e..2085d1a8bd 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/OnEachElementSchemaTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/OnEachElementSchemaTest.php
@@ -26,7 +26,7 @@ public function test_a_list_declares_its_element_type(): void
{
static::assertEquals(
schema(definition_from_type('element', type_integer())),
- (new OnEachElementSchema())->of(type_list(type_integer())),
+ new OnEachElementSchema()->of(type_list(type_integer())),
);
}
@@ -34,7 +34,7 @@ public function test_a_map_declares_its_value_type(): void
{
static::assertEquals(
schema(definition_from_type('element', type_integer())),
- (new OnEachElementSchema())->of(type_map(type_string(), type_integer())),
+ new OnEachElementSchema()->of(type_map(type_string(), type_integer())),
);
}
@@ -42,7 +42,7 @@ public function test_a_structure_declares_the_type_its_fields_unify_to(): void
{
static::assertSame(
'integer',
- (new OnEachElementSchema())
+ new OnEachElementSchema()
->of(type_structure(['a' => type_integer(), 'b' => type_integer()]))
->get('element')
->type()
@@ -54,7 +54,7 @@ public function test_an_optional_structure_field_still_unifies(): void
{
static::assertSame(
'string',
- (new OnEachElementSchema())
+ new OnEachElementSchema()
->of(type_structure([
'a' => type_string(),
'b' => structure_element('b', type_string(), optional: true),
@@ -69,7 +69,7 @@ public function test_a_structure_whose_fields_do_not_unify_is_refused(): void
{
$this->expectException(SchemaNotDerivableException::class);
- (new OnEachElementSchema())->of(type_structure([
+ new OnEachElementSchema()->of(type_structure([
'a' => type_boolean(),
'b' => type_list(type_integer()),
]));
@@ -80,7 +80,7 @@ public function test_an_operand_with_no_element_type_is_refused(): void
$this->expectException(SchemaNotDerivableException::class);
$this->expectExceptionMessage('the array operand declares "array", which has no element type');
- (new OnEachElementSchema())->of(type_array());
+ new OnEachElementSchema()->of(type_array());
}
public function test_a_scalar_operand_is_refused(): void
@@ -88,6 +88,6 @@ public function test_a_scalar_operand_is_refused(): void
$this->expectException(SchemaNotDerivableException::class);
$this->expectExceptionMessage('the array operand declares "float", which has no element type');
- (new OnEachElementSchema())->of(type_float());
+ new OnEachElementSchema()->of(type_float());
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/OnEachTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/OnEachTest.php
index aa59159a8b..f3f41618e4 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/OnEachTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/OnEachTest.php
@@ -53,8 +53,8 @@ public function test_a_throwing_body_is_not_swallowed(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "string", got "integer"');
- (new FunctionContext(flow_context()))->eval(
- (new ReferenceResolver())->resolve(
+ new FunctionContext(flow_context())->eval(
+ new ReferenceResolver()->resolve(
ref('array')->onEach(ref('element')->upper()),
schema(list_schema('array', type_list(type_integer()))),
),
@@ -71,8 +71,8 @@ public function test_an_element_the_declared_type_refuses_is_not_swallowed(): vo
{
$this->expectException(SchemaMismatchException::class);
- (new FunctionContext(flow_context()))->eval(
- (new ReferenceResolver())->resolve(
+ new FunctionContext(flow_context())->eval(
+ new ReferenceResolver()->resolve(
ref('array')->onEach(ref('element')->upper()),
schema(list_schema('array', type_list(type_string()))),
),
@@ -88,8 +88,8 @@ public function test_executing_function_on_each_value_from_array(): void
{
static::assertSame(
['1', '2', '3', '4', '5'],
- (new FunctionContext(flow_context()))->eval(
- (new ReferenceResolver())->resolve(
+ new FunctionContext(flow_context())->eval(
+ new ReferenceResolver()->resolve(
ref('array')->onEach(ref('element')->cast(type_string())),
schema(list_schema('array', type_list(type_integer()))),
),
@@ -109,8 +109,8 @@ public function test_executing_function_on_each_value_from_empty_array(): void
{
static::assertSame(
[],
- (new FunctionContext(flow_context()))->eval(
- (new ReferenceResolver())->resolve(
+ new FunctionContext(flow_context())->eval(
+ new ReferenceResolver()->resolve(
ref('array')->onEach(ref('element')->cast(type_string())),
schema(list_schema('array', type_list(type_integer()))),
),
@@ -124,8 +124,8 @@ public function test_executing_function_on_each_value_with_preserving_keys(): vo
{
static::assertSame(
['a' => '1', 'b' => '2', 'c' => '3', 'd' => '4', 'e' => '5'],
- (new FunctionContext(flow_context()))->eval(
- (new ReferenceResolver())->resolve(
+ new FunctionContext(flow_context())->eval(
+ new ReferenceResolver()->resolve(
ref('array')->onEach(ref('element')->cast(type_string()), true),
schema(map_schema('array', type_map(type_string(), type_integer()))),
),
@@ -145,8 +145,8 @@ public function test_on_each_preserves_keys_by_default(): void
{
static::assertSame(
['a' => '1', 'b' => '2'],
- (new FunctionContext(flow_context()))->eval(
- (new ReferenceResolver())->resolve(
+ new FunctionContext(flow_context())->eval(
+ new ReferenceResolver()->resolve(
new OnEach(ref('array'), ref('element')->cast(type_string())),
schema(map_schema('array', type_map(type_string(), type_integer()))),
),
@@ -160,8 +160,8 @@ public function test_executing_function_on_each_value_without_preserving_keys():
{
static::assertSame(
['1', '2', '3', '4', '5'],
- (new FunctionContext(flow_context()))->eval(
- (new ReferenceResolver())->resolve(
+ new FunctionContext(flow_context())->eval(
+ new ReferenceResolver()->resolve(
ref('array')->onEach(ref('element')->cast(type_string()), false),
schema(map_schema('array', type_map(type_string(), type_integer()))),
),
@@ -184,8 +184,8 @@ public function test_on_each_over_an_untyped_array_operand_is_refused(): void
$this->expectException(SchemaNotDerivableException::class);
$this->expectExceptionMessage('the array operand declares "json", which has no element type');
- (new FunctionContext(flow_context()))->eval(
- (new ReferenceResolver())->resolve(
+ new FunctionContext(flow_context())->eval(
+ new ReferenceResolver()->resolve(
ref('array')->onEach(ref('element')->cast(type_string())),
schema(definition_from_type('array', type_array())),
),
@@ -201,7 +201,7 @@ public function test_the_element_schema_is_built_once_per_eval_not_once_per_elem
{
$operand = new CountingReturnsFunction(lit([1, 2, 3, 4, 5]), type_list(type_integer()));
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
new OnEach($operand, ref('element')->cast(type_string())),
[],
schema(),
@@ -214,7 +214,7 @@ public function test_a_structure_operand_keeps_its_fields_typed_by_the_body(): v
{
static::assertSame(
'structure{a: string, b: string}',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('structure')->onEach(ref('element')->cast(type_string())),
schema(structure_schema('structure', type_structure(['a' => type_integer(), 'b' => type_float()]))),
@@ -228,7 +228,7 @@ public function test_an_interleaved_structure_operand_keeps_every_position_and_f
{
static::assertSame(
'structure{z: string, a?: string, b: string}',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('structure')->onEach(ref('element')->cast(type_string())),
schema(structure_schema('structure', type_structure([
@@ -246,7 +246,7 @@ public function test_a_structure_operand_without_keys_declares_a_list_of_the_bod
{
static::assertSame(
'list',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('structure')->onEach(ref('element')->cast(type_string()), preserveKeys: false),
schema(structure_schema('structure', type_structure(['a' => type_integer()]))),
@@ -260,7 +260,7 @@ public function test_a_map_operand_with_preserved_keys_declares_a_map_of_the_bod
{
static::assertSame(
'map',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('map')->onEach(ref('element')->cast(type_string())),
schema(map_schema('map', type_map(type_string(), type_integer()))),
@@ -274,7 +274,7 @@ public function test_a_structure_with_non_unifying_fields_refuses_to_declare():
{
$this->expectException(SchemaNotDerivableException::class);
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
ref('structure')->onEach(ref('element')->cast(type_string())),
schema(structure_schema('structure', type_structure([
@@ -310,7 +310,7 @@ public function test_a_null_array_is_refused(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('OnEach requires non-null array');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('tags')->onEach(ref('element')),
['tags' => null],
schema(str_schema('tags', nullable: true)),
@@ -323,7 +323,7 @@ public function test_with_children_keeps_the_element_schema(): void
// two stateless instances are equal, but serialize() names an instance it already wrote only by back-reference
static::assertSame(1, substr_count(serialize([
$elementSchema,
- (new OnEach(ref('a'), ref('element'), true, $elementSchema))->withChildren([ref('b')]),
+ new OnEach(ref('a'), ref('element'), true, $elementSchema)->withChildren([ref('b')]),
]), 'OnEachElementSchema'));
}
@@ -345,7 +345,7 @@ public function test_the_element_batch_is_built_by_the_configured_backend(): voi
static::assertSame(
[['1', '2']],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(new OnEach(ref('l'), ref('element')->cast(type_string())), $rows->schema())
->eval($rows, $backend)
->values(),
@@ -364,7 +364,7 @@ public function test_the_function_evaluates_once_per_batch(): void
static::assertSame(
[[1, 2], [3], []],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(new OnEach(ref('l'), $spy), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/OptionalTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/OptionalTest.php
index 59d313a227..e030d2ce17 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/OptionalTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/OptionalTest.php
@@ -32,7 +32,7 @@ public function test_optional_declares_the_inner_type_widened_to_optional(): voi
public function test_optional_returns_null_when_the_inner_function_throws(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
optional(ref('name')->upper()),
['other' => 'flow'],
schema(str_schema('other')),
@@ -66,7 +66,7 @@ public function test_only_the_failing_rows_are_null(array $failing, string $fail
schema(int_schema('v')),
);
- $values = (new ReferenceResolver())
+ $values = new ReferenceResolver()
->resolve(optional($spy), $rows->schema())
->eval($rows, flow_context()->backend())
->values();
@@ -84,7 +84,7 @@ public function test_an_error_propagates(): void
$this->expectException(Error::class);
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
optional(new FailingOnValuesFunction(ref('v'), [1], FailingOnValuesFunction::ERROR)),
$rows->schema(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ParameterTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ParameterTest.php
index 21cc00e42c..aff7894757 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ParameterTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ParameterTest.php
@@ -94,7 +94,7 @@ public function test_as_array_with_empty_array(): void
{
static::assertSame(
[[]],
- (new Parameter(lit([])))->asArrays(RowsMother::sequentialIds(1), flow_context()->backend()),
+ new Parameter(lit([]))->asArrays(RowsMother::sequentialIds(1), flow_context()->backend()),
);
}
@@ -102,7 +102,7 @@ public function test_as_array_with_valid_array(): void
{
static::assertSame(
[['key' => 'value', 'number' => 42]],
- (new Parameter(lit(['key' => 'value', 'number' => 42])))->asArrays(
+ new Parameter(lit(['key' => 'value', 'number' => 42]))->asArrays(
RowsMother::sequentialIds(1),
flow_context()->backend(),
),
@@ -113,13 +113,13 @@ public function test_as_arrays_reads_a_json_column_as_arrays(): void
{
static::assertSame(
[['a' => 1], null],
- (new Parameter((new ReferenceResolver())->resolve(
+ new Parameter(new ReferenceResolver()->resolve(
ref('j'),
array_to_rows([
['j' => '{"a":1}'],
['j' => null],
], schema(json_schema('j', nullable: true)))->schema(),
- )))->asArrays(array_to_rows([
+ ))->asArrays(array_to_rows([
['j' => '{"a":1}'],
['j' => null],
], schema(json_schema('j', nullable: true))), flow_context()->backend()),
@@ -129,11 +129,11 @@ public function test_as_arrays_reads_a_json_column_as_arrays(): void
public function test_as_integer_column_reads_an_integer_column_as_is_and_nulls_as_integer_nulls(): void
{
$rows = array_to_rows([['i' => 1], ['i' => 2]], schema(int_schema('i')));
- $integers = (new Parameter((new ReferenceResolver())->resolve(ref('i'), $rows->schema())))->asIntegerColumn(
+ $integers = new Parameter(new ReferenceResolver()->resolve(ref('i'), $rows->schema()))->asIntegerColumn(
$rows,
flow_context()->backend(),
);
- $nulls = (new Parameter(lit(null)))->asIntegerColumn(RowsMother::sequentialIds(2), flow_context()->backend());
+ $nulls = new Parameter(lit(null))->asIntegerColumn(RowsMother::sequentialIds(2), flow_context()->backend());
static::assertSame([[1, 2], 'integer'], [$integers->values(), $integers->type()->toString()]);
static::assertSame([[null, null], 'integer'], [$nulls->values(), $nulls->type()->toString()]);
@@ -145,7 +145,7 @@ public function test_as_integer_column_throws_on_a_non_integer_value(): void
$this->expectException(EvaluationException::class);
- (new Parameter((new ReferenceResolver())->resolve(ref('s'), $rows->schema())))->asIntegerColumn(
+ new Parameter(new ReferenceResolver()->resolve(ref('s'), $rows->schema()))->asIntegerColumn(
$rows,
flow_context()->backend(),
);
@@ -157,7 +157,7 @@ public function test_as_string_column_returns_a_string_column_as_it_is(): void
static::assertSame(
$rows->column('s'),
- (new Parameter((new ReferenceResolver())->resolve(ref('s'), $rows->schema())))->asStringColumn(
+ new Parameter(new ReferenceResolver()->resolve(ref('s'), $rows->schema()))->asStringColumn(
$rows,
flow_context()->backend(),
),
@@ -170,10 +170,10 @@ public function test_as_string_column_builds_a_string_column_from_untyped_string
['m' => ['k' => 'a']],
['m' => ['k' => 'b']],
], schema(map_schema('m', type_map(type_string(), type_string()))));
- $strings = (new Parameter((new ReferenceResolver())->resolve(
+ $strings = new Parameter(new ReferenceResolver()->resolve(
ref('m')->arrayGet('k'),
$rows->schema(),
- )))->asStringColumn($rows, flow_context()->backend());
+ ))->asStringColumn($rows, flow_context()->backend());
static::assertSame([['a', 'b'], 'string'], [$strings->values(), $strings->type()->toString()]);
}
@@ -183,7 +183,7 @@ public function test_as_string_column_refuses_an_integer_with_its_row(): void
$rows = array_to_rows([['i' => null], ['i' => 12]], schema(int_schema('i', nullable: true)));
try {
- (new Parameter((new ReferenceResolver())->resolve(ref('i'), $rows->schema())))->asStringColumn(
+ new Parameter(new ReferenceResolver()->resolve(ref('i'), $rows->schema()))->asStringColumn(
$rows,
flow_context()->backend(),
);
@@ -200,10 +200,10 @@ public function test_as_number_column_takes_an_integer_or_a_float_column(): void
$resolver = new ReferenceResolver();
static::assertSame([[1], [1.5]], [
- (new Parameter($resolver->resolve(ref('i'), $rows->schema())))
+ new Parameter($resolver->resolve(ref('i'), $rows->schema()))
->asNumberColumn($rows, flow_context()->backend())
->values(),
- (new Parameter($resolver->resolve(ref('f'), $rows->schema())))
+ new Parameter($resolver->resolve(ref('f'), $rows->schema()))
->asNumberColumn($rows, flow_context()->backend())
->values(),
]);
@@ -215,7 +215,7 @@ public function test_as_number_column_refuses_another_column_type(): void
$this->expectExceptionObject(new InvalidArgumentException('Expected an integer or float column, got "string"'));
- (new Parameter((new ReferenceResolver())->resolve(ref('s'), $rows->schema())))->asNumberColumn(
+ new Parameter(new ReferenceResolver()->resolve(ref('s'), $rows->schema()))->asNumberColumn(
$rows,
flow_context()->backend(),
);
@@ -225,14 +225,14 @@ public function test_as_array_throws_on_a_malformed_value(): void
{
$this->expectException(InvalidArgumentException::class);
- (new Parameter(lit('not an array')))->asArrays(RowsMother::sequentialIds(1), flow_context()->backend());
+ new Parameter(lit('not an array'))->asArrays(RowsMother::sequentialIds(1), flow_context()->backend());
}
public function test_as_array_propagates_null(): void
{
static::assertSame(
[null],
- (new Parameter(lit(null)))->asArrays(RowsMother::sequentialIds(1), flow_context()->backend()),
+ new Parameter(lit(null))->asArrays(RowsMother::sequentialIds(1), flow_context()->backend()),
);
}
@@ -244,7 +244,7 @@ public function test_as_boolean(mixed $input, ?bool $expected): void
{
static::assertSame(
[$expected],
- (new Parameter(lit($input)))->asBooleans(RowsMother::sequentialIds(1), flow_context()->backend()),
+ new Parameter(lit($input))->asBooleans(RowsMother::sequentialIds(1), flow_context()->backend()),
);
}
@@ -252,14 +252,14 @@ public function test_as_booleans_reads_a_boolean_column_as_is(): void
{
static::assertSame(
[true, null, false],
- (new Parameter((new ReferenceResolver())->resolve(
+ new Parameter(new ReferenceResolver()->resolve(
ref('b'),
array_to_rows([
['b' => true],
['b' => null],
['b' => false],
], schema(bool_schema('b', nullable: true)))->schema(),
- )))->asBooleans(array_to_rows([
+ ))->asBooleans(array_to_rows([
['b' => true],
['b' => null],
['b' => false],
@@ -273,7 +273,7 @@ public function test_as_booleans_reads_every_row_of_an_integer_column(): void
static::assertSame(
[null, true, false],
- (new Parameter((new ReferenceResolver())->resolve(ref('i'), $rows->schema())))->asBooleans(
+ new Parameter(new ReferenceResolver()->resolve(ref('i'), $rows->schema()))->asBooleans(
$rows,
flow_context()->backend(),
),
@@ -289,7 +289,7 @@ public function test_as_arrays_reads_every_row_after_a_null(): void
static::assertSame(
[null, ['k' => 'a']],
- (new Parameter((new ReferenceResolver())->resolve(ref('m'), $rows->schema())))->asArrays(
+ new Parameter(new ReferenceResolver()->resolve(ref('m'), $rows->schema()))->asArrays(
$rows,
flow_context()->backend(),
),
@@ -302,7 +302,7 @@ public function test_as_numbers_reads_every_row_of_a_string_column(): void
static::assertSame(
[7, 2, 3],
- (new Parameter((new ReferenceResolver())->resolve(ref('s'), $rows->schema())))->asNumbers(
+ new Parameter(new ReferenceResolver()->resolve(ref('s'), $rows->schema()))->asNumbers(
$rows,
flow_context()->backend(),
7,
@@ -314,14 +314,14 @@ public function test_as_boolean_throws_on_a_malformed_value(): void
{
$this->expectException(InvalidArgumentException::class);
- (new Parameter(lit(['value'])))->asBooleans(RowsMother::sequentialIds(1), flow_context()->backend());
+ new Parameter(lit(['value']))->asBooleans(RowsMother::sequentialIds(1), flow_context()->backend());
}
public function test_as_enum_propagates_null(): void
{
static::assertSame(
[null],
- (new Parameter(lit(null)))->asEnums(
+ new Parameter(lit(null))->asEnums(
RowsMother::sequentialIds(1),
flow_context()->backend(),
SQLParametersStyle::class,
@@ -333,7 +333,7 @@ public function test_as_enum_throws_on_a_malformed_value(): void
{
$this->expectException(InvalidArgumentException::class);
- (new Parameter(lit('not an enum')))->asEnums(
+ new Parameter(lit('not an enum'))->asEnums(
RowsMother::sequentialIds(1),
flow_context()->backend(),
SQLParametersStyle::class,
@@ -344,7 +344,7 @@ public function test_as_enum_with_valid_enum(): void
{
static::assertSame(
[SQLParametersStyle::NAMED],
- (new Parameter(lit(SQLParametersStyle::NAMED)))->asEnums(
+ new Parameter(lit(SQLParametersStyle::NAMED))->asEnums(
RowsMother::sequentialIds(1),
flow_context()->backend(),
SQLParametersStyle::class,
@@ -356,7 +356,7 @@ public function test_as_enum_with_wrong_enum_class(): void
{
$this->expectException(InvalidArgumentException::class);
- (new Parameter(lit(SQLParametersStyle::NAMED)))->asEnums(
+ new Parameter(lit(SQLParametersStyle::NAMED))->asEnums(
RowsMother::sequentialIds(1),
flow_context()->backend(),
StringStyles::class,
@@ -367,7 +367,7 @@ public function test_as_instance_of_propagates_null(): void
{
static::assertSame(
[null],
- (new Parameter(lit(null)))->asInstancesOf(
+ new Parameter(lit(null))->asInstancesOf(
RowsMother::sequentialIds(1),
flow_context()->backend(),
DateTimeImmutable::class,
@@ -379,7 +379,7 @@ public function test_as_instance_of_throws_on_a_malformed_value(): void
{
$this->expectException(InvalidArgumentException::class);
- (new Parameter(lit('not an object')))->asInstancesOf(
+ new Parameter(lit('not an object'))->asInstancesOf(
RowsMother::sequentialIds(1),
flow_context()->backend(),
DateTimeImmutable::class,
@@ -393,7 +393,7 @@ public function test_as_instance_of_with_valid_object(): void
static::assertEquals(
[$dateTime],
- (new Parameter((new ReferenceResolver())->resolve(ref('at'), $rows->schema())))->asInstancesOf(
+ new Parameter(new ReferenceResolver()->resolve(ref('at'), $rows->schema()))->asInstancesOf(
$rows,
flow_context()->backend(),
DateTimeImmutable::class,
@@ -401,7 +401,7 @@ public function test_as_instance_of_with_valid_object(): void
);
static::assertEquals(
[$dateTime],
- (new Parameter((new ReferenceResolver())->resolve(ref('at'), $rows->schema())))->asInstancesOf(
+ new Parameter(new ReferenceResolver()->resolve(ref('at'), $rows->schema()))->asInstancesOf(
$rows,
flow_context()->backend(),
DateTimeInterface::class,
@@ -414,7 +414,7 @@ public function test_as_int(mixed $input, ?int $default, ?int $expected): void
{
static::assertSame(
[$expected],
- (new Parameter(lit($input)))->asInts(RowsMother::sequentialIds(1), flow_context()->backend(), $default),
+ new Parameter(lit($input))->asInts(RowsMother::sequentialIds(1), flow_context()->backend(), $default),
);
}
@@ -424,14 +424,14 @@ public function test_as_ints_reads_an_integer_column_as_is_and_defaults_its_null
static::assertSame(
[1, null],
- (new Parameter((new ReferenceResolver())->resolve(ref('n'), $rows->schema())))->asInts(
+ new Parameter(new ReferenceResolver()->resolve(ref('n'), $rows->schema()))->asInts(
$rows,
flow_context()->backend(),
),
);
static::assertSame(
[1, 7],
- (new Parameter((new ReferenceResolver())->resolve(ref('n'), $rows->schema())))->asInts(
+ new Parameter(new ReferenceResolver()->resolve(ref('n'), $rows->schema()))->asInts(
$rows,
flow_context()->backend(),
7,
@@ -444,14 +444,14 @@ public function test_as_int_throws_on_a_malformed_value(): void
// A default never applies to a malformed value - only to a NULL input.
$this->expectException(InvalidArgumentException::class);
- (new Parameter(lit(3.14)))->asInts(RowsMother::sequentialIds(1), flow_context()->backend(), 99);
+ new Parameter(lit(3.14))->asInts(RowsMother::sequentialIds(1), flow_context()->backend(), 99);
}
public function test_as_list_of_objects_propagates_null(): void
{
static::assertSame(
[null],
- (new Parameter(lit(null)))->asListsOfObjects(
+ new Parameter(lit(null))->asListsOfObjects(
RowsMother::sequentialIds(1),
flow_context()->backend(),
DateTimeImmutable::class,
@@ -469,7 +469,7 @@ public function test_as_list_of_objects_reads_every_row_after_a_null(): void
static::assertEquals(
[null, [new DateTimeImmutable('2023-01-01')], [new DateTimeImmutable('2023-01-02')]],
- (new Parameter((new ReferenceResolver())->resolve(ref('l'), $rows->schema())))->asListsOfObjects(
+ new Parameter(new ReferenceResolver()->resolve(ref('l'), $rows->schema()))->asListsOfObjects(
$rows,
flow_context()->backend(),
DateTimeImmutable::class,
@@ -481,7 +481,7 @@ public function test_as_list_of_objects_throws_on_a_malformed_element(): void
{
$this->expectException(InvalidArgumentException::class);
- (new Parameter(lit([new DateTimeImmutable('2023-01-01'), 'not an object'])))->asListsOfObjects(
+ new Parameter(lit([new DateTimeImmutable('2023-01-01'), 'not an object']))->asListsOfObjects(
RowsMother::sequentialIds(1),
flow_context()->backend(),
DateTimeImmutable::class,
@@ -492,7 +492,7 @@ public function test_as_list_of_objects_throws_on_a_non_array(): void
{
$this->expectException(InvalidArgumentException::class);
- (new Parameter(lit('not an array')))->asListsOfObjects(
+ new Parameter(lit('not an array'))->asListsOfObjects(
RowsMother::sequentialIds(1),
flow_context()->backend(),
DateTimeImmutable::class,
@@ -503,7 +503,7 @@ public function test_as_list_of_objects_with_empty_array(): void
{
static::assertSame(
[[]],
- (new Parameter(lit([])))->asListsOfObjects(
+ new Parameter(lit([]))->asListsOfObjects(
RowsMother::sequentialIds(1),
flow_context()->backend(),
DateTimeImmutable::class,
@@ -518,7 +518,7 @@ public function test_as_list_of_objects_with_valid_array(): void
static::assertEquals(
[[$date1, $date2]],
- (new Parameter(lit([$date1, $date2])))->asListsOfObjects(
+ new Parameter(lit([$date1, $date2]))->asListsOfObjects(
RowsMother::sequentialIds(1),
flow_context()->backend(),
DateTimeImmutable::class,
@@ -530,7 +530,7 @@ public function test_as_list_of_objects_with_wrong_object_type(): void
{
$this->expectException(InvalidArgumentException::class);
- (new Parameter(lit([new DateTimeImmutable('2023-01-01'), new stdClass()])))->asListsOfObjects(
+ new Parameter(lit([new DateTimeImmutable('2023-01-01'), new stdClass()]))->asListsOfObjects(
RowsMother::sequentialIds(1),
flow_context()->backend(),
DateTimeImmutable::class,
@@ -542,7 +542,7 @@ public function test_as_number(mixed $input, int|float|null $default, int|float|
{
static::assertSame(
[$expected],
- (new Parameter(lit($input)))->asNumbers(RowsMother::sequentialIds(1), flow_context()->backend(), $default),
+ new Parameter(lit($input))->asNumbers(RowsMother::sequentialIds(1), flow_context()->backend(), $default),
);
}
@@ -552,14 +552,14 @@ public function test_as_numbers_reads_numeric_columns_as_is_and_defaults_their_n
static::assertSame(
[1.5, null],
- (new Parameter((new ReferenceResolver())->resolve(ref('f'), $rows->schema())))->asNumbers(
+ new Parameter(new ReferenceResolver()->resolve(ref('f'), $rows->schema()))->asNumbers(
$rows,
flow_context()->backend(),
),
);
static::assertSame(
[1.5, 0],
- (new Parameter((new ReferenceResolver())->resolve(ref('f'), $rows->schema())))->asNumbers(
+ new Parameter(new ReferenceResolver()->resolve(ref('f'), $rows->schema()))->asNumbers(
$rows,
flow_context()->backend(),
0,
@@ -571,7 +571,7 @@ public function test_as_number_throws_on_a_malformed_value(): void
{
$this->expectException(InvalidArgumentException::class);
- (new Parameter(lit('not numeric')))->asNumbers(RowsMother::sequentialIds(1), flow_context()->backend(), 99);
+ new Parameter(lit('not numeric'))->asNumbers(RowsMother::sequentialIds(1), flow_context()->backend(), 99);
}
#[DataProvider('string_data_provider')]
@@ -579,7 +579,7 @@ public function test_as_string(mixed $input, ?string $default, ?string $expected
{
static::assertSame(
[$expected],
- (new Parameter(lit($input)))->asStrings(RowsMother::sequentialIds(1), flow_context()->backend(), $default),
+ new Parameter(lit($input))->asStrings(RowsMother::sequentialIds(1), flow_context()->backend(), $default),
);
}
@@ -589,14 +589,14 @@ public function test_as_strings_reads_a_string_column_as_is_and_defaults_its_nul
static::assertSame(
['a', null],
- (new Parameter((new ReferenceResolver())->resolve(ref('s'), $rows->schema())))->asStrings(
+ new Parameter(new ReferenceResolver()->resolve(ref('s'), $rows->schema()))->asStrings(
$rows,
flow_context()->backend(),
),
);
static::assertSame(
['a', 'x'],
- (new Parameter((new ReferenceResolver())->resolve(ref('s'), $rows->schema())))->asStrings(
+ new Parameter(new ReferenceResolver()->resolve(ref('s'), $rows->schema()))->asStrings(
$rows,
flow_context()->backend(),
'x',
@@ -608,17 +608,17 @@ public function test_as_string_throws_on_a_malformed_value(): void
{
$this->expectException(InvalidArgumentException::class);
- (new Parameter(lit(42)))->asStrings(RowsMother::sequentialIds(1), flow_context()->backend(), 'default');
+ new Parameter(lit(42))->asStrings(RowsMother::sequentialIds(1), flow_context()->backend(), 'default');
}
public function test_as_types_accepts_the_first_type_that_matches(): void
{
static::assertSame(
['42'],
- (new Parameter((new ReferenceResolver())->resolve(
+ new Parameter(new ReferenceResolver()->resolve(
ref('value'),
array_to_rows([['value' => '42']], schema(str_schema('value')))->schema(),
- )))->asTypes(
+ ))->asTypes(
array_to_rows([['value' => '42']], schema(str_schema('value'))),
flow_context()->backend(),
type_string(),
@@ -631,11 +631,7 @@ public function test_as_types_propagates_null(): void
{
static::assertSame(
[null],
- (new Parameter(lit(null)))->asTypes(
- RowsMother::sequentialIds(1),
- flow_context()->backend(),
- type_integer(),
- ),
+ new Parameter(lit(null))->asTypes(RowsMother::sequentialIds(1), flow_context()->backend(), type_integer()),
);
}
@@ -644,10 +640,10 @@ public function test_as_types_throws_when_no_type_matches(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected one of "integer", "boolean", got "string". (row 0)');
- (new Parameter((new ReferenceResolver())->resolve(
+ new Parameter(new ReferenceResolver()->resolve(
ref('value'),
array_to_rows([['value' => '42']], schema(str_schema('value')))->schema(),
- )))->asTypes(
+ ))->asTypes(
array_to_rows([['value' => '42']], schema(str_schema('value'))),
flow_context()->backend(),
type_integer(),
@@ -658,14 +654,14 @@ public function test_as_types_throws_when_no_type_matches(): void
public function test_a_refused_value_names_its_row(): void
{
try {
- (new Parameter((new ReferenceResolver())->resolve(
+ new Parameter(new ReferenceResolver()->resolve(
ref('value'),
array_to_rows([
['value' => '1'],
['value' => '2'],
['value' => 'x'],
], schema(str_schema('value')))->schema(),
- )))->asInts(array_to_rows([
+ ))->asInts(array_to_rows([
['value' => '1'],
['value' => '2'],
['value' => 'x'],
@@ -681,15 +677,12 @@ public function test_constructor_with_mixed_value(): void
{
static::assertSame(
['direct_string'],
- (new Parameter('direct_string'))->values(RowsMother::sequentialIds(1), flow_context()->backend()),
- );
- static::assertSame(
- [123],
- (new Parameter(123))->values(RowsMother::sequentialIds(1), flow_context()->backend()),
+ new Parameter('direct_string')->values(RowsMother::sequentialIds(1), flow_context()->backend()),
);
+ static::assertSame([123], new Parameter(123)->values(RowsMother::sequentialIds(1), flow_context()->backend()));
static::assertSame(
[true],
- (new Parameter(true))->values(RowsMother::sequentialIds(1), flow_context()->backend()),
+ new Parameter(true)->values(RowsMother::sequentialIds(1), flow_context()->backend()),
);
}
@@ -697,12 +690,12 @@ public function test_values_read_an_array_result_back_as_arrays(): void
{
static::assertSame(
[['name' => 'a']],
- (new Parameter((new ReferenceResolver())->resolve(
+ new Parameter(new ReferenceResolver()->resolve(
ref('j')->jsonDecode(),
array_to_rows([[
'j' => '{"name":"a"}',
]], schema(json_schema('j')))->schema(),
- )))->values(array_to_rows([[
+ ))->values(array_to_rows([[
'j' => '{"name":"a"}',
]], schema(json_schema('j'))), flow_context()->backend()),
);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PerGroupAggregationTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PerGroupAggregationTest.php
index bd5588f4fa..827d803ee1 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PerGroupAggregationTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PerGroupAggregationTest.php
@@ -82,8 +82,8 @@ public function test_it_absorbs_only_another_per_group_aggregation(): void
{
$this->expectException(InvalidArgumentException::class);
- (new PerGroupAggregation(string_agg(ref('note')), Definitions::of('n', type_string(), true)))->absorbEarlier(
- new CountsByGroup(null, (new PhpBackend())->groupedCounts()),
+ new PerGroupAggregation(string_agg(ref('note')), Definitions::of('n', type_string(), true))->absorbEarlier(
+ new CountsByGroup(null, new PhpBackend()->groupedCounts()),
[],
new PhpBackend(),
);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PlusTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PlusTest.php
index ab6978f18b..df09a2e95e 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PlusTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PlusTest.php
@@ -26,7 +26,7 @@ final class PlusTest extends FlowTestCase
{
public function test_exact_keeps_decimal_arithmetic(): void
{
- static::assertSame(0.3, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(0.3, new FunctionContext(flow_context())->eval(
ref('a')->plus(ref('b'), exact: true),
['a' => 0.1, 'b' => 0.2],
schema(float_schema('a'), float_schema('b')),
@@ -35,7 +35,7 @@ public function test_exact_keeps_decimal_arithmetic(): void
public function test_floats_use_ieee_arithmetic(): void
{
- static::assertSame(0.30000000000000004, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(0.30000000000000004, new FunctionContext(flow_context())->eval(
ref('a')->plus(ref('b')),
['a' => 0.1, 'b' => 0.2],
schema(float_schema('a'), float_schema('b')),
@@ -44,7 +44,7 @@ public function test_floats_use_ieee_arithmetic(): void
public function test_integers_stay_integers(): void
{
- static::assertSame(8, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(8, new FunctionContext(flow_context())->eval(
ref('a')->plus(ref('b')),
['a' => 5, 'b' => 3],
schema(int_schema('a'), int_schema('b')),
@@ -56,7 +56,7 @@ public function test_integer_overflow_names_its_row(): void
$this->expectException(EvaluationException::class);
$this->expectExceptionMessage('Plus function integer overflow (row 0)');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('a')->plus(ref('b')),
['a' => PHP_INT_MAX, 'b' => 1],
schema(int_schema('a'), int_schema('b')),
@@ -88,7 +88,7 @@ public static function refusalsPerBackend(): Generator
public function test_a_refusal_message(Backend $backend, array $row, string $message): void
{
try {
- (new FunctionContext(flow_context(config_builder()->backend($backend)->build())))->eval(
+ new FunctionContext(flow_context(config_builder()->backend($backend)->build()))->eval(
ref('a')->plus(ref('b')),
$row,
schema(int_schema('a', nullable: true), int_schema('b', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PowerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PowerTest.php
index c36c05c51f..079010e971 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PowerTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PowerTest.php
@@ -26,12 +26,12 @@ public function test_power_non_numeric_values(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "integer", got "string".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('int')->power(lit('non numeric')),
['int' => 10],
schema(int_schema('int')),
);
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->power(lit(2)),
['str' => 'abc'],
schema(str_schema('str')),
@@ -40,7 +40,7 @@ public function test_power_non_numeric_values(): void
public function test_power_two_numeric_values(): void
{
- static::assertSame(100, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(100, new FunctionContext(flow_context())->eval(
ref('int')->power(lit(2)),
['int' => 10],
schema(int_schema('int')),
@@ -49,7 +49,7 @@ public function test_power_two_numeric_values(): void
public function test_exact_keeps_decimal_arithmetic(): void
{
- static::assertSame(1.21, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(1.21, new FunctionContext(flow_context())->eval(
ref('a')->power(ref('b'), exact: true),
['a' => 1.1, 'b' => 2],
schema(float_schema('a'), int_schema('b')),
@@ -58,7 +58,7 @@ public function test_exact_keeps_decimal_arithmetic(): void
public function test_floats_use_ieee_arithmetic(): void
{
- static::assertSame(1.2100000000000002, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(1.2100000000000002, new FunctionContext(flow_context())->eval(
ref('a')->power(ref('b')),
['a' => 1.1, 'b' => 2],
schema(float_schema('a'), int_schema('b')),
@@ -70,7 +70,7 @@ public function test_a_negative_exponent_of_an_integer_is_refused(): void
$this->expectException(EvaluationException::class);
$this->expectExceptionMessage('Power function of an integer requires a non-negative exponent (row 0)');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('a')->power(ref('b')),
['a' => 2, 'b' => -1],
schema(int_schema('a'), int_schema('b')),
@@ -79,7 +79,7 @@ public function test_a_negative_exponent_of_an_integer_is_refused(): void
public function test_a_zero_exponent_of_an_integer_is_one(): void
{
- static::assertSame(1, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(1, new FunctionContext(flow_context())->eval(
ref('a')->power(ref('b')),
['a' => 2, 'b' => 0],
schema(int_schema('a'), int_schema('b')),
@@ -91,7 +91,7 @@ public function test_a_null_exponent_is_refused(): void
$this->expectException(EvaluationException::class);
$this->expectExceptionMessage('Power function requires non-null values (row 0)');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('a')->power(ref('b')),
['a' => 2, 'b' => null],
schema(int_schema('a'), int_schema('b', nullable: true)),
@@ -102,7 +102,7 @@ public function test_exact_evaluates_every_row(): void
{
static::assertSame(
[1.21, 1.44],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
ref('a')->power(ref('b'), exact: true),
[['a' => 1.1, 'b' => 2], ['a' => 1.2, 'b' => 2]],
@@ -130,7 +130,7 @@ public function test_integer_overflow_names_its_row(): void
$this->expectException(EvaluationException::class);
$this->expectExceptionMessage('Power function integer overflow (row 0)');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('a')->power(ref('b')),
['a' => 10, 'b' => 30],
schema(int_schema('a'), int_schema('b')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PrependTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PrependTest.php
index ad6bfc60a8..92f3a66c0f 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PrependTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PrependTest.php
@@ -17,7 +17,7 @@ final class PrependTest extends FlowTestCase
{
public function test_prepend_empty_string_to_content(): void
{
- static::assertEquals('hello', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('hello', new FunctionContext(flow_context())->eval(
ref('str')->prepend(''),
['str' => 'hello'],
schema(str_schema('str')),
@@ -26,7 +26,7 @@ public function test_prepend_empty_string_to_content(): void
public function test_prepend_to_empty_string(): void
{
- static::assertEquals('hello', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('hello', new FunctionContext(flow_context())->eval(
ref('str')->prepend('hello'),
['str' => ''],
schema(str_schema('str')),
@@ -35,7 +35,7 @@ public function test_prepend_to_empty_string(): void
public function test_prepend_to_non_empty_string(): void
{
- static::assertEquals('Hello world', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('Hello world', new FunctionContext(flow_context())->eval(
ref('str')->prepend('Hello '),
['str' => 'world'],
schema(str_schema('str')),
@@ -44,7 +44,7 @@ public function test_prepend_to_non_empty_string(): void
public function test_prepend_with_null_prefix(): void
{
- static::assertEquals('world', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('world', new FunctionContext(flow_context())->eval(
ref('str')->prepend(ref('prefix')),
['str' => 'world', 'prefix' => null],
schema(str_schema('str'), str_schema('prefix', nullable: true)),
@@ -55,7 +55,7 @@ public function test_prepend_with_null_prefix_keeps_the_next_rows(): void
{
static::assertSame(
['world', 'hello world'],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
ref('str')->prepend(ref('prefix')),
[['str' => 'world', 'prefix' => null], ['str' => 'world', 'prefix' => 'hello ']],
@@ -70,7 +70,7 @@ public function test_prepend_with_null_value(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Prepend function requires non-null value');
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('str')->prepend('Hello '),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -79,7 +79,7 @@ public function test_prepend_with_null_value(): void
public function test_prepend_with_scalar_function_parameter(): void
{
- static::assertEquals('Hello world', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('Hello world', new FunctionContext(flow_context())->eval(
ref('str')->prepend(ref('prefix')),
['str' => 'world', 'prefix' => 'Hello '],
schema(str_schema('str'), str_schema('prefix')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RandomStringTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RandomStringTest.php
index 8380671ccb..534aed85bd 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RandomStringTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RandomStringTest.php
@@ -32,11 +32,11 @@ public function test_describe_round_trips(): void
public function test_a_literal_length_is_resolved(): void
{
- static::assertTrue((new RandomString(lit(5)))->resolved());
+ static::assertTrue(new RandomString(lit(5))->resolved());
}
public function test_a_reference_length_is_not_resolved(): void
{
- static::assertFalse((new RandomString(ref('length')))->resolved());
+ static::assertFalse(new RandomString(ref('length'))->resolved());
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Reference/UnresolvedReferenceTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Reference/UnresolvedReferenceTest.php
index 0607afea0b..baac2a80f2 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Reference/UnresolvedReferenceTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Reference/UnresolvedReferenceTest.php
@@ -38,7 +38,7 @@ public function test_asc_and_desc_sort_the_column_read_never_the_alias(): void
public function test_executing_equals_expression(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('a')->equals(ref('b')),
['a' => 1, 'b' => 1],
schema(int_schema('a'), int_schema('b')),
@@ -47,7 +47,7 @@ public function test_executing_equals_expression(): void
public function test_executing_expression(): void
{
- static::assertSame(100, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(100, new FunctionContext(flow_context())->eval(
ref('b')->literal(100),
['a' => 1],
schema(int_schema('a')),
@@ -58,18 +58,18 @@ public function test_is_even(): void
{
$ref = ref('a')->isEven();
- static::assertFalse((new FunctionContext(flow_context()))->eval($ref, ['a' => 1], schema(int_schema('a'))));
+ static::assertFalse(new FunctionContext(flow_context())->eval($ref, ['a' => 1], schema(int_schema('a'))));
- static::assertTrue((new FunctionContext(flow_context()))->eval($ref, ['a' => 2], schema(int_schema('a'))));
+ static::assertTrue(new FunctionContext(flow_context())->eval($ref, ['a' => 2], schema(int_schema('a'))));
}
public function test_is_odd(): void
{
$ref = ref('a')->isOdd();
- static::assertTrue((new FunctionContext(flow_context()))->eval($ref, ['a' => 1], schema(int_schema('a'))));
+ static::assertTrue(new FunctionContext(flow_context())->eval($ref, ['a' => 1], schema(int_schema('a'))));
- static::assertFalse((new FunctionContext(flow_context()))->eval($ref, ['a' => 2], schema(int_schema('a'))));
+ static::assertFalse(new FunctionContext(flow_context())->eval($ref, ['a' => 2], schema(int_schema('a'))));
}
public function test_nulls_default_to_the_smallest_value_and_can_be_moved(): void
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReferenceRenameTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReferenceRenameTest.php
index 1354b4e58b..58935000f2 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReferenceRenameTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReferenceRenameTest.php
@@ -15,14 +15,14 @@ final class ReferenceRenameTest extends FlowTestCase
{
public function test_a_reference_to_the_renamed_column_points_at_the_new_one(): void
{
- static::assertEquals(ref('year'), (new ReferenceRename('y', 'year'))->in(ref('y')));
+ static::assertEquals(ref('year'), new ReferenceRename('y', 'year')->in(ref('y')));
}
public function test_every_reference_inside_the_tree_is_renamed_and_the_rest_kept(): void
{
static::assertEquals(
ref('year')->equals(lit(2023))->and(ref('month')->equals(lit('07'))),
- (new ReferenceRename('y', 'year'))->in(ref('y')->equals(lit(2023))->and(ref('month')->equals(lit('07')))),
+ new ReferenceRename('y', 'year')->in(ref('y')->equals(lit(2023))->and(ref('month')->equals(lit('07')))),
);
}
@@ -30,16 +30,16 @@ public function test_a_tree_without_the_column_is_returned_as_is(): void
{
$tree = ref('month')->equals(lit('07'));
- static::assertSame($tree, (new ReferenceRename('y', 'year'))->in($tree));
+ static::assertSame($tree, new ReferenceRename('y', 'year')->in($tree));
}
public function test_an_alias_on_the_reference_is_kept(): void
{
- static::assertEquals(ref('year')->as('label'), (new ReferenceRename('y', 'year'))->in(ref('y')->as('label')));
+ static::assertEquals(ref('year')->as('label'), new ReferenceRename('y', 'year')->in(ref('y')->as('label')));
}
public function test_a_resolved_reference_to_the_column_cannot_be_renamed(): void
{
- static::assertNull((new ReferenceRename('y', 'year'))->in(ref('y')->resolve(int_schema('y'))));
+ static::assertNull(new ReferenceRename('y', 'year')->in(ref('y')->resolve(int_schema('y'))));
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReferenceResolverTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReferenceResolverTest.php
index 146dda360a..564ea3fd54 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReferenceResolverTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReferenceResolverTest.php
@@ -55,7 +55,7 @@ public function test_a_string_compared_with_a_temporal_operand_is_cast_to_it(
): void {
static::assertSame(
$expected,
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve($predicate, schema(
datetime_schema('ts'),
date_schema('d'),
@@ -70,10 +70,7 @@ public function test_a_string_compared_with_a_temporal_operand_is_cast_to_it(
public function test_same_keeps_a_string_and_a_datetime_strict(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(
- ref('ts')->same(lit('2026-10-02')),
- schema(datetime_schema('ts')),
- );
+ $resolved = new ReferenceResolver()->resolve(ref('ts')->same(lit('2026-10-02')), schema(datetime_schema('ts')));
static::assertInstanceOf(Literal::class, $resolved->children()[1]);
}
@@ -81,22 +78,22 @@ public function test_same_keeps_a_string_and_a_datetime_strict(): void
public function test_a_coerced_comparison_resolves_to_itself(): void
{
$schema = schema(datetime_schema('ts'), str_schema('s'));
- $resolved = (new ReferenceResolver())->resolve(ref('ts')->equals(ref('s')), $schema);
+ $resolved = new ReferenceResolver()->resolve(ref('ts')->equals(ref('s')), $schema);
- static::assertSame($resolved, (new ReferenceResolver())->resolve($resolved, $schema));
+ static::assertSame($resolved, new ReferenceResolver()->resolve($resolved, $schema));
}
public function test_a_comparison_over_an_unknown_column_is_left_as_it_is(): void
{
$predicate = ref('missing')->equals(lit('2026-10-02'));
- static::assertSame($predicate, (new ReferenceResolver())->resolve($predicate, schema(datetime_schema('ts'))));
+ static::assertSame($predicate, new ReferenceResolver()->resolve($predicate, schema(datetime_schema('ts'))));
}
public function test_resolves_a_leaf_from_a_hand_built_schema(): void
{
/** @var ResolvedReference $resolved */
- $resolved = (new ReferenceResolver())->resolve(ref('a'), schema(int_schema('a')));
+ $resolved = new ReferenceResolver()->resolve(ref('a'), schema(int_schema('a')));
static::assertInstanceOf(ResolvedReference::class, $resolved);
static::assertSame('integer', $resolved->returns()->toString());
@@ -106,7 +103,7 @@ public function test_resolves_a_leaf_from_a_hand_built_schema(): void
public function test_resolves_a_leaf_inside_a_nested_tree(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(ref('a')->upper()->equals(lit('X')), schema(str_schema('a')));
+ $resolved = new ReferenceResolver()->resolve(ref('a')->upper()->equals(lit('X')), schema(str_schema('a')));
static::assertTrue($resolved->resolved());
static::assertSame('boolean', $resolved->returns()->toString());
@@ -115,14 +112,14 @@ public function test_resolves_a_leaf_inside_a_nested_tree(): void
public function test_returns_the_same_object_when_nothing_moved(): void
{
$schema = schema(str_schema('a'));
- $resolved = (new ReferenceResolver())->resolve(ref('a')->upper(), $schema);
+ $resolved = new ReferenceResolver()->resolve(ref('a')->upper(), $schema);
- static::assertSame($resolved, (new ReferenceResolver())->resolve($resolved, $schema));
+ static::assertSame($resolved, new ReferenceResolver()->resolve($resolved, $schema));
}
public function test_an_unknown_column_is_left_unresolved(): void
{
- $resolved = (new ReferenceResolver())->resolve(ref('missing'), schema(str_schema('a')));
+ $resolved = new ReferenceResolver()->resolve(ref('missing'), schema(str_schema('a')));
static::assertInstanceOf(UnresolvedReference::class, $resolved);
static::assertFalse($resolved->resolved());
@@ -132,7 +129,7 @@ public function test_the_original_tree_is_not_mutated(): void
{
$tree = ref('a')->upper();
- (new ReferenceResolver())->resolve($tree, schema(str_schema('a')));
+ new ReferenceResolver()->resolve($tree, schema(str_schema('a')));
static::assertFalse($tree->resolved());
static::assertInstanceOf(UnresolvedReference::class, $tree->children()[0]);
@@ -141,7 +138,7 @@ public function test_the_original_tree_is_not_mutated(): void
public function test_a_lambda_body_is_not_walked(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(
+ $resolved = new ReferenceResolver()->resolve(
ref('list')->onEach(ref('element')->upper()),
schema(list_schema('list', type_list(type_string())), str_schema('element')),
);
@@ -154,7 +151,7 @@ public function test_an_exists_operand_is_not_walked(): void
$tree = ref('missing')->exists();
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve($tree, schema(str_schema('a')));
+ $resolved = new ReferenceResolver()->resolve($tree, schema(str_schema('a')));
static::assertSame($tree, $resolved);
static::assertTrue($resolved->resolved());
@@ -167,7 +164,7 @@ public function test_an_impossible_comparison_fails_at_bind(): void
$this->expectExceptionMessage("Can't compare");
/** @var ScalarFunction $predicate */
- $predicate = (new ReferenceResolver())->resolve(
+ $predicate = new ReferenceResolver()->resolve(
ref('id')->greaterThan(ref('created_at')),
schema(int_schema('id'), datetime_schema('created_at')),
);
@@ -181,8 +178,8 @@ public function test_assert_resolved_names_the_column_and_the_available_ones():
$schema = schema(int_schema('id'), int_schema('score'));
- (new ReferenceResolver())->assertResolved(
- (new ReferenceResolver())->resolve(ref('scoree')->greaterThan(lit(10)), $schema),
+ new ReferenceResolver()->assertResolved(
+ new ReferenceResolver()->resolve(ref('scoree')->greaterThan(lit(10)), $schema),
$schema,
);
}
@@ -191,8 +188,8 @@ public function test_assert_resolved_passes_for_a_fully_resolved_tree(): void
{
$schema = schema(int_schema('score'));
- (new ReferenceResolver())->assertResolved(
- (new ReferenceResolver())->resolve(ref('score')->greaterThan(lit(10)), $schema),
+ new ReferenceResolver()->assertResolved(
+ new ReferenceResolver()->resolve(ref('score')->greaterThan(lit(10)), $schema),
$schema,
);
@@ -201,7 +198,7 @@ public function test_assert_resolved_passes_for_a_fully_resolved_tree(): void
public function test_an_aliased_reference_resolves_by_its_source_column(): void
{
- $resolved = (new ReferenceResolver())->resolve(ref('age')->as('total_age'), schema(int_schema('age')));
+ $resolved = new ReferenceResolver()->resolve(ref('age')->as('total_age'), schema(int_schema('age')));
static::assertInstanceOf(ResolvedReference::class, $resolved);
static::assertSame('total_age', $resolved->name());
@@ -211,7 +208,7 @@ public function test_an_aliased_reference_resolves_by_its_source_column(): void
public function test_bind_returns_the_resolved_tree(): void
{
- static::assertInstanceOf(ResolvedReference::class, (new ReferenceResolver())->bind(
+ static::assertInstanceOf(ResolvedReference::class, new ReferenceResolver()->bind(
ref('id'),
schema(int_schema('id')),
'transform',
@@ -222,7 +219,7 @@ public function test_bind_refuses_an_unknown_column(): void
{
$this->expectException(SchemaDefinitionNotFoundException::class);
- (new ReferenceResolver())->bind(ref('missing'), schema(int_schema('id')), 'transform');
+ new ReferenceResolver()->bind(ref('missing'), schema(int_schema('id')), 'transform');
}
public function test_bind_refuses_an_expansion_naming_the_method(): void
@@ -230,7 +227,7 @@ public function test_bind_refuses_an_expansion_naming_the_method(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('over() cannot contain array_expand()');
- (new ReferenceResolver())->bind(
+ new ReferenceResolver()->bind(
array_expand(ref('list')),
schema(list_schema('list', type_list(type_string()))),
'over',
@@ -242,14 +239,14 @@ public function test_bind_refuses_a_result_of_another_type_than_required(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('until() requires a predicate returning boolean');
- (new ReferenceResolver())->bind(ref('id'), schema(int_schema('id')), 'until', type_boolean());
+ new ReferenceResolver()->bind(ref('id'), schema(int_schema('id')), 'until', type_boolean());
}
public function test_bind_accepts_a_nullable_result_of_the_required_type(): void
{
static::assertSame(
'?boolean',
- (new ReferenceResolver())
+ new ReferenceResolver()
->bind(ref('id')->equals(lit(1)), schema(int_schema('id', nullable: true)), 'filter', type_boolean())
->returns()
->toString(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReferencedColumnsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReferencedColumnsTest.php
index 8d86f7612b..154dc315ff 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReferencedColumnsTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReferencedColumnsTest.php
@@ -14,24 +14,24 @@ final class ReferencedColumnsTest extends FlowTestCase
{
public function test_a_bare_reference_is_its_own_source_column(): void
{
- static::assertSame(['a'], (new ReferencedColumns())->in(ref('a'))->names());
+ static::assertSame(['a'], new ReferencedColumns()->in(ref('a'))->names());
}
public function test_an_alias_reports_the_source_column(): void
{
- static::assertSame(['year'], (new ReferencedColumns())->in(ref('year')->as('y'))->names());
+ static::assertSame(['year'], new ReferencedColumns()->in(ref('year')->as('y'))->names());
}
public function test_a_nested_tree_reports_every_column_once(): void
{
static::assertSame(
['a', 'b'],
- (new ReferencedColumns())->in(ref('a')->equals(ref('b'))->and(ref('a')->isNotNull()))->names(),
+ new ReferencedColumns()->in(ref('a')->equals(ref('b'))->and(ref('a')->isNotNull()))->names(),
);
}
public function test_a_literal_only_predicate_references_nothing(): void
{
- static::assertSame([], (new ReferencedColumns())->in(lit(true))->names());
+ static::assertSame([], new ReferencedColumns()->in(lit(true))->names());
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexAllTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexAllTest.php
index f0231c37a2..0f213c474d 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexAllTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexAllTest.php
@@ -27,12 +27,12 @@ public function test_regex_all_expression_on_invalid_subject(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "string", got "integer".');
- (new FunctionContext(flow_context()))->eval(regex_all(lit('/\d+/'), lit(2)), [], schema());
+ new FunctionContext(flow_context())->eval(regex_all(lit('/\d+/'), lit(2)), [], schema());
}
public function test_regex_all_expression_on_no_match(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
regex_all(lit('/\d+/'), lit('apples and oranges')),
[],
schema(),
@@ -47,7 +47,7 @@ public function test_regex_all_expression_on_valid_strings(): void
['124.23', '12', '45'],
['EUR', 'USD', 'PLN'],
],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
regex_all(lit('/(\d+(?:\.\d+)?)\s+([A-Z]{3})/'), lit('124.23 EUR 12 USD 45 PLN')),
[],
schema(),
@@ -72,7 +72,7 @@ public function test_the_default_offset_starts_at_the_beginning(): void
{
static::assertSame(
[['a']],
- (new FunctionContext(flow_context()))->eval(regex_all(lit('/a/'), lit('ab')), [], schema()),
+ new FunctionContext(flow_context())->eval(regex_all(lit('/a/'), lit('ab')), [], schema()),
);
}
@@ -81,7 +81,7 @@ public function test_a_null_subject_is_refused(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('RegexAll requires non-null subject');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
regex_all(lit('/a/'), ref('subject')),
['subject' => null],
schema(str_schema('subject', nullable: true)),
@@ -92,7 +92,7 @@ public function test_every_matching_row_gives_its_matches(): void
{
static::assertSame(
[[['a']], [['a', 'a']]],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
regex_all(lit('/a/'), ref('subject')),
[['subject' => 'a'], ['subject' => 'aa']],
@@ -107,7 +107,7 @@ public function test_regex_expression_on_invalid_pattern(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "string", got "integer".');
- (new FunctionContext(flow_context()))->eval(regex_all(lit(1), lit('12 apples and 45 oranges')), [], schema());
+ new FunctionContext(flow_context())->eval(regex_all(lit(1), lit('12 apples and 45 oranges')), [], schema());
}
public function test_describe_round_trips(): void
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexMatchAllTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexMatchAllTest.php
index f0d3eba11f..4ebeb2e69f 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexMatchAllTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexMatchAllTest.php
@@ -23,7 +23,7 @@ public function test_regex_match_all_expression_on_invalid_flags(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "integer", got "string".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
regex_match_all(lit('/\d+/'), lit('12 apples and 45 oranges'), lit('invalid')),
[],
schema(),
@@ -35,7 +35,7 @@ public function test_regex_match_all_expression_on_invalid_pattern(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "string", got "integer".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
regex_match_all(lit(1), lit('12 apples and 45 oranges')),
[],
schema(),
@@ -47,14 +47,14 @@ public function test_regex_match_all_expression_on_invalid_subject(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "string", got "integer".');
- (new FunctionContext(flow_context()))->eval(regex_match_all(lit('/\d+/'), lit(2)), [], schema());
+ new FunctionContext(flow_context())->eval(regex_match_all(lit('/\d+/'), lit(2)), [], schema());
}
public function test_any_null_argument_gives_null_and_the_next_row_still_matches(): void
{
static::assertSame(
[null, null, null, null, true],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
regex_match_all(ref('pattern'), ref('subject'), ref('flags'), ref('offset')),
[
@@ -77,7 +77,7 @@ public function test_any_null_argument_gives_null_and_the_next_row_still_matches
public function test_regex_match_all_expression_on_valid_strings(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
regex_match_all(lit('/\d+/'), lit('12 apples and 45 oranges')),
[],
schema(),
@@ -86,7 +86,7 @@ public function test_regex_match_all_expression_on_valid_strings(): void
public function test_regex_match_all_expression_without_a_match_is_false(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
regex_match_all(lit('/\d+/'), lit('apples')),
[],
schema(),
@@ -95,7 +95,7 @@ public function test_regex_match_all_expression_without_a_match_is_false(): void
public function test_regex_match_all_expression_on_valid_strings_with_flags(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
regex_match_all(
lit('/(\d+(?:\.\d+)?)\s+([A-Z]{3})/'),
lit('124.23 EUR 12 USD 45 PLN'),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexMatchTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexMatchTest.php
index 76c28b5baf..7e803afedc 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexMatchTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexMatchTest.php
@@ -23,7 +23,7 @@ public function test_regex_match_expression_on_invalid_pattern(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "string", got "integer".');
- (new FunctionContext(flow_context()))->eval(regex_match(lit(1), lit('12 apples and 45 oranges')), [], schema());
+ new FunctionContext(flow_context())->eval(regex_match(lit(1), lit('12 apples and 45 oranges')), [], schema());
}
public function test_regex_match_expression_on_invalid_subject(): void
@@ -31,12 +31,12 @@ public function test_regex_match_expression_on_invalid_subject(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "string", got "integer".');
- (new FunctionContext(flow_context()))->eval(regex_match(lit('/\d+/'), lit(2)), [], schema());
+ new FunctionContext(flow_context())->eval(regex_match(lit('/\d+/'), lit(2)), [], schema());
}
public function test_regex_match_expression_on_no_match(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
regex_match(lit('/\d+/'), lit('apples and oranges')),
[],
schema(),
@@ -45,7 +45,7 @@ public function test_regex_match_expression_on_no_match(): void
public function test_the_default_offset_starts_at_the_beginning(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
regex_match(lit('/^a/'), lit('ab')),
[],
schema(),
@@ -56,7 +56,7 @@ public function test_any_null_argument_gives_null_and_the_next_row_still_matches
{
static::assertSame(
[null, null, null, null, true],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
regex_match(ref('pattern'), ref('subject'), ref('flags'), ref('offset')),
[
@@ -79,7 +79,7 @@ public function test_any_null_argument_gives_null_and_the_next_row_still_matches
public function test_regex_match_expression_on_valid_strings(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
regex_match(lit('/\d+/'), lit('12 apples and 45 oranges')),
[],
schema(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexReplaceTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexReplaceTest.php
index 33a802b8d1..9d7d0b56e8 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexReplaceTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexReplaceTest.php
@@ -20,7 +20,7 @@ final class RegexReplaceTest extends FlowTestCase
{
public function test_a_null_limit_still_means_unlimited(): void
{
- static::assertSame('x x x', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('x x x', new FunctionContext(flow_context())->eval(
regex_replace(lit('/a/'), lit('x'), ref('text')),
[
'text' => 'a a a',
@@ -31,7 +31,7 @@ public function test_a_null_limit_still_means_unlimited(): void
public function test_a_limit_caps_the_replacements(): void
{
- static::assertSame('x a a', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('x a a', new FunctionContext(flow_context())->eval(
regex_replace(lit('/a/'), lit('x'), ref('text'), lit(1)),
[
'text' => 'a a a',
@@ -45,7 +45,7 @@ public function test_regex_replace_on_invalid_pattern(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "string", got "integer".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
regex_replace(lit(1), lit('bar'), lit('foo is awesome')),
[],
schema(),
@@ -57,7 +57,7 @@ public function test_regex_replace_on_invalid_replacement(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "string", got "integer".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
regex_replace(lit('/(foo)/'), lit(2), lit('foo is awesome')),
[],
schema(),
@@ -69,12 +69,12 @@ public function test_regex_replace_on_invalid_subject(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "string", got "integer".');
- (new FunctionContext(flow_context()))->eval(regex_replace(lit('/(foo)/'), lit('bar'), lit(3)), [], schema());
+ new FunctionContext(flow_context())->eval(regex_replace(lit('/(foo)/'), lit('bar'), lit(3)), [], schema());
}
public function test_the_limit_survives_a_describe_round_trip(): void
{
- static::assertSame('baa', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('baa', new FunctionContext(flow_context())->eval(
DescribeRoundTrip::rebuilt(regex_replace(lit('/a/'), lit('b'), lit('aaa'), 1)),
[],
schema(),
@@ -86,7 +86,7 @@ public function test_a_null_subject_is_refused(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('RegexReplace requires non-null subject');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
regex_replace(lit('/a/'), lit('b'), ref('subject')),
['subject' => null],
schema(str_schema('subject', nullable: true)),
@@ -95,7 +95,7 @@ public function test_a_null_subject_is_refused(): void
public function test_regex_replace_on_valid_strings(): void
{
- static::assertSame('bar is awesome', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('bar is awesome', new FunctionContext(flow_context())->eval(
regex_replace(lit('/(foo)/'), lit('bar'), lit('foo is awesome')),
[],
schema(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexTest.php
index 10a581194c..b8362edb3f 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexTest.php
@@ -32,7 +32,7 @@ public function test_regex_expression_on_invalid_pattern(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "string", got "integer".');
- (new FunctionContext(flow_context()))->eval(regex(lit(1), lit('12 apples and 45 oranges')), [], schema());
+ new FunctionContext(flow_context())->eval(regex(lit(1), lit('12 apples and 45 oranges')), [], schema());
}
public function test_regex_expression_on_invalid_subject(): void
@@ -40,12 +40,12 @@ public function test_regex_expression_on_invalid_subject(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "string", got "integer".');
- (new FunctionContext(flow_context()))->eval(regex(lit('/\d+/'), lit(2)), [], schema());
+ new FunctionContext(flow_context())->eval(regex(lit('/\d+/'), lit(2)), [], schema());
}
public function test_regex_expression_on_no_match(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
regex(lit('/\d+/'), lit('apples and oranges')),
[],
schema(),
@@ -56,7 +56,7 @@ public function test_regex_expression_on_a_match_at_the_start(): void
{
static::assertSame(
['a'],
- (new FunctionContext(flow_context()))->eval(regex(lit('/^a/'), lit('ab')), [], schema()),
+ new FunctionContext(flow_context())->eval(regex(lit('/^a/'), lit('ab')), [], schema()),
);
}
@@ -65,7 +65,7 @@ public function test_regex_expression_on_null_subject(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Regex requires non-null subject');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
regex(lit('/a/'), ref('subject')),
['subject' => null],
schema(str_schema('subject', nullable: true)),
@@ -82,7 +82,7 @@ public function test_regex_refuses_unmatched_as_null_flag(): void
public function test_regex_expression_on_valid_strings(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
regex_match_all(lit('/\d+/'), lit('12 apples and 45 oranges')),
[],
schema(),
@@ -116,14 +116,14 @@ public function test_a_description_rebuilds_through_the_constructor_checks(): vo
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Regex does not support PREG_OFFSET_CAPTURE');
- (new Rebuild())->of($data, ScalarFunction::class);
+ new Rebuild()->of($data, ScalarFunction::class);
}
public function test_a_match_keeps_the_rows_after_it(): void
{
static::assertSame(
[['a'], ['a']],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
ref('subject')->regex('/a/'),
[['subject' => 'ab'], ['subject' => 'ba']],
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RepeatTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RepeatTest.php
index c3819a6db6..39527f32c2 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RepeatTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RepeatTest.php
@@ -18,7 +18,7 @@ final class RepeatTest extends FlowTestCase
{
public function test_repeat_empty_string(): void
{
- static::assertSame('', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('', new FunctionContext(flow_context())->eval(
ref('str')->repeat(3),
['str' => ''],
schema(str_schema('str')),
@@ -30,7 +30,7 @@ public function test_repeat_negative_times(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Repeat function requires non-null, positive times');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->repeat(-1),
['str' => 'hello'],
schema(str_schema('str')),
@@ -42,7 +42,7 @@ public function test_repeat_null_input(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Repeat function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->repeat(3),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -51,7 +51,7 @@ public function test_repeat_null_input(): void
public function test_repeat_string_multiple_times(): void
{
- static::assertSame('hellohellohello', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('hellohellohello', new FunctionContext(flow_context())->eval(
ref('str')->repeat(3),
['str' => 'hello'],
schema(str_schema('str')),
@@ -63,7 +63,7 @@ public function test_repeat_with_null_times(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Repeat function requires non-null, positive times');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->repeat(ref('times')),
['str' => 'hello', 'times' => null],
schema(str_schema('str'), str_schema('times', nullable: true)),
@@ -72,7 +72,7 @@ public function test_repeat_with_null_times(): void
public function test_repeat_with_scalar_function_times(): void
{
- static::assertSame('hellohello', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('hellohello', new FunctionContext(flow_context())->eval(
ref('str')->repeat(ref('times')),
['str' => 'hello', 'times' => 2],
schema(str_schema('str'), int_schema('times')),
@@ -84,10 +84,6 @@ public function test_repeat_zero_times(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Repeat function requires non-null, positive times');
- (new FunctionContext(flow_context()))->eval(
- ref('str')->repeat(0),
- ['str' => 'hello'],
- schema(str_schema('str')),
- );
+ new FunctionContext(flow_context())->eval(ref('str')->repeat(0), ['str' => 'hello'], schema(str_schema('str')));
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReverseTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReverseTest.php
index 08cbbd1481..fe316f1bab 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReverseTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReverseTest.php
@@ -17,7 +17,7 @@ final class ReverseTest extends FlowTestCase
{
public function test_reverse_ascii_string(): void
{
- static::assertSame('olleh', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('olleh', new FunctionContext(flow_context())->eval(
ref('str')->reverse(),
['str' => 'hello'],
schema(str_schema('str')),
@@ -26,7 +26,7 @@ public function test_reverse_ascii_string(): void
public function test_reverse_empty_string(): void
{
- static::assertSame('', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('', new FunctionContext(flow_context())->eval(
ref('str')->reverse(),
['str' => ''],
schema(str_schema('str')),
@@ -38,7 +38,7 @@ public function test_reverse_throws_on_null_input(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Reverse function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->reverse(),
['str' => null],
schema(str_schema('str', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RoundTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RoundTest.php
index cf095658b8..684413e78b 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RoundTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RoundTest.php
@@ -21,13 +21,13 @@ final class RoundTest extends FlowTestCase
{
public function test_round_float(): void
{
- static::assertEquals(10.12, (new FunctionContext(flow_context()))->eval(
+ static::assertEquals(10.12, new FunctionContext(flow_context())->eval(
ref('float')->round(lit(2)),
['float' => 10.123],
schema(float_schema('float')),
));
- static::assertIsFloat((new FunctionContext(flow_context()))->eval(
+ static::assertIsFloat(new FunctionContext(flow_context())->eval(
ref('float')->round(lit(2)),
['float' => 10.123],
schema(float_schema('float')),
@@ -36,7 +36,7 @@ public function test_round_float(): void
public function test_round_with_precision_0(): void
{
- static::assertSame(10.0, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(10.0, new FunctionContext(flow_context())->eval(
ref('float')->round(lit(0)),
['float' => 10.123],
schema(float_schema('float')),
@@ -47,7 +47,7 @@ public function test_constructor_default_matches_the_dsl_default(): void
{
static::assertSame(
round(10.12345, 2),
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
new Round(ref('float')),
['float' => 10.12345],
schema(float_schema('float')),
@@ -55,7 +55,7 @@ public function test_constructor_default_matches_the_dsl_default(): void
);
static::assertSame(
round(10.12345, 2),
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('float')->round(),
['float' => 10.12345],
schema(float_schema('float')),
@@ -65,7 +65,7 @@ public function test_constructor_default_matches_the_dsl_default(): void
public function test_half_odd_is_the_last_known_mode(): void
{
- static::assertSame(3.0, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(3.0, new FunctionContext(flow_context())->eval(
lit(2.5)->round(lit(0), lit(PHP_ROUND_HALF_ODD)),
[],
schema(),
@@ -79,7 +79,7 @@ public function test_an_unknown_mode_is_refused(): void
'Round mode 9 is unknown, use PHP_ROUND_HALF_UP (1), PHP_ROUND_HALF_DOWN (2), PHP_ROUND_HALF_EVEN (3) or PHP_ROUND_HALF_ODD (4)',
);
- (new FunctionContext(flow_context()))->eval(lit(2.5)->round(lit(0), lit(9)), [], schema());
+ new FunctionContext(flow_context())->eval(lit(2.5)->round(lit(0), lit(9)), [], schema());
}
public function test_round_on_null(): void
@@ -87,7 +87,7 @@ public function test_round_on_null(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Round function requires non-null values');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('float')->round(lit(2)),
['float' => null],
schema(float_schema('float', nullable: true)),
@@ -99,7 +99,7 @@ public function test_a_null_precision_is_refused(): void
$this->expectException(EvaluationException::class);
$this->expectExceptionMessage('Round function requires non-null values (row 0)');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->round(ref('precision')),
['value' => 1.25, 'precision' => null],
schema(float_schema('value'), int_schema('precision', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RowHashTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RowHashTest.php
index bc21cd24dd..ed3f0165a7 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RowHashTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RowHashTest.php
@@ -27,7 +27,7 @@ public function test_it_hashes_the_named_pairs_of_each_row(): void
{
static::assertSame(
['bdea5ee4847f3df6cb724988fb66ecd4', 'ba7c3390ce5fcedfea5c7d697dbe1ac9'],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
row_hash(ref('a'), ref('b')),
[['a' => 1, 'b' => 'x'], ['a' => 2, 'b' => 'y']],
@@ -45,7 +45,7 @@ public function test_it_equals_the_row_hashes_of_the_backend(): void
);
static::assertSame(
- (new PhpBackend())
+ new PhpBackend()
->rowHashes($rows->columns(), 2)
->values(),
row_hash(ref('a'), ref('b'))->eval($rows, new PhpBackend())->values(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SanitizeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SanitizeTest.php
index bab03e8f41..4eddfec2b5 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SanitizeTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SanitizeTest.php
@@ -23,7 +23,7 @@ public function test_sanitize_on_non_string_value(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "string", got "integer".');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->sanitize(),
['value' => 1000],
schema(int_schema('value')),
@@ -32,7 +32,7 @@ public function test_sanitize_on_non_string_value(): void
public function test_sanitize_on_valid_string(): void
{
- static::assertSame('****', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('****', new FunctionContext(flow_context())->eval(
ref('value')->sanitize(),
['value' => 'test'],
schema(str_schema('value')),
@@ -41,7 +41,7 @@ public function test_sanitize_on_valid_string(): void
public function test_sanitize_on_valid_string_with_left_characters(): void
{
- static::assertSame('te**', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('te**', new FunctionContext(flow_context())->eval(
ref('value')->sanitize(skipCharacters: lit(2)),
['value' => 'test'],
schema(str_schema('value')),
@@ -50,7 +50,7 @@ public function test_sanitize_on_valid_string_with_left_characters(): void
public function test_sanitize_on_valid_string_with_left_characters_longer_than_string(): void
{
- static::assertSame('****', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('****', new FunctionContext(flow_context())->eval(
ref('value')->sanitize(skipCharacters: lit(5)),
['value' => 'test'],
schema(str_schema('value')),
@@ -59,7 +59,7 @@ public function test_sanitize_on_valid_string_with_left_characters_longer_than_s
public function test_sanitize_on_valid_string_with_placeholder(): void
{
- static::assertSame('----', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('----', new FunctionContext(flow_context())->eval(
ref('value')->sanitize(lit('-')),
['value' => 'test'],
schema(str_schema('value')),
@@ -71,7 +71,7 @@ public function test_sanitize_on_null(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Sanitize function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->sanitize(),
['value' => null],
schema(str_schema('value', nullable: true)),
@@ -82,7 +82,7 @@ public function test_skipped_characters_count_multibyte_characters_and_each_row_
{
static::assertSame(
['ż***', 'a*', '*'],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
sanitize(ref('value'), lit('*'), lit(1)),
[['value' => 'żółw'], ['value' => 'ab'], ['value' => 'b']],
@@ -94,7 +94,7 @@ public function test_skipped_characters_count_multibyte_characters_and_each_row_
public function test_a_value_as_long_as_the_skipped_characters_is_fully_masked(): void
{
- static::assertSame('**', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('**', new FunctionContext(flow_context())->eval(
sanitize(lit('ab'), lit('*'), lit(2)),
[],
schema(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SizeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SizeTest.php
index 02c113a603..813cb544fb 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SizeTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SizeTest.php
@@ -21,7 +21,7 @@ final class SizeTest extends FlowTestCase
{
public function test_size_expression_on_array_value(): void
{
- static::assertSame(3, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(3, new FunctionContext(flow_context())->eval(
size(lit(['foo', 'bar', 'baz'])),
[],
schema(),
@@ -32,7 +32,7 @@ public function test_every_string_row_gives_its_length(): void
{
static::assertSame(
[1, 2],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(size(ref('v')), [['v' => 'a'], ['v' => 'ab']], schema(str_schema('v')))
->values(),
);
@@ -42,7 +42,7 @@ public function test_every_array_row_gives_its_count(): void
{
static::assertSame(
[1, 2],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
size(ref('v')),
[['v' => [1]], ['v' => [1, 2]]],
@@ -54,11 +54,11 @@ public function test_every_array_row_gives_its_count(): void
public function test_size_expression_on_integer_value(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(size(lit(1)), [], schema()));
+ static::assertNull(new FunctionContext(flow_context())->eval(size(lit(1)), [], schema()));
}
public function test_size_expression_on_string_value(): void
{
- static::assertSame(3, (new FunctionContext(flow_context()))->eval(size(lit('foo')), [], schema()));
+ static::assertSame(3, new FunctionContext(flow_context())->eval(size(lit('foo')), [], schema()));
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SlugTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SlugTest.php
index 4ce68bdb05..b3aa647bb2 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SlugTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SlugTest.php
@@ -20,7 +20,7 @@ public function test_a_malformed_separator_operand_throws(): void
{
$this->expectException(InvalidArgumentException::class);
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->slug(lit(123)),
['value' => 'hello world'],
schema(str_schema('value')),
@@ -32,7 +32,7 @@ public function test_ascii_on_null(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Slug function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->slug(),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -41,7 +41,7 @@ public function test_ascii_on_null(): void
public function test_slug(): void
{
- static::assertSame('azcz', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('azcz', new FunctionContext(flow_context())->eval(
ref('str')->slug(),
['str' => 'ąźćż'],
schema(str_schema('str')),
@@ -50,7 +50,7 @@ public function test_slug(): void
public function test_slug_separator(): void
{
- static::assertSame('Some_Text', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('Some_Text', new FunctionContext(flow_context())->eval(
ref('str')->slug('_'),
['str' => 'Some Text'],
schema(str_schema('str')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SplitTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SplitTest.php
index f499fd5006..ae9452dce5 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SplitTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SplitTest.php
@@ -24,14 +24,14 @@ public function test_split_not_string(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "string", got "integer".');
- (new FunctionContext(flow_context()))->eval(split(lit(123), ','), [], schema());
+ new FunctionContext(flow_context())->eval(split(lit(123), ','), [], schema());
}
public function test_split_string(): void
{
static::assertSame(
['foo', 'bar', 'baz'],
- (new FunctionContext(flow_context()))->eval(split(lit('foo,bar,baz'), ','), [], schema()),
+ new FunctionContext(flow_context())->eval(split(lit('foo,bar,baz'), ','), [], schema()),
);
}
@@ -39,7 +39,7 @@ public function test_split_string_with_limit(): void
{
static::assertSame(
['foo', 'bar,baz'],
- (new FunctionContext(flow_context()))->eval(split(lit('foo,bar,baz'), ',', 2), [], schema()),
+ new FunctionContext(flow_context())->eval(split(lit('foo,bar,baz'), ',', 2), [], schema()),
);
}
@@ -48,7 +48,7 @@ public function test_split_on_null(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Split function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
split(ref('value'), ','),
['value' => null],
schema(str_schema('value', nullable: true)),
@@ -62,7 +62,7 @@ public function test_a_null_separator_is_refused(): void
'Split function requires non-null separator and limit, separator cannot be empty (row 0)',
);
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->split(ref('separator')),
['value' => 'a,b', 'separator' => null],
schema(str_schema('value'), str_schema('separator', nullable: true)),
@@ -76,7 +76,7 @@ public function test_a_null_limit_is_refused(): void
'Split function requires non-null separator and limit, separator cannot be empty (row 0)',
);
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->split(',', ref('limit')),
['value' => 'a,b', 'limit' => null],
schema(str_schema('value'), int_schema('limit', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SprintfTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SprintfTest.php
index 35f70eec10..6de0a9d76b 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SprintfTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SprintfTest.php
@@ -27,12 +27,12 @@ public function test_sprintf_expression_on_invalid_format(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Expected type "string", got "integer".');
- (new FunctionContext(flow_context()))->eval(sprintf(lit(1), lit('John'), lit(25)), [], schema());
+ new FunctionContext(flow_context())->eval(sprintf(lit(1), lit('John'), lit(25)), [], schema());
}
public function test_sprintf_expression_on_valid_format_and_args(): void
{
- static::assertSame('Hello, John! Your age is 25.', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('Hello, John! Your age is 25.', new FunctionContext(flow_context())->eval(
sprintf(lit('Hello, %s! Your age is %d.'), lit('John'), lit(25)),
[],
schema(),
@@ -41,13 +41,13 @@ public function test_sprintf_expression_on_valid_format_and_args(): void
public function test_a_plain_string_value_is_formatted(): void
{
- static::assertSame('x', (new FunctionContext(flow_context()))->eval(sprintf('%s', 'x'), [], schema()));
+ static::assertSame('x', new FunctionContext(flow_context())->eval(sprintf('%s', 'x'), [], schema()));
}
public function test_children_are_the_format_and_every_value_as_a_list(): void
{
static::assertSame([0, 1, 2], array_keys(sprintf('%s%s', 'a', 'b')->children()));
- static::assertSame([0, 1], array_keys((new Sprintf('%s', ...['a' => 'x']))->children()));
+ static::assertSame([0, 1], array_keys(new Sprintf('%s', ...['a' => 'x'])->children()));
}
public function test_a_null_value_is_refused(): void
@@ -55,7 +55,7 @@ public function test_a_null_value_is_refused(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Sprintf requires non-null format and values');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
sprintf(lit('%s'), ref('value')),
['value' => null],
schema(str_schema('value', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StartsWithTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StartsWithTest.php
index 3523e0aa72..31d224954c 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StartsWithTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StartsWithTest.php
@@ -26,7 +26,7 @@ public function test_a_column_needle(): void
{
static::assertSame(
[false, null, null, true, true, false, false],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
ref('h')->startsWith(ref('n')),
[
@@ -48,7 +48,7 @@ public function test_a_literal_needle(): void
{
static::assertSame(
[false, null, false, false, false, false, true],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
ref('h')->startsWith(lit('x')),
[
@@ -68,7 +68,7 @@ public function test_a_literal_needle(): void
public function test_the_result_is_a_boolean_column(): void
{
- $column = (new FunctionContext(flow_context()))->column(
+ $column = new FunctionContext(flow_context())->column(
ref('h')->startsWith(ref('n')),
[
['h' => 'abcx', 'n' => 'x'],
@@ -87,7 +87,7 @@ public function test_an_empty_batch_gives_an_empty_column(): void
{
static::assertSame(
[],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(ref('h')->startsWith(lit('x')), [], schema(str_schema('h', nullable: true)))
->values(),
);
@@ -96,7 +96,7 @@ public function test_an_empty_batch_gives_an_empty_column(): void
public function test_a_haystack_that_is_not_a_string_is_refused_with_its_row(): void
{
try {
- (new FunctionContext(flow_context()))->column(
+ new FunctionContext(flow_context())->column(
ref('i')->startsWith(lit('1')),
[['i' => null], ['i' => 12]],
schema(int_schema('i', nullable: true)),
@@ -112,7 +112,7 @@ public function test_a_haystack_that_is_not_a_string_is_refused_with_its_row():
public function test_a_needle_that_is_not_a_string_is_refused_with_its_row(): void
{
try {
- (new FunctionContext(flow_context()))->column(
+ new FunctionContext(flow_context())->column(
ref('h')->startsWith(ref('i')),
[['h' => 'a1', 'i' => 1]],
schema(str_schema('h'), int_schema('i')),
@@ -129,7 +129,7 @@ public function test_string_columns_are_matched_by_the_backend_without_a_builder
{
$schema = schema(str_schema('h'), str_schema('n'));
$backend = new SpyBackend();
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(ref('h')->startsWith(ref('n')), $schema)
->eval(array_to_rows([['h' => 'ax', 'n' => 'x']], $schema, new PhpBackend()), $backend);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StrPadTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StrPadTest.php
index c11a113aa0..b04281d2d0 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StrPadTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StrPadTest.php
@@ -19,7 +19,7 @@ final class StrPadTest extends FlowTestCase
{
public function test_str_pad_on_valid_string(): void
{
- static::assertSame('----N', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('----N', new FunctionContext(flow_context())->eval(
ref('value')->strPad(5, '-', STR_PAD_LEFT),
['value' => 'N'],
schema(str_schema('value')),
@@ -31,7 +31,7 @@ public function test_str_pad_on_null(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('StrPad function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->strPad(5, '-', STR_PAD_LEFT),
['value' => null],
schema(str_schema('value', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StrReplaceTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StrReplaceTest.php
index 5f71f39e1a..66219a7518 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StrReplaceTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StrReplaceTest.php
@@ -18,7 +18,7 @@ final class StrReplaceTest extends FlowTestCase
{
public function test_str_replace_on_valid_string(): void
{
- static::assertSame('1', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('1', new FunctionContext(flow_context())->eval(
ref('value')->strReplace('test', '1'),
['value' => 'test'],
schema(str_schema('value')),
@@ -27,7 +27,7 @@ public function test_str_replace_on_valid_string(): void
public function test_str_replace_on_valid_string_with_array_of_replacements(): void
{
- static::assertSame('test was successful', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('test was successful', new FunctionContext(flow_context())->eval(
ref('value')->strReplace(['is', 'broken'], ['was', 'successful']),
['value' => 'test is broken'],
schema(str_schema('value')),
@@ -39,7 +39,7 @@ public function test_str_replace_on_null(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('StrReplace function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->strReplace('test', '1'),
['value' => null],
schema(str_schema('value', nullable: true)),
@@ -51,7 +51,7 @@ public function test_a_null_search_is_refused(): void
$this->expectException(EvaluationException::class);
$this->expectExceptionMessage('StrReplace function requires non-null search and replace (row 0)');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->strReplace(ref('search'), 'x'),
['value' => 'abc', 'search' => null],
schema(str_schema('value'), str_schema('search', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringAfterLastTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringAfterLastTest.php
index 0c36dc6d88..4055480e2d 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringAfterLastTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringAfterLastTest.php
@@ -18,7 +18,7 @@ final class StringAfterLastTest extends FlowTestCase
{
public function test_string_after_last(): void
{
- static::assertSame('rld', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('rld', new FunctionContext(flow_context())->eval(
ref('str')->stringAfterLast(ref('needle')),
['str' => 'hello world', 'needle' => 'o'],
schema(str_schema('str'), str_schema('needle')),
@@ -27,7 +27,7 @@ public function test_string_after_last(): void
public function test_the_needle_is_excluded_by_default(): void
{
- static::assertSame('c', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('c', new FunctionContext(flow_context())->eval(
ref('str')->stringAfterLast('.'),
['str' => 'a.b.c'],
schema(str_schema('str')),
@@ -36,7 +36,7 @@ public function test_the_needle_is_excluded_by_default(): void
public function test_a_null_include_needle_excludes_the_needle(): void
{
- static::assertSame('c', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('c', new FunctionContext(flow_context())->eval(
ref('str')->stringAfterLast('.', ref('include')),
['str' => 'a.b.c', 'include' => null],
schema(str_schema('str'), bool_schema('include', nullable: true)),
@@ -45,7 +45,7 @@ public function test_a_null_include_needle_excludes_the_needle(): void
public function test_string_after_last_including_needle(): void
{
- static::assertSame('orld', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('orld', new FunctionContext(flow_context())->eval(
ref('str')->stringAfterLast(ref('needle'), includeNeedle: true),
['str' => 'hello world', 'needle' => 'o'],
schema(str_schema('str'), str_schema('needle')),
@@ -57,7 +57,7 @@ public function test_string_after_last_throws_on_null_input(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('StringAfterLast function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->stringAfterLast('x'),
['str' => null],
schema(str_schema('str', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringAfterTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringAfterTest.php
index 6ab1e00693..99d4d2f9dd 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringAfterTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringAfterTest.php
@@ -18,13 +18,13 @@ final class StringAfterTest extends FlowTestCase
{
public function test_string_after(): void
{
- static::assertSame(' world', (new FunctionContext(flow_context()))->eval(
+ static::assertSame(' world', new FunctionContext(flow_context())->eval(
ref('str')->stringAfter(ref('needle')),
['str' => 'hello world', 'needle' => 'hello'],
schema(str_schema('str'), str_schema('needle')),
));
- static::assertSame(' world', (new FunctionContext(flow_context()))->eval(
+ static::assertSame(' world', new FunctionContext(flow_context())->eval(
ref('str')->stringAfter(ref('needle')),
['str' => 'hello world', 'needle' => 'o'],
schema(str_schema('str'), str_schema('needle')),
@@ -33,7 +33,7 @@ public function test_string_after(): void
public function test_the_needle_is_excluded_by_default(): void
{
- static::assertSame('b', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('b', new FunctionContext(flow_context())->eval(
ref('str')->stringAfter('.'),
['str' => 'a.b'],
schema(str_schema('str')),
@@ -42,7 +42,7 @@ public function test_the_needle_is_excluded_by_default(): void
public function test_a_null_include_needle_excludes_the_needle(): void
{
- static::assertSame('b', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('b', new FunctionContext(flow_context())->eval(
ref('str')->stringAfter('.', ref('include')),
['str' => 'a.b', 'include' => null],
schema(str_schema('str'), bool_schema('include', nullable: true)),
@@ -51,7 +51,7 @@ public function test_a_null_include_needle_excludes_the_needle(): void
public function test_string_after_including_needle(): void
{
- static::assertSame('o world', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('o world', new FunctionContext(flow_context())->eval(
ref('str')->stringAfter(ref('needle'), includeNeedle: true),
['str' => 'hello world', 'needle' => 'o'],
schema(str_schema('str'), str_schema('needle')),
@@ -63,7 +63,7 @@ public function test_string_after_throws_on_null_input(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('StringAfter function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->stringAfter('x'),
['str' => null],
schema(str_schema('str', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringBeforeLastTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringBeforeLastTest.php
index abbe163396..e818eff821 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringBeforeLastTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringBeforeLastTest.php
@@ -18,7 +18,7 @@ final class StringBeforeLastTest extends FlowTestCase
{
public function test_string_before_last_with_null_include_needle_excludes_the_needle(): void
{
- static::assertSame('a.b', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('a.b', new FunctionContext(flow_context())->eval(
ref('str')->stringBeforeLast('.', ref('include_needle')),
['str' => 'a.b.c', 'include_needle' => null],
schema(str_schema('str'), bool_schema('include_needle', nullable: true)),
@@ -27,7 +27,7 @@ public function test_string_before_last_with_null_include_needle_excludes_the_ne
public function test_string_before_last(): void
{
- static::assertSame('hello w', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('hello w', new FunctionContext(flow_context())->eval(
ref('str')->stringBeforeLast(ref('needle')),
['str' => 'hello world', 'needle' => 'o'],
schema(str_schema('str'), str_schema('needle')),
@@ -36,7 +36,7 @@ public function test_string_before_last(): void
public function test_string_before_last_including_needle(): void
{
- static::assertSame('hello wo', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('hello wo', new FunctionContext(flow_context())->eval(
ref('str')->stringBeforeLast(ref('needle'), includeNeedle: true),
['str' => 'hello world', 'needle' => 'o'],
schema(str_schema('str'), str_schema('needle')),
@@ -45,7 +45,7 @@ public function test_string_before_last_including_needle(): void
public function test_string_before_last_returns_empty_string(): void
{
- static::assertSame('', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('', new FunctionContext(flow_context())->eval(
ref('str')->stringBeforeLast(ref('needle')),
['str' => '', 'needle' => 'o'],
schema(str_schema('str'), str_schema('needle')),
@@ -57,7 +57,7 @@ public function test_string_before_last_throws_on_null_input(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('StringBeforeLast function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->stringBeforeLast(ref('needle')),
['str' => null, 'needle' => 'o'],
schema(str_schema('str', nullable: true), str_schema('needle')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringBeforeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringBeforeTest.php
index 656deac1d8..e455af044c 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringBeforeTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringBeforeTest.php
@@ -18,7 +18,7 @@ final class StringBeforeTest extends FlowTestCase
{
public function test_string_before_with_null_include_needle_excludes_the_needle(): void
{
- static::assertSame('a', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('a', new FunctionContext(flow_context())->eval(
ref('str')->stringBefore('.', ref('include_needle')),
['str' => 'a.b', 'include_needle' => null],
schema(str_schema('str'), bool_schema('include_needle', nullable: true)),
@@ -27,13 +27,13 @@ public function test_string_before_with_null_include_needle_excludes_the_needle(
public function test_string_before(): void
{
- static::assertSame('hello ', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('hello ', new FunctionContext(flow_context())->eval(
ref('str')->stringBefore(ref('needle')),
['str' => 'hello world', 'needle' => 'world'],
schema(str_schema('str'), str_schema('needle')),
));
- static::assertSame('hell', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('hell', new FunctionContext(flow_context())->eval(
ref('str')->stringBefore(ref('needle')),
['str' => 'hello world', 'needle' => 'o'],
schema(str_schema('str'), str_schema('needle')),
@@ -42,7 +42,7 @@ public function test_string_before(): void
public function test_string_before_including_needle(): void
{
- static::assertSame('hello', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('hello', new FunctionContext(flow_context())->eval(
ref('str')->stringBefore(ref('needle'), includeNeedle: true),
['str' => 'hello world', 'needle' => 'o'],
schema(str_schema('str'), str_schema('needle')),
@@ -51,7 +51,7 @@ public function test_string_before_including_needle(): void
public function test_string_before_returns_empty_string(): void
{
- static::assertSame('', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('', new FunctionContext(flow_context())->eval(
ref('str')->stringBefore(ref('needle')),
['str' => '', 'needle' => 'o'],
schema(str_schema('str'), str_schema('needle')),
@@ -63,7 +63,7 @@ public function test_string_before_throws_on_null_input(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('StringBefore function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->stringBefore(ref('needle')),
['str' => null, 'needle' => 'o'],
schema(str_schema('str', nullable: true), str_schema('needle')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringContainsAnyTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringContainsAnyTest.php
index 84eac506b5..79dc91acf8 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringContainsAnyTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringContainsAnyTest.php
@@ -27,7 +27,7 @@ public function test_a_null_row_does_not_stop_later_rows(): void
static::assertSame(
[null, true],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(ref('str')->stringContainsAny(['b']), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
@@ -39,7 +39,7 @@ public function test_contains_any_empty_needles_array(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('StringContainsAny function requires a non-empty needles array');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->stringContainsAny([]),
['str' => 'hello world'],
schema(str_schema('str')),
@@ -48,7 +48,7 @@ public function test_contains_any_empty_needles_array(): void
public function test_contains_any_multiple_needles_one_found(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('str')->stringContainsAny(['foo', 'world', 'bar']),
['str' => 'hello world'],
schema(str_schema('str')),
@@ -57,7 +57,7 @@ public function test_contains_any_multiple_needles_one_found(): void
public function test_contains_any_no_needles_found(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
ref('str')->stringContainsAny(['foo', 'bar', 'baz']),
['str' => 'hello world'],
schema(str_schema('str')),
@@ -66,7 +66,7 @@ public function test_contains_any_no_needles_found(): void
public function test_contains_any_null_needles(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('str')->stringContainsAny(ref('needles')),
['str' => 'hello world', 'needles' => null],
schema(str_schema('str'), str_schema('needles', nullable: true)),
@@ -75,7 +75,7 @@ public function test_contains_any_null_needles(): void
public function test_contains_any_null_string(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('str')->stringContainsAny(['hello', 'world']),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -84,7 +84,7 @@ public function test_contains_any_null_string(): void
public function test_contains_any_null_string_in_strict_mode(): void
{
- static::assertNull((new FunctionContext(flow_context(config())))->eval(
+ static::assertNull(new FunctionContext(flow_context(config()))->eval(
ref('str')->stringContainsAny(['hello', 'world']),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -93,7 +93,7 @@ public function test_contains_any_null_string_in_strict_mode(): void
public function test_contains_any_with_scalar_function_parameter(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('str')->stringContainsAny(ref('needles')),
['str' => 'hello world', 'needles' => ['world', 'foo']],
schema(str_schema('str'), list_schema('needles', type_list(type_string()))),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringEqualsToTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringEqualsToTest.php
index a296428614..3b12cd9f2c 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringEqualsToTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringEqualsToTest.php
@@ -22,7 +22,7 @@ public function test_a_null_row_does_not_stop_later_rows(): void
static::assertSame(
[null, true],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(ref('str')->stringEqualsTo('abc'), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
@@ -31,7 +31,7 @@ public function test_a_null_row_does_not_stop_later_rows(): void
public function test_equals_to_empty_strings(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('str')->stringEqualsTo(''),
['str' => ''],
schema(str_schema('str')),
@@ -40,7 +40,7 @@ public function test_equals_to_empty_strings(): void
public function test_equals_to_exact_match(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('str')->stringEqualsTo('hello'),
['str' => 'hello'],
schema(str_schema('str')),
@@ -49,7 +49,7 @@ public function test_equals_to_exact_match(): void
public function test_equals_to_no_match(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
ref('str')->stringEqualsTo('world'),
['str' => 'hello'],
schema(str_schema('str')),
@@ -58,7 +58,7 @@ public function test_equals_to_no_match(): void
public function test_equals_to_null_comparison_string_returns_null(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('str')->stringEqualsTo(ref('compare')),
['str' => 'hello', 'compare' => null],
schema(str_schema('str'), str_schema('compare', nullable: true)),
@@ -67,7 +67,7 @@ public function test_equals_to_null_comparison_string_returns_null(): void
public function test_equals_to_null_string_returns_null(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('str')->stringEqualsTo('hello'),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -76,7 +76,7 @@ public function test_equals_to_null_string_returns_null(): void
public function test_equals_to_with_scalar_function_parameter(): void
{
- static::assertTrue((new FunctionContext(flow_context()))->eval(
+ static::assertTrue(new FunctionContext(flow_context())->eval(
ref('str')->stringEqualsTo(ref('compare')),
['str' => 'hello', 'compare' => 'hello'],
schema(str_schema('str'), str_schema('compare')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringFoldTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringFoldTest.php
index 45dbb6858d..18438c9be6 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringFoldTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringFoldTest.php
@@ -17,7 +17,7 @@ final class StringFoldTest extends FlowTestCase
{
public function test_string_folded(): void
{
- static::assertSame("die o'brian strasse", (new FunctionContext(flow_context()))->eval(
+ static::assertSame("die o'brian strasse", new FunctionContext(flow_context())->eval(
ref('str')->stringFold(),
['str' => "Die O'Brian Straße"],
schema(str_schema('str')),
@@ -29,7 +29,7 @@ public function test_string_fold_throws_on_null_input(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('StringFold function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->stringFold(),
['str' => null],
schema(str_schema('str', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringMatchAllTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringMatchAllTest.php
index 2d0f81764e..a791325c36 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringMatchAllTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringMatchAllTest.php
@@ -19,7 +19,7 @@ public function test_empty_haystack_string(): void
{
static::assertEquals(
[],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->stringMatchAll('/hello/'),
['str' => ''],
schema(str_schema('str')),
@@ -31,7 +31,7 @@ public function test_multiple_successful_pattern_matches(): void
{
static::assertEquals(
[['123'], ['456'], ['789']],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->stringMatchAll('/\d+/'),
['str' => 'test 123 and 456 and 789'],
schema(str_schema('str')),
@@ -43,7 +43,7 @@ public function test_no_matches_found(): void
{
static::assertEquals(
[],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->stringMatchAll('/foo/'),
['str' => 'hello world'],
schema(str_schema('str')),
@@ -56,7 +56,7 @@ public function test_null_haystack(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('StringMatchAll function requires non-null haystack');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->stringMatchAll('/hello/'),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -68,7 +68,7 @@ public function test_null_pattern(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('StringMatchAll function requires non-null pattern');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->stringMatchAll(ref('pattern')),
['str' => 'hello world', 'pattern' => null],
schema(str_schema('str'), str_schema('pattern', nullable: true)),
@@ -79,7 +79,7 @@ public function test_with_scalar_function_parameter(): void
{
static::assertEquals(
[['123'], ['456']],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->stringMatchAll(ref('pattern')),
['str' => 'test 123 and 456', 'pattern' => '/\d+/'],
schema(str_schema('str'), str_schema('pattern')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringMatchTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringMatchTest.php
index 286fb58e90..e17ffa9f2f 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringMatchTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringMatchTest.php
@@ -19,7 +19,7 @@ final class StringMatchTest extends FlowTestCase
{
public function test_no_matches_found(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('str')->stringMatch('/foo/'),
['str' => 'hello world'],
schema(str_schema('str')),
@@ -31,7 +31,7 @@ public function test_null_haystack(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('StringMatch function requires non-null haystack');
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('str')->stringMatch('/hello/'),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -43,7 +43,7 @@ public function test_null_pattern(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('StringMatch function requires non-null pattern');
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('str')->stringMatch(ref('pattern')),
['str' => 'hello world', 'pattern' => null],
schema(str_schema('str'), str_schema('pattern', nullable: true)),
@@ -53,7 +53,7 @@ public function test_null_pattern(): void
public function test_an_invalid_pattern_keeps_the_regex_error_as_the_cause(): void
{
try {
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->stringMatch(lit('/(/')),
['value' => 'abc'],
schema(str_schema('value')),
@@ -69,7 +69,7 @@ public function test_successful_pattern_match(): void
{
static::assertEquals(
['hello'],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->stringMatch('/hello/'),
['str' => 'hello world'],
schema(str_schema('str')),
@@ -81,7 +81,7 @@ public function test_with_scalar_function_parameter(): void
{
static::assertEquals(
['world'],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->stringMatch(ref('pattern')),
['str' => 'hello world', 'pattern' => '/world/'],
schema(str_schema('str'), str_schema('pattern')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringNormalizeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringNormalizeTest.php
index bd2d8ce5f6..71957a6a6c 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringNormalizeTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringNormalizeTest.php
@@ -22,7 +22,7 @@ public function test_a_malformed_form_operand_throws(): void
{
$this->expectException(InvalidArgumentException::class);
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->stringNormalize(lit('not-a-form')),
['value' => 'abc'],
schema(str_schema('value')),
@@ -31,7 +31,7 @@ public function test_a_malformed_form_operand_throws(): void
public function test_normalize_already_normalized(): void
{
- static::assertSame('hello', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('hello', new FunctionContext(flow_context())->eval(
ref('str')->stringNormalize(Normalizer::NFC),
['str' => 'hello'],
schema(str_schema('str')),
@@ -40,7 +40,7 @@ public function test_normalize_already_normalized(): void
public function test_normalize_empty_string(): void
{
- static::assertSame('', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('', new FunctionContext(flow_context())->eval(
ref('str')->stringNormalize(),
['str' => ''],
schema(str_schema('str')),
@@ -49,7 +49,7 @@ public function test_normalize_empty_string(): void
public function test_normalize_nfc_default(): void
{
- static::assertSame('é', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('é', new FunctionContext(flow_context())->eval(
ref('str')->stringNormalize(),
['str' => "e\u{0301}"],
schema(str_schema('str')),
@@ -58,7 +58,7 @@ public function test_normalize_nfc_default(): void
public function test_normalize_nfc_explicit(): void
{
- static::assertSame('é', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('é', new FunctionContext(flow_context())->eval(
ref('str')->stringNormalize(Normalizer::NFC),
['str' => "e\u{0301}"],
schema(str_schema('str')),
@@ -67,7 +67,7 @@ public function test_normalize_nfc_explicit(): void
public function test_normalize_nfd(): void
{
- static::assertSame("e\u{0301}", (new FunctionContext(flow_context()))->eval(
+ static::assertSame("e\u{0301}", new FunctionContext(flow_context())->eval(
ref('str')->stringNormalize(Normalizer::NFD),
['str' => 'é'],
schema(str_schema('str')),
@@ -79,7 +79,7 @@ public function test_normalize_throws_on_null_input(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('StringNormalize function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->stringNormalize(),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -88,7 +88,7 @@ public function test_normalize_throws_on_null_input(): void
public function test_normalize_with_scalar_function_form(): void
{
- static::assertSame('é', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('é', new FunctionContext(flow_context())->eval(
ref('str')->stringNormalize(ref('form')),
['str' => "e\u{0301}", 'form' => Normalizer::NFC],
schema(str_schema('str'), int_schema('form')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringStyleTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringStyleTest.php
index 38e45ade7a..7cec290092 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringStyleTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringStyleTest.php
@@ -23,7 +23,7 @@ public function test_a_null_value_throws(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('StringStyle function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->stringStyle(StringStyles::LOWER),
['value' => null],
schema(str_schema('value', nullable: true)),
@@ -100,7 +100,7 @@ public function test_all_lists_every_style_value(): void
public function test_string_style_camel(): void
{
- static::assertSame('fooBarBaz', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('fooBarBaz', new FunctionContext(flow_context())->eval(
ref('str')->stringStyle(ref('style')),
['str' => 'Foo: Bar-baz.', 'style' => 'camel'],
schema(str_schema('str'), str_schema('style')),
@@ -109,7 +109,7 @@ public function test_string_style_camel(): void
public function test_string_style_kebab(): void
{
- static::assertSame('foo-bar-baz', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('foo-bar-baz', new FunctionContext(flow_context())->eval(
ref('str')->stringStyle('kebab'),
['str' => 'Foo: Bar-baz.'],
schema(str_schema('str')),
@@ -118,7 +118,7 @@ public function test_string_style_kebab(): void
public function test_string_style_lower(): void
{
- static::assertSame('foo bar bri̇an', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('foo bar bri̇an', new FunctionContext(flow_context())->eval(
ref('str')->stringStyle('lower'),
['str' => 'FOO Bar Brİan'],
schema(str_schema('str')),
@@ -128,7 +128,7 @@ public function test_string_style_lower(): void
#[DataProvider('provideStringStyles')]
public function test_string_styles(StringStyles $style, ?string $value, ?string $expected): void
{
- static::assertSame($expected, (new FunctionContext(flow_context()))->eval(
+ static::assertSame($expected, new FunctionContext(flow_context())->eval(
ref('str')->stringStyle($style),
['str' => $value],
schema(str_schema('str', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringTitleTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringTitleTest.php
index e9bba320b3..dd57918fc0 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringTitleTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringTitleTest.php
@@ -18,7 +18,7 @@ final class StringTitleTest extends FlowTestCase
{
public function test_string_title_with_null_all_words_changes_only_the_first_word(): void
{
- static::assertSame('Hello world', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('Hello world', new FunctionContext(flow_context())->eval(
ref('str')->stringTitle(ref('all_words')),
['str' => 'hello world', 'all_words' => null],
schema(str_schema('str'), bool_schema('all_words', nullable: true)),
@@ -27,7 +27,7 @@ public function test_string_title_with_null_all_words_changes_only_the_first_wor
public function test_string_title(): void
{
- static::assertSame('Foo ijssel', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('Foo ijssel', new FunctionContext(flow_context())->eval(
ref('str')->stringTitle(),
['str' => 'foo ijssel'],
schema(str_schema('str')),
@@ -36,7 +36,7 @@ public function test_string_title(): void
public function test_string_title_allwords(): void
{
- static::assertSame('Foo Ijssel', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('Foo Ijssel', new FunctionContext(flow_context())->eval(
ref('str')->stringTitle(allWords: true),
['str' => 'foo ijssel'],
schema(str_schema('str')),
@@ -48,7 +48,7 @@ public function test_string_title_throws_on_null_input(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('StringTitle function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->stringTitle(),
['str' => null],
schema(str_schema('str', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringWidthTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringWidthTest.php
index df6ae561f2..309da28778 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringWidthTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringWidthTest.php
@@ -17,7 +17,7 @@ final class StringWidthTest extends FlowTestCase
{
public function test_width_ascii_string(): void
{
- static::assertSame(5, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(5, new FunctionContext(flow_context())->eval(
ref('str')->stringWidth(),
['str' => 'hello'],
schema(str_schema('str')),
@@ -26,7 +26,7 @@ public function test_width_ascii_string(): void
public function test_width_empty_string(): void
{
- static::assertSame(0, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(0, new FunctionContext(flow_context())->eval(
ref('str')->stringWidth(),
['str' => ''],
schema(str_schema('str')),
@@ -38,7 +38,7 @@ public function test_width_throws_on_null_input(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('StringWidth function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->stringWidth(),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -47,7 +47,7 @@ public function test_width_throws_on_null_input(): void
public function test_width_single_character(): void
{
- static::assertSame(1, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(1, new FunctionContext(flow_context())->eval(
ref('str')->stringWidth(),
['str' => 'a'],
schema(str_schema('str')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StructureSelectTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StructureSelectTest.php
index 1ca9a90aa8..7a78e0302e 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StructureSelectTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StructureSelectTest.php
@@ -31,7 +31,7 @@ public function test_selecting_multiple_values_from_structure(): void
{
static::assertEquals(
['id' => 1, 'name' => 'test'],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
new StructureSelect(ref('struct'), ref('id'), ref('name')),
['struct' => [
'id' => 1,
@@ -46,7 +46,7 @@ public function test_selecting_single_value_from_structure(): void
{
static::assertEquals(
['id' => 1],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
new StructureSelect(ref('struct'), 'id'),
['struct' => [
'id' => 1,
@@ -61,7 +61,7 @@ public function test_selecting_single_value_from_structure_with_alias(): void
{
static::assertEquals(
['new_id' => 1],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
new StructureSelect(ref('struct'), ref('id')->as('new_id')),
['struct' => [
'id' => 1,
@@ -76,7 +76,7 @@ public function test_selecting_values_from_empty_structure(): void
{
static::assertEquals(
['new_id' => null],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
new StructureSelect(ref('struct'), ref('id')->as('new_id')),
['struct' => [
'id' => null,
@@ -95,7 +95,7 @@ public function test_selecting_values_from_empty_structure(): void
public function test_a_non_structure_operand_is_refused_at_bind(): void
{
/** @var ScalarFunction $resolved */
- $resolved = (new ReferenceResolver())->resolve(
+ $resolved = new ReferenceResolver()->resolve(
new StructureSelect(ref('list'), ref('id')),
schema(list_schema(
'list',
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StructureTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StructureTest.php
index d2af8469c2..ba945bd022 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StructureTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StructureTest.php
@@ -31,7 +31,7 @@ public function test_eval_preserves_key_order(): void
{
static::assertSame(
['second' => 'x', 'first' => 1],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
structure(['second' => ref('b'), 'first' => ref('a')]),
[
'a' => 1,
@@ -47,7 +47,7 @@ public function test_eval_keeps_null_under_its_key(): void
{
static::assertSame(
['id' => 'x', 'quantity' => null],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
structure(['id' => ref('b'), 'quantity' => ref('q')]),
[
'a' => 1,
@@ -63,7 +63,7 @@ public function test_eval_with_numeric_keys(): void
{
static::assertSame(
[5 => 1, 7 => 'x'],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
structure([5 => ref('a'), 7 => ref('b')]),
['a' => 1, 'b' => 'x', 'q' => null],
schema(int_schema('a'), str_schema('b'), str_schema('q', nullable: true)),
@@ -85,7 +85,7 @@ public function test_eval_nested_structure(): void
{
static::assertSame(
['user' => ['id' => 1]],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
structure(['user' => structure(['id' => ref('a')])]),
[
'a' => 1,
@@ -101,7 +101,7 @@ public function test_returns_carries_element_types_and_nullability(): void
{
static::assertSame(
'structure{id: string, quantity: ?integer}',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(
structure(['id' => ref('line_id'), 'quantity' => ref('quantity')]),
schema(str_schema('line_id'), int_schema('quantity', nullable: true)),
@@ -113,7 +113,7 @@ public function test_returns_carries_element_types_and_nullability(): void
public function test_returns_is_never_nullable(): void
{
- $returns = (new ReferenceResolver())
+ $returns = new ReferenceResolver()
->resolve(
structure(['id' => ref('line_id'), 'quantity' => ref('quantity')]),
schema(str_schema('line_id', true), int_schema('quantity', true)),
@@ -128,7 +128,7 @@ public function test_returns_with_numeric_keys(): void
{
static::assertSame(
'structure{5: integer, 7: string}',
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(structure([5 => ref('a'), 7 => ref('b')]), schema(int_schema('a'), str_schema('b')))
->returns()
->toString(),
@@ -147,7 +147,7 @@ public function test_with_children_keeps_keys(): void
{
static::assertSame(
['id' => 1, 'name' => 'x'],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
structure(['id' => ref('a'), 'name' => ref('b')])->withChildren([lit(1), lit('x')]),
['a' => 1, 'b' => 'x', 'q' => null],
schema(int_schema('a'), str_schema('b'), str_schema('q', nullable: true)),
@@ -177,7 +177,7 @@ public function test_resolved_only_after_every_element_resolves(): void
static::assertFalse($function->resolved());
static::assertTrue(
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve($function, schema(str_schema('line_id'), int_schema('quantity', nullable: true)))
->resolved(),
);
@@ -205,6 +205,6 @@ public function test_a_description_rebuilds_through_the_constructor_checks(): vo
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Structure keys cannot be a list');
- (new Rebuild())->of($data, ScalarFunction::class);
+ new Rebuild()->of($data, ScalarFunction::class);
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TemporalStringCoercionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TemporalStringCoercionTest.php
index 346205d12e..bc943fe6ec 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TemporalStringCoercionTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TemporalStringCoercionTest.php
@@ -80,12 +80,12 @@ public function test_a_string_operand_is_cast_to_the_temporal_operand(
): void {
static::assertSame($expected, array_map(static fn(ScalarFunction $operand): string => $operand
->returns()
- ->toString(), type_instance_of(ComparisonFunction::class)->assert((new TemporalStringCoercion())->coerce($predicate))->operands()));
+ ->toString(), type_instance_of(ComparisonFunction::class)->assert(new TemporalStringCoercion()->coerce($predicate))->operands()));
}
#[DataProvider('untouched')]
public function test_the_function_is_returned_as_it_is(ScalarFunction $predicate): void
{
- static::assertSame($predicate, (new TemporalStringCoercion())->coerce($predicate));
+ static::assertSame($predicate, new TemporalStringCoercion()->coerce($predicate));
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToDateTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToDateTest.php
index 2730447faf..afd7bde24e 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToDateTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToDateTest.php
@@ -27,7 +27,7 @@ public function test_null_value_is_refused(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ToDate function requires non-null values');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
to_date(ref('value')),
['value' => null],
schema(str_schema('value', nullable: true)),
@@ -39,7 +39,7 @@ public function test_null_format_is_refused(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ToDate function requires non-null values');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
to_date(ref('value'), ref('format')),
['value' => '2024-01-01', 'format' => null],
schema(str_schema('value'), str_schema('format', nullable: true)),
@@ -55,7 +55,7 @@ public function test_string_rows_are_all_converted(): void
new DateTimeImmutable('2024-01-01 00:00:00', new DateTimeZone('UTC')),
new DateTimeImmutable('2024-01-02 00:00:00', new DateTimeZone('UTC')),
],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(to_date(ref('value')), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
@@ -71,7 +71,7 @@ public function test_int_rows_are_all_converted(): void
new DateTimeImmutable('2024-01-01 00:00:00', new DateTimeZone('UTC')),
new DateTimeImmutable('2024-01-02 00:00:00', new DateTimeZone('UTC')),
],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(to_date(ref('value')), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
@@ -90,7 +90,7 @@ public function test_date_time_rows_are_all_converted(): void
new DateTimeImmutable('2024-01-01 00:00:00', new DateTimeZone('UTC')),
new DateTimeImmutable('2024-01-02 00:00:00', new DateTimeZone('UTC')),
],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(to_date(ref('value')), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
@@ -101,7 +101,7 @@ public function test_date_time_to_date(): void
{
static::assertEquals(
new DateTimeImmutable('2020-01-01 00:00:00', new DateTimeZone('UTC')),
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
to_date(ref('date_time')),
['date_time' => new DateTimeImmutable('2020-01-01 12:43:23', new DateTimeZone('UTC'))],
schema(datetime_schema('date_time')),
@@ -113,10 +113,10 @@ public function test_int_to_date_time(): void
{
static::assertEquals(
new DateTimeImmutable('2020-01-01 00:00:00', new DateTimeZone('UTC')),
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
to_date(ref('int')),
[
- 'int' => (int) (new DateTimeImmutable('2020-01-01 10:11:11', new DateTimeZone('UTC')))->format('U'),
+ 'int' => (int) new DateTimeImmutable('2020-01-01 10:11:11', new DateTimeZone('UTC'))->format('U'),
],
schema(int_schema('int')),
),
@@ -127,7 +127,7 @@ public function test_string_to_date_time(): void
{
static::assertEquals(
new DateTimeImmutable('2020-01-01 00:00:00', new DateTimeZone('UTC')),
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
to_date(ref('string'), 'Y-m-d H:i:s'),
[
'string' => '2020-01-01 10:08:00',
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToDateTime/PatternCoverageTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToDateTime/PatternCoverageTest.php
index 1599371802..10fcd2e2f3 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToDateTime/PatternCoverageTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToDateTime/PatternCoverageTest.php
@@ -20,7 +20,7 @@ final class PatternCoverageTest extends FlowTestCase
#[TestWith(['U'])]
public function test_a_pattern_parsing_every_field_or_resetting_them_does_not_read_the_clock(string $pattern): void
{
- static::assertFalse((new PatternCoverage($pattern))->fillsFromClock());
+ static::assertFalse(new PatternCoverage($pattern)->fillsFromClock());
}
#[TestWith(['Y-m-d'])]
@@ -31,7 +31,7 @@ public function test_a_pattern_parsing_every_field_or_resetting_them_does_not_re
#[TestWith(['\U Y-m-d'])]
public function test_a_pattern_leaving_a_field_out_reads_the_clock(string $pattern): void
{
- static::assertTrue((new PatternCoverage($pattern))->fillsFromClock());
+ static::assertTrue(new PatternCoverage($pattern)->fillsFromClock());
}
public function test_any_finds_one_of_the_characters(): void
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToDateTimeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToDateTimeTest.php
index 0d3e4810e1..6fb9faf1ad 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToDateTimeTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToDateTimeTest.php
@@ -42,7 +42,7 @@ public function test_a_null_row_does_not_stop_later_rows(): void
static::assertEquals(
[null, new DateTimeImmutable('2024-01-01 10:20:30', new DateTimeZone('UTC'))],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(to_date_time(ref('value')), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
@@ -61,7 +61,7 @@ public function test_date_time_rows_are_all_converted(): void
new DateTimeImmutable('2024-01-01 10:20:30', new DateTimeZone('UTC')),
new DateTimeImmutable('2024-01-02 10:20:30', new DateTimeZone('UTC')),
],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(to_date_time(ref('value')), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
@@ -77,7 +77,7 @@ public function test_int_rows_are_all_converted(): void
new DateTimeImmutable('2024-01-01 00:00:00', new DateTimeZone('UTC')),
new DateTimeImmutable('2024-01-02 00:00:00', new DateTimeZone('UTC')),
],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(to_date_time(ref('value')), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
@@ -96,7 +96,7 @@ public function test_string_rows_are_all_converted(): void
new DateTimeImmutable('2024-01-01 10:20:30', new DateTimeZone('UTC')),
new DateTimeImmutable('2024-01-02 10:20:30', new DateTimeZone('UTC')),
],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(to_date_time(ref('value')), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
@@ -149,7 +149,7 @@ public function test_date_time_to_date_time(): void
{
static::assertEquals(
new DateTimeImmutable('2020-01-01 00:00:00', new DateTimeZone('UTC')),
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
to_date_time(ref('date_time')),
['date_time' => new DateTimeImmutable('2020-01-01 00:00:00', new DateTimeZone('UTC'))],
schema(datetime_schema('date_time')),
@@ -161,10 +161,10 @@ public function test_int_to_date_time(): void
{
static::assertEquals(
new DateTimeImmutable('2020-01-01 00:00:00', new DateTimeZone('UTC')),
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
to_date_time(ref('int')),
[
- 'int' => (int) (new DateTimeImmutable('2020-01-01 00:00:00', new DateTimeZone('UTC')))->format('U'),
+ 'int' => (int) new DateTimeImmutable('2020-01-01 00:00:00', new DateTimeZone('UTC'))->format('U'),
],
schema(int_schema('int')),
),
@@ -175,7 +175,7 @@ public function test_string_to_date_time(): void
{
static::assertEquals(
new DateTimeImmutable('2020-01-01 00:00:00', new DateTimeZone('UTC')),
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
to_date_time(ref('string'), 'Y-m-d H:i:s'),
[
'string' => '2020-01-01 00:00:00',
@@ -187,7 +187,7 @@ public function test_string_to_date_time(): void
public function test_a_null_value_is_null(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
to_date_time(ref('string'), 'Y-m-d H:i:s'),
[
'string' => null,
@@ -199,7 +199,7 @@ public function test_a_null_value_is_null(): void
public function test_a_null_format_is_refused(): void
{
try {
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
to_date_time(ref('string'), ref('format')),
[
'string' => '2020-01-01',
@@ -218,7 +218,7 @@ public function test_a_null_format_is_refused(): void
public function test_unparseable_string_to_date_time_is_null(): void
{
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
to_date_time(ref('string'), 'Y-m-d H:i:s'),
[
'string' => 'not a datetime',
@@ -240,7 +240,7 @@ public function test_object_keeps_its_time(): void
static::assertSame(
'10:30:00',
type_datetime()
- ->assert((new FunctionContext(flow_context()))->eval(
+ ->assert(new FunctionContext(flow_context())->eval(
to_date_time(ref('at')),
['at' => new DateTimeImmutable('2020-01-01 10:30:00', new DateTimeZone('UTC'))],
schema(datetime_schema('at')),
@@ -254,7 +254,7 @@ public function test_int_lands_in_the_constant_zone(): void
static::assertSame(
'2020-01-01 11:30:00 Europe/Warsaw',
type_datetime()
- ->assert((new FunctionContext(flow_context()))->eval(
+ ->assert(new FunctionContext(flow_context())->eval(
to_date_time(ref('at'), 'Y-m-d H:i:s', new DateTimeZone('Europe/Warsaw')),
[
'at' => 1577874600,
@@ -271,7 +271,7 @@ public function test_mutable_datetime_is_converted_without_mutation(): void
static::assertEquals(
new DateTimeImmutable('2020-01-01 11:30:00', new DateTimeZone('Europe/Warsaw')),
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
to_date_time(ref('at'), 'Y-m-d H:i:s', new DateTimeZone('Europe/Warsaw')),
[
'at' => $value,
@@ -287,7 +287,7 @@ public function test_non_datetime_object_is_refused(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ToDateTime function requires DateTimeInterface object');
- (new FunctionContext(flow_context()))->eval(to_date_time(lit(new stdClass())), [], schema());
+ new FunctionContext(flow_context())->eval(to_date_time(lit(new stdClass())), [], schema());
}
public function test_string_in_a_utc_alias_zone_lands_in_utc(): void
@@ -295,7 +295,7 @@ public function test_string_in_a_utc_alias_zone_lands_in_utc(): void
static::assertSame(
'2020-01-01 10:30:00 UTC',
type_datetime()
- ->assert((new FunctionContext(flow_context()))->eval(
+ ->assert(new FunctionContext(flow_context())->eval(
to_date_time(ref('at'), 'Y-m-d H:i:s', new DateTimeZone('GMT')),
[
'at' => '2020-01-01 10:30:00',
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToLowerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToLowerTest.php
index 97c24aaf7a..8572472ab0 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToLowerTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToLowerTest.php
@@ -19,7 +19,7 @@ final class ToLowerTest extends FlowTestCase
{
public function test_string_to_lower(): void
{
- static::assertSame('lower', (new FunctionContext(flow_context()))->eval(lower(lit('LOWER')), [], schema()));
+ static::assertSame('lower', new FunctionContext(flow_context())->eval(lower(lit('LOWER')), [], schema()));
}
public function test_lower_on_null(): void
@@ -27,7 +27,7 @@ public function test_lower_on_null(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ToLower function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
lower(ref('string')),
['string' => null],
schema(str_schema('string', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToTimeZoneTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToTimeZoneTest.php
index 19b1c03b78..0c648469b5 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToTimeZoneTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToTimeZoneTest.php
@@ -41,7 +41,7 @@ public function test_abbreviation_zone_is_refused(): void
public function test_casting_date_time_pst_to_utc_time_zone(): void
{
// @mago-ignore analysis:mixed-assignment
- $result = (new FunctionContext(flow_context()))->eval(
+ $result = new FunctionContext(flow_context())->eval(
to_timezone(
lit(new DateTimeImmutable('2020-01-01 00:00:00', new DateTimeZone('PST'))),
new DateTimeZone('UTC'),
@@ -56,7 +56,7 @@ public function test_casting_date_time_pst_to_utc_time_zone(): void
public function test_casting_date_time_pst_to_utc_time_zone_from_string_tz(): void
{
// @mago-ignore analysis:mixed-assignment
- $result = (new FunctionContext(flow_context()))->eval(
+ $result = new FunctionContext(flow_context())->eval(
to_timezone(lit(new DateTimeImmutable('2020-01-01 00:00:00', new DateTimeZone('PST'))), 'UTC'),
[],
schema(),
@@ -69,7 +69,7 @@ public function test_does_not_mutate_a_datetime(): void
{
$value = new DateTime('2020-01-01 00:00:00 UTC');
- (new FunctionContext(flow_context()))->eval(to_timezone(lit($value), 'Europe/Warsaw'), [], schema());
+ new FunctionContext(flow_context())->eval(to_timezone(lit($value), 'Europe/Warsaw'), [], schema());
static::assertSame('UTC', $value->getTimezone()->getName());
}
@@ -89,7 +89,7 @@ public function test_null_value_is_refused(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ToTimeZone function requires non-null values');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
to_timezone(ref('at'), 'UTC'),
[
'at' => null,
@@ -114,7 +114,7 @@ public function test_a_null_in_a_datetime_column_is_refused_at_its_row(): void
$this->expectException(EvaluationException::class);
$this->expectExceptionMessage('ToTimeZone function requires non-null values (row 1)');
- (new FunctionContext(flow_context()))->column(
+ new FunctionContext(flow_context())->column(
to_timezone(ref('at'), 'UTC'),
[['at' => new DateTimeImmutable('2026-01-01 00:00:00')], ['at' => null]],
schema(datetime_schema('at', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToUpperTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToUpperTest.php
index e2ef43e760..8a6c980628 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToUpperTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToUpperTest.php
@@ -19,7 +19,7 @@ final class ToUpperTest extends FlowTestCase
{
public function test_string_to_upper(): void
{
- static::assertSame('UPPER', (new FunctionContext(flow_context()))->eval(upper(lit('upper')), [], schema()));
+ static::assertSame('UPPER', new FunctionContext(flow_context())->eval(upper(lit('upper')), [], schema()));
}
public function test_upper_on_null(): void
@@ -27,7 +27,7 @@ public function test_upper_on_null(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('ToUpper function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
upper(ref('string')),
['string' => null],
schema(str_schema('string', nullable: true)),
@@ -36,6 +36,6 @@ public function test_upper_on_null(): void
public function test_multibyte_letters_are_upper_cased(): void
{
- static::assertSame('ŻÓŁW', (new FunctionContext(flow_context()))->eval(upper(lit('żółw')), [], schema()));
+ static::assertSame('ŻÓŁW', new FunctionContext(flow_context())->eval(upper(lit('żółw')), [], schema()));
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TotalsByGroupTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TotalsByGroupTest.php
index dcba239c4d..d98f47ebc0 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TotalsByGroupTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TotalsByGroupTest.php
@@ -33,7 +33,7 @@ public function test_a_sum_and_an_average_over_one_shared_total_read_their_own_v
static::assertSame([3.0, 4.0], $sums->groupValues(2, $backend)->values());
static::assertSame(
[1.5, 4.0],
- (new TotalsByGroup(average(ref('v')), $totals))
+ new TotalsByGroup(average(ref('v')), $totals)
->groupValues(2, $backend)
->values(),
);
@@ -91,8 +91,8 @@ public function test_it_absorbs_only_other_grouped_totals(): void
{
$this->expectException(InvalidArgumentException::class);
- (new TotalsByGroup(sum(ref('v')), (new PhpBackend())->groupedTotals()))->absorbEarlier(
- new CountsByGroup(null, (new PhpBackend())->groupedCounts()),
+ new TotalsByGroup(sum(ref('v')), new PhpBackend()->groupedTotals())->absorbEarlier(
+ new CountsByGroup(null, new PhpBackend()->groupedCounts()),
[],
new PhpBackend(),
);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TrimTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TrimTest.php
index fcb734ff50..b43b83755a 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TrimTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TrimTest.php
@@ -18,7 +18,7 @@ final class TrimTest extends FlowTestCase
{
public function test_trim_both_valid_string(): void
{
- static::assertSame('value', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('value', new FunctionContext(flow_context())->eval(
ref('string')->trim(),
['string' => ' value'],
schema(str_schema('string')),
@@ -27,7 +27,7 @@ public function test_trim_both_valid_string(): void
public function test_trim_left_valid_string(): void
{
- static::assertSame('value ', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('value ', new FunctionContext(flow_context())->eval(
ref('string')->trim(Type::LEFT),
['string' => ' value '],
schema(str_schema('string')),
@@ -36,7 +36,7 @@ public function test_trim_left_valid_string(): void
public function test_trim_right_valid_string(): void
{
- static::assertSame(' value', (new FunctionContext(flow_context()))->eval(
+ static::assertSame(' value', new FunctionContext(flow_context())->eval(
ref('string')->trim(Type::RIGHT),
['string' => ' value '],
schema(str_schema('string')),
@@ -48,7 +48,7 @@ public function test_trim_on_null(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Trim function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('string')->trim(),
['string' => null],
schema(str_schema('string', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TruncateTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TruncateTest.php
index d7770a62cf..8f260e2ae4 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TruncateTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TruncateTest.php
@@ -18,7 +18,7 @@ final class TruncateTest extends FlowTestCase
{
public function test_truncate_ellipsis_longer_than_limit(): void
{
- static::assertSame('hello', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('hello', new FunctionContext(flow_context())->eval(
ref('str')->truncate(5, 'verylongellipsis'),
['str' => 'hello world'],
schema(str_schema('str')),
@@ -27,7 +27,7 @@ public function test_truncate_ellipsis_longer_than_limit(): void
public function test_truncate_empty_string(): void
{
- static::assertSame('', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('', new FunctionContext(flow_context())->eval(
ref('str')->truncate(10),
['str' => ''],
schema(str_schema('str')),
@@ -36,7 +36,7 @@ public function test_truncate_empty_string(): void
public function test_truncate_exact_length(): void
{
- static::assertSame('hello', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('hello', new FunctionContext(flow_context())->eval(
ref('str')->truncate(5),
['str' => 'hello'],
schema(str_schema('str')),
@@ -48,7 +48,7 @@ public function test_truncate_throws_on_null_input(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Truncate function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->truncate(10),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -57,7 +57,7 @@ public function test_truncate_throws_on_null_input(): void
public function test_truncate_string_longer_than_limit(): void
{
- static::assertSame('he...', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('he...', new FunctionContext(flow_context())->eval(
ref('str')->truncate(5),
['str' => 'hello world'],
schema(str_schema('str')),
@@ -66,7 +66,7 @@ public function test_truncate_string_longer_than_limit(): void
public function test_truncate_string_shorter_than_limit(): void
{
- static::assertSame('hello', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('hello', new FunctionContext(flow_context())->eval(
ref('str')->truncate(10),
['str' => 'hello'],
schema(str_schema('str')),
@@ -75,7 +75,7 @@ public function test_truncate_string_shorter_than_limit(): void
public function test_truncate_with_custom_ellipsis(): void
{
- static::assertSame('he***', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('he***', new FunctionContext(flow_context())->eval(
ref('str')->truncate(5, '***'),
['str' => 'hello world'],
schema(str_schema('str')),
@@ -84,7 +84,7 @@ public function test_truncate_with_custom_ellipsis(): void
public function test_truncate_with_length_one(): void
{
- static::assertSame('h', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('h', new FunctionContext(flow_context())->eval(
ref('str')->truncate(1),
['str' => 'hello'],
schema(str_schema('str')),
@@ -93,7 +93,7 @@ public function test_truncate_with_length_one(): void
public function test_truncate_with_length_zero(): void
{
- static::assertSame('', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('', new FunctionContext(flow_context())->eval(
ref('str')->truncate(0),
['str' => 'hello'],
schema(str_schema('str')),
@@ -102,7 +102,7 @@ public function test_truncate_with_length_zero(): void
public function test_truncate_with_negative_length(): void
{
- static::assertSame('hell', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('hell', new FunctionContext(flow_context())->eval(
ref('str')->truncate(-1),
['str' => 'hello'],
schema(str_schema('str')),
@@ -111,7 +111,7 @@ public function test_truncate_with_negative_length(): void
public function test_truncate_with_null_length(): void
{
- static::assertSame('hello world', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('hello world', new FunctionContext(flow_context())->eval(
ref('str')->truncate(ref('length')),
['str' => 'hello world', 'length' => null],
schema(str_schema('str'), str_schema('length', nullable: true)),
@@ -120,7 +120,7 @@ public function test_truncate_with_null_length(): void
public function test_truncate_with_scalar_function_ellipsis(): void
{
- static::assertSame('hel>>', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('hel>>', new FunctionContext(flow_context())->eval(
ref('str')->truncate(5, ref('ellipsis')),
['str' => 'hello world', 'ellipsis' => '>>'],
schema(str_schema('str'), str_schema('ellipsis')),
@@ -129,7 +129,7 @@ public function test_truncate_with_scalar_function_ellipsis(): void
public function test_truncate_with_scalar_function_length(): void
{
- static::assertSame('he...', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('he...', new FunctionContext(flow_context())->eval(
ref('str')->truncate(ref('length')),
['str' => 'hello world', 'length' => 5],
schema(str_schema('str'), int_schema('length')),
@@ -140,7 +140,7 @@ public function test_a_row_without_a_length_keeps_its_value_and_the_next_row_is_
{
static::assertSame(
['hello world', 'he...'],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
ref('str')->truncate(ref('length')),
[['str' => 'hello world', 'length' => null], ['str' => 'hello world', 'length' => 5]],
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UlidTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UlidTest.php
index 0498a55d0c..6c66a0a13b 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UlidTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UlidTest.php
@@ -34,7 +34,7 @@ public function test_ulid_rows_are_all_converted(): void
static::assertSame(
['01ARZ3NDEKTSV4RRFFQ69G5FAV', '01BX5ZZKBKACTAV9WEVGEMMVRZ'],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(ulid(ref('value')), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
@@ -45,13 +45,13 @@ public function test_ulid_produces_a_string_column(): void
{
$expression = ulid();
// @mago-ignore analysis:mixed-assignment
- $result = (new FunctionContext(flow_context()))->eval($expression, [], schema());
+ $result = new FunctionContext(flow_context())->eval($expression, [], schema());
static::assertIsString($result);
static::assertTrue(Ulid::isValid($result));
static::assertNotSame(
- (new FunctionContext(flow_context()))->eval($expression, [], schema()),
- (new FunctionContext(flow_context()))->eval($expression, [], schema()),
+ new FunctionContext(flow_context())->eval($expression, [], schema()),
+ new FunctionContext(flow_context())->eval($expression, [], schema()),
);
}
@@ -60,8 +60,8 @@ public function test_ulid_is_unique(): void
$expression = ulid();
static::assertNotEquals(
- (new FunctionContext(flow_context()))->eval($expression, [], schema()),
- (new FunctionContext(flow_context()))->eval($expression, [], schema()),
+ new FunctionContext(flow_context())->eval($expression, [], schema()),
+ new FunctionContext(flow_context())->eval($expression, [], schema()),
);
}
@@ -70,6 +70,6 @@ public function test_ulid_with_invalid_value_throws(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Ulid requires valid ULID string: Invalid ULID');
- (new FunctionContext(flow_context()))->eval(ulid(lit('')), [], schema());
+ new FunctionContext(flow_context())->eval(ulid(lit('')), [], schema());
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UnicodeLengthTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UnicodeLengthTest.php
index f728f6d15f..e4c8253187 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UnicodeLengthTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UnicodeLengthTest.php
@@ -17,7 +17,7 @@ final class UnicodeLengthTest extends FlowTestCase
{
public function test_unicode_length_ascii_string(): void
{
- static::assertSame(5, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(5, new FunctionContext(flow_context())->eval(
ref('str')->unicodeLength(),
['str' => 'hello'],
schema(str_schema('str')),
@@ -26,7 +26,7 @@ public function test_unicode_length_ascii_string(): void
public function test_unicode_length_empty_string(): void
{
- static::assertSame(0, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(0, new FunctionContext(flow_context())->eval(
ref('str')->unicodeLength(),
['str' => ''],
schema(str_schema('str')),
@@ -38,7 +38,7 @@ public function test_unicode_length_throws_on_null_input(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('UnicodeLength function requires non-null value');
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('str')->unicodeLength(),
['str' => null],
schema(str_schema('str', nullable: true)),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UuidTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UuidTest.php
index a34fb89ccd..fc070273c2 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UuidTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UuidTest.php
@@ -45,12 +45,12 @@ public function test_uuid4(): void
$expression = uuid_v4();
// @mago-ignore analysis:mixed-assignment
- $result = (new FunctionContext(flow_context()))->eval($expression, [], schema());
+ $result = new FunctionContext(flow_context())->eval($expression, [], schema());
static::assertInstanceOf(FlowUuid::class, $result);
static::assertTrue(Uuid::isValid($result->toString()));
static::assertNotSame(
- (new FunctionContext(flow_context()))->eval($expression, [], schema()),
- (new FunctionContext(flow_context()))->eval($expression, [], schema()),
+ new FunctionContext(flow_context())->eval($expression, [], schema()),
+ new FunctionContext(flow_context())->eval($expression, [], schema()),
);
}
@@ -59,8 +59,8 @@ public function test_uuid4_is_unique(): void
$expression = uuid_v4();
static::assertNotEquals(
- (new FunctionContext(flow_context()))->eval($expression, [], schema()),
- (new FunctionContext(flow_context()))->eval($expression, [], schema()),
+ new FunctionContext(flow_context())->eval($expression, [], schema()),
+ new FunctionContext(flow_context())->eval($expression, [], schema()),
);
}
@@ -71,7 +71,7 @@ public function test_uuid7(): void
}
// @mago-ignore analysis:mixed-assignment
- $result = (new FunctionContext(flow_context()))->eval(
+ $result = new FunctionContext(flow_context())->eval(
uuid_v7(lit(new DateTimeImmutable('2020-01-01 00:00:00', new DateTimeZone('UTC')))),
[],
schema(),
@@ -84,8 +84,8 @@ public function test_uuid7_is_unique(): void
{
$dateTime = lit(new DateTimeImmutable('2020-01-01 00:00:00', new DateTimeZone('UTC')));
static::assertNotEquals(
- (new FunctionContext(flow_context()))->eval(uuid_v7($dateTime), [], schema()),
- (new FunctionContext(flow_context()))->eval(uuid_v7($dateTime), [], schema()),
+ new FunctionContext(flow_context())->eval(uuid_v7($dateTime), [], schema()),
+ new FunctionContext(flow_context())->eval(uuid_v7($dateTime), [], schema()),
);
}
@@ -95,7 +95,7 @@ public function test_uuid4_gives_one_value_per_row(): void
static fn(FlowUuid $uuid): string => $uuid->toString(),
type_list(type_instance_of(FlowUuid::class))
->assert(
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(uuid_v4(), [['id' => 1], ['id' => 2]], schema(int_schema('id')))
->values(),
),
@@ -125,7 +125,7 @@ public function test_uuid_v7_requires_a_date_time(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Uuid uuid7 function requires a DateTimeInterface value');
- (new FunctionContext(flow_context()))->eval(uuid_v7(lit('')), [], schema());
+ new FunctionContext(flow_context())->eval(uuid_v7(lit('')), [], schema());
}
public function test_describe_round_trips(): void
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/WhenTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/WhenTest.php
index 979a43ffa4..c47d1a5e72 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/WhenTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/WhenTest.php
@@ -27,21 +27,21 @@ final class WhenTest extends FlowTestCase
{
public function test_a_falsy_else_branch_is_returned(): void
{
- static::assertFalse((new FunctionContext(flow_context()))->eval(
+ static::assertFalse(new FunctionContext(flow_context())->eval(
when(ref('active'), lit(true), false),
[
'active' => false,
],
schema(bool_schema('active')),
));
- static::assertSame(0, (new FunctionContext(flow_context()))->eval(
+ static::assertSame(0, new FunctionContext(flow_context())->eval(
when(ref('active'), lit(1), 0),
[
'active' => false,
],
schema(bool_schema('active')),
));
- static::assertSame('', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('', new FunctionContext(flow_context())->eval(
when(ref('active'), lit('yes'), ''),
[
'active' => false,
@@ -50,7 +50,7 @@ public function test_a_falsy_else_branch_is_returned(): void
));
static::assertSame(
[],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
when(ref('active'), lit(['yes']), []),
[
'active' => false,
@@ -58,7 +58,7 @@ public function test_a_falsy_else_branch_is_returned(): void
schema(bool_schema('active')),
),
);
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
when(ref('active'), lit('yes')),
[
'active' => false,
@@ -70,7 +70,7 @@ public function test_a_falsy_else_branch_is_returned(): void
public function test_condition_not_satisfied_without_else(): void
{
// when() of string and integer branches declares string: the value is cast to it
- static::assertSame('1', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('1', new FunctionContext(flow_context())->eval(
new When(ref('id')->equals(lit(2)), new Literal('then'), ref('id')),
[
'id' => 1,
@@ -81,7 +81,7 @@ public function test_condition_not_satisfied_without_else(): void
public function test_else(): void
{
- static::assertSame('else', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('else', new FunctionContext(flow_context())->eval(
new When(new Literal(false), new Literal('then'), new Literal('else')),
[
'id' => 1,
@@ -92,8 +92,8 @@ public function test_else(): void
public function test_with_children_keeps_the_then_branch(): void
{
- static::assertSame('y', (new FunctionContext(flow_context()))->eval(
- (new When(lit(true), lit('x')))->withChildren([lit(true), lit('y')]),
+ static::assertSame('y', new FunctionContext(flow_context())->eval(
+ new When(lit(true), lit('x'))->withChildren([lit(true), lit('y')]),
[],
schema(),
));
@@ -104,12 +104,12 @@ public function test_branches_without_a_common_type_refuse_to_declare(): void
$this->expectException(InvalidTypeException::class);
$this->expectExceptionMessage('Cannot combine types');
- (new When(lit(true), lit(true), lit(new DateTimeImmutable())))->returns();
+ new When(lit(true), lit(true), lit(new DateTimeImmutable()))->returns();
}
public function test_when(): void
{
- static::assertSame('then', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('then', new FunctionContext(flow_context())->eval(
new When(new Literal(true), new Literal('then')),
[
'id' => 1,
@@ -133,7 +133,7 @@ public function test_then_branch_error_names_the_batch_row(): void
);
try {
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(when(ref('c'), new FailingOnValuesFunction(ref('v'), [50]), lit(0)), $rows->schema())
->eval($rows, flow_context()->backend());
static::fail('expected an EvaluationException');
@@ -156,7 +156,7 @@ public function test_else_branch_error_names_the_batch_row(): void
);
try {
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(when(ref('c'), lit(0), new FailingOnValuesFunction(ref('v'), [50])), $rows->schema())
->eval($rows, flow_context()->backend());
static::fail('expected an EvaluationException');
@@ -181,7 +181,7 @@ public function test_a_branch_runs_only_on_the_rows_that_reach_it(): void
static::assertSame(
[1, 0, 3, 0, 0, 50],
- (new ReferenceResolver())
+ new ReferenceResolver()
->resolve(when(ref('c'), new FailingOnValuesFunction(ref('v'), [99]), lit(0)), $rows->schema())
->eval($rows, flow_context()->backend())
->values(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Window/FrameAccumulationTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Window/FrameAccumulationTest.php
index 15f2f38fca..a7232e7e0d 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Window/FrameAccumulationTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Window/FrameAccumulationTest.php
@@ -211,7 +211,7 @@ public function test_a_frame_aggregate_over_floats_with_nulls_and_ties(
WindowFrame $frame,
array $expected,
): void {
- static::assertSame($expected, (new FrameAccumulation($frame))->values(
+ static::assertSame($expected, new FrameAccumulation($frame)->values(
$function,
array_to_rows(
[
@@ -239,7 +239,7 @@ public function test_a_frame_aggregate_over_integers_past_the_int_range(
WindowFrame $frame,
array $expected,
): void {
- static::assertSame($expected, (new FrameAccumulation($frame))->values(
+ static::assertSame($expected, new FrameAccumulation($frame)->values(
$function,
array_to_rows([
['v' => PHP_INT_MAX],
@@ -257,7 +257,7 @@ public function test_an_empty_partition_has_no_values(): void
{
static::assertSame(
[],
- (new FrameAccumulation(new RowsFrame(preceding(1), following(1))))->values(
+ new FrameAccumulation(new RowsFrame(preceding(1), following(1)))->values(
sum(ref('id')),
RowsMother::empty(),
flow_context()->backend(),
@@ -272,7 +272,7 @@ public function test_a_one_row_partition_frames_only_that_row(): void
static::assertSame(
[1.0],
- (new FrameAccumulation(new RowsFrame(preceding(1), following(1))))->values(
+ new FrameAccumulation(new RowsFrame(preceding(1), following(1)))->values(
sum(ref('id')),
$one,
flow_context()->backend(),
@@ -281,7 +281,7 @@ public function test_a_one_row_partition_frames_only_that_row(): void
);
static::assertSame(
[0],
- (new FrameAccumulation(new RowsFrame(preceding(1), preceding(1))))->values(
+ new FrameAccumulation(new RowsFrame(preceding(1), preceding(1)))->values(
count(),
$one,
flow_context()->backend(),
@@ -296,7 +296,7 @@ public function test_a_whole_partition_frame_hands_every_row_the_same_bounds_in_
static::assertSame(
[15.0, 15.0, 15.0, 15.0, 15.0],
- (new FrameAccumulation(new WholePartitionFrame()))->values(
+ new FrameAccumulation(new WholePartitionFrame())->values(
$function,
RowsMother::sequentialIds(5),
flow_context()->backend(),
@@ -312,7 +312,7 @@ public function test_a_rows_frame_hands_every_row_its_own_bounds_in_one_call():
static::assertSame(
[1.0, 3.0, 5.0, 7.0, 9.0],
- (new FrameAccumulation(new RowsFrame(preceding(1), current_row())))->values(
+ new FrameAccumulation(new RowsFrame(preceding(1), current_row()))->values(
$function,
RowsMother::sequentialIds(5),
flow_context()->backend(),
@@ -326,7 +326,7 @@ public function test_a_rows_frame_reads_only_the_rows_between_its_bounds(): void
{
static::assertSame(
[1.0, 3.0, 6.0, 9.0, 12.0],
- (new FrameAccumulation(new RowsFrame(preceding(2), current_row())))->values(
+ new FrameAccumulation(new RowsFrame(preceding(2), current_row()))->values(
new CountingFrameAccumulating(ref('id')),
RowsMother::sequentialIds(5),
flow_context()->backend(),
@@ -341,7 +341,7 @@ public function test_a_peer_frame_grows_through_ties(): void
static::assertSame(
[3.0, 3.0, 10.0, 10.0, 15.0],
- (new FrameAccumulation(new PeerFrame([ref('d')->asc()])))->values(
+ new FrameAccumulation(new PeerFrame([ref('d')->asc()]))->values(
$function,
array_to_rows(
[
@@ -364,7 +364,7 @@ public function test_an_empty_frame_gives_the_value_of_nothing_accumulated(): vo
{
static::assertSame(
[null, null, null],
- (new FrameAccumulation(new RowsFrame(preceding(10), preceding(5))))->values(
+ new FrameAccumulation(new RowsFrame(preceding(10), preceding(5)))->values(
sum(ref('id'))->over(window()),
RowsMother::sequentialIds(3),
flow_context()->backend(),
@@ -391,7 +391,7 @@ public function test_a_frame_aggregate_reads_its_column_once_per_partition(
$calls = new ArrayObject();
$schema = schema(int_schema('v'));
- static::assertSame($expected, (new FrameAccumulation(new RowsFrame(preceding(2), current_row())))->values(
+ static::assertSame($expected, new FrameAccumulation(new RowsFrame(preceding(2), current_row()))->values(
$function,
Rows::fromColumns(
$schema,
@@ -415,7 +415,7 @@ public function test_bounds_are_resolved_once_per_row(): void
static::assertSame(
[6.0, 6.0, 6.0, 6.0, 6.0],
- (new FrameAccumulation($frame))->values(
+ new FrameAccumulation($frame)->values(
new CountingFrameAccumulating(ref('id')),
RowsMother::sequentialIds(5),
flow_context()->backend(),
@@ -430,7 +430,7 @@ public function test_reports_the_bounds_of_a_long_partition_in_chunks(): void
$progress = new ProgressSpy();
$function = new CountingFrameAccumulating(ref('id'));
- (new FrameAccumulation(new RowsFrame(preceding(1), current_row())))->values(
+ new FrameAccumulation(new RowsFrame(preceding(1), current_row()))->values(
$function,
RowsMother::sequentialIds(2500),
flow_context()->backend(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Window/PeerFrameTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Window/PeerFrameTest.php
index 21baca791a..db418a48bd 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Window/PeerFrameTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Window/PeerFrameTest.php
@@ -86,7 +86,7 @@ public function test_datetime_peers_are_matched_by_value_not_identity(): void
public function test_index_past_the_partition_end_is_empty(): void
{
- static::assertSame([1, 0], (new PeerFrame([ref('d')->asc()]))->bounds(0, rows(schema())));
+ static::assertSame([1, 0], new PeerFrame([ref('d')->asc()])->bounds(0, rows(schema())));
}
public function test_multiple_order_by_references_must_all_match(): void
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Window/RowsFrameTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Window/RowsFrameTest.php
index ef8ae79fb5..524da6060c 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Window/RowsFrameTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Window/RowsFrameTest.php
@@ -28,81 +28,57 @@ public function test_describe_round_trips(): void
public function test_centred_frame_clamps_at_the_first_index(): void
{
- static::assertSame(
- [0, 1],
- (new RowsFrame(preceding(1), following(1)))->bounds(0, RowsMother::sequentialIds(5)),
- );
+ static::assertSame([0, 1], new RowsFrame(preceding(1), following(1))->bounds(0, RowsMother::sequentialIds(5)));
}
public function test_centred_frame_clamps_at_the_last_index(): void
{
- static::assertSame(
- [3, 4],
- (new RowsFrame(preceding(1), following(1)))->bounds(4, RowsMother::sequentialIds(5)),
- );
+ static::assertSame([3, 4], new RowsFrame(preceding(1), following(1))->bounds(4, RowsMother::sequentialIds(5)));
}
public function test_empty_partition_yields_an_empty_frame(): void
{
static::assertSame(
[1, 0],
- (new RowsFrame(unbounded_preceding(), unbounded_following()))->bounds(0, rows(schema())),
+ new RowsFrame(unbounded_preceding(), unbounded_following())->bounds(0, rows(schema())),
);
}
public function test_frame_entirely_after_the_partition_end_is_empty(): void
{
- static::assertSame(
- [1, 0],
- (new RowsFrame(following(5), following(10)))->bounds(4, RowsMother::sequentialIds(5)),
- );
+ static::assertSame([1, 0], new RowsFrame(following(5), following(10))->bounds(4, RowsMother::sequentialIds(5)));
}
public function test_frame_entirely_before_the_partition_start_is_empty(): void
{
- static::assertSame(
- [1, 0],
- (new RowsFrame(preceding(10), preceding(5)))->bounds(0, RowsMother::sequentialIds(5)),
- );
+ static::assertSame([1, 0], new RowsFrame(preceding(10), preceding(5))->bounds(0, RowsMother::sequentialIds(5)));
}
public function test_preceding_to_current_row_clamps_at_the_first_index(): void
{
- static::assertSame(
- [0, 0],
- (new RowsFrame(preceding(2), current_row()))->bounds(0, RowsMother::sequentialIds(5)),
- );
+ static::assertSame([0, 0], new RowsFrame(preceding(2), current_row())->bounds(0, RowsMother::sequentialIds(5)));
}
public function test_preceding_to_current_row_in_the_middle_of_the_partition(): void
{
- static::assertSame(
- [1, 3],
- (new RowsFrame(preceding(2), current_row()))->bounds(3, RowsMother::sequentialIds(5)),
- );
+ static::assertSame([1, 3], new RowsFrame(preceding(2), current_row())->bounds(3, RowsMother::sequentialIds(5)));
}
public function test_single_row_partition(): void
{
- static::assertSame(
- [0, 0],
- (new RowsFrame(preceding(2), following(2)))->bounds(0, RowsMother::sequentialIds(1)),
- );
+ static::assertSame([0, 0], new RowsFrame(preceding(2), following(2))->bounds(0, RowsMother::sequentialIds(1)));
}
public function test_start_after_end_is_empty(): void
{
- static::assertSame(
- [1, 0],
- (new RowsFrame(following(1), preceding(1)))->bounds(2, RowsMother::sequentialIds(5)),
- );
+ static::assertSame([1, 0], new RowsFrame(following(1), preceding(1))->bounds(2, RowsMother::sequentialIds(5)));
}
public function test_unbounded_to_unbounded_covers_the_whole_partition(): void
{
static::assertSame(
[0, 4],
- (new RowsFrame(unbounded_preceding(), unbounded_following()))->bounds(2, RowsMother::sequentialIds(5)),
+ new RowsFrame(unbounded_preceding(), unbounded_following())->bounds(2, RowsMother::sequentialIds(5)),
);
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Window/WholePartitionFrameTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Window/WholePartitionFrameTest.php
index 43f10e3dd0..fbda51cd6e 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Window/WholePartitionFrameTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Window/WholePartitionFrameTest.php
@@ -32,11 +32,11 @@ public function test_covers_the_whole_partition_regardless_of_the_index(): void
public function test_empty_partition_yields_an_empty_frame(): void
{
- static::assertSame([0, -1], (new WholePartitionFrame())->bounds(0, rows(schema())));
+ static::assertSame([0, -1], new WholePartitionFrame()->bounds(0, rows(schema())));
}
public function test_single_row_partition(): void
{
- static::assertSame([0, 0], (new WholePartitionFrame())->bounds(0, RowsMother::sequentialIds(1)));
+ static::assertSame([0, 0], new WholePartitionFrame()->bounds(0, RowsMother::sequentialIds(1)));
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/WordwrapTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/WordwrapTest.php
index 7730cd13ac..e3b5fab571 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/WordwrapTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/WordwrapTest.php
@@ -20,7 +20,7 @@ final class WordwrapTest extends FlowTestCase
{
public function test_empty_string(): void
{
- static::assertEquals('', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('', new FunctionContext(flow_context())->eval(
ref('str')->wordwrap(10),
['str' => ''],
schema(str_schema('str')),
@@ -29,7 +29,7 @@ public function test_empty_string(): void
public function test_normal_word_wrapping(): void
{
- static::assertEquals("The quick\nbrown fox\njumps", (new FunctionContext(flow_context()))->eval(
+ static::assertEquals("The quick\nbrown fox\njumps", new FunctionContext(flow_context())->eval(
ref('str')->wordwrap(10),
['str' => 'The quick brown fox jumps'],
schema(str_schema('str')),
@@ -38,7 +38,7 @@ public function test_normal_word_wrapping(): void
public function test_null_break_character(): void
{
- static::assertEquals("Hello\nWorld Test", (new FunctionContext(flow_context()))->eval(
+ static::assertEquals("Hello\nWorld Test", new FunctionContext(flow_context())->eval(
ref('str')->wordwrap(10, ref('break')),
['str' => 'Hello World Test', 'break' => null],
schema(str_schema('str'), str_schema('break', nullable: true)),
@@ -50,7 +50,7 @@ public function test_null_value(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Wordwrap function requires non-null value');
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('str')->wordwrap(10),
['str' => null],
schema(str_schema('str', nullable: true)),
@@ -59,7 +59,7 @@ public function test_null_value(): void
public function test_a_long_word_is_not_cut_by_default(): void
{
- static::assertSame('abcdef', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('abcdef', new FunctionContext(flow_context())->eval(
ref('s')->wordwrap(3),
['s' => 'abcdef'],
schema(str_schema('s')),
@@ -68,7 +68,7 @@ public function test_a_long_word_is_not_cut_by_default(): void
public function test_text_shorter_than_width(): void
{
- static::assertEquals('Hello', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('Hello', new FunctionContext(flow_context())->eval(
ref('str')->wordwrap(20),
['str' => 'Hello'],
schema(str_schema('str')),
@@ -77,7 +77,7 @@ public function test_text_shorter_than_width(): void
public function test_width_zero(): void
{
- static::assertEquals('Hello World', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('Hello World', new FunctionContext(flow_context())->eval(
ref('str')->wordwrap(0),
['str' => 'Hello World'],
schema(str_schema('str')),
@@ -88,7 +88,7 @@ public function test_width_zero_keeps_every_row(): void
{
static::assertSame(
['Hello World', 'Bye World'],
- (new FunctionContext(flow_context()))
+ new FunctionContext(flow_context())
->column(
ref('str')->wordwrap(0),
[['str' => 'Hello World'], ['str' => 'Bye World']],
@@ -100,7 +100,7 @@ public function test_width_zero_keeps_every_row(): void
public function test_does_not_cut_words_by_default(): void
{
- static::assertSame('Hello', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('Hello', new FunctionContext(flow_context())->eval(
new Wordwrap(ref('str'), 3),
['str' => 'Hello'],
schema(str_schema('str')),
@@ -109,7 +109,7 @@ public function test_does_not_cut_words_by_default(): void
public function test_null_cut_does_not_cut_words(): void
{
- static::assertSame('Hello', (new FunctionContext(flow_context()))->eval(
+ static::assertSame('Hello', new FunctionContext(flow_context())->eval(
ref('str')->wordwrap(3, "\n", ref('cut')),
['str' => 'Hello', 'cut' => null],
schema(str_schema('str'), bool_schema('cut', nullable: true)),
@@ -118,7 +118,7 @@ public function test_null_cut_does_not_cut_words(): void
public function test_with_scalar_function_break(): void
{
- static::assertEquals('Hello | World Test', (new FunctionContext(flow_context()))->eval(
+ static::assertEquals('Hello | World Test', new FunctionContext(flow_context())->eval(
ref('str')->wordwrap(10, ref('break')),
['str' => 'Hello World Test', 'break' => ' | '],
schema(str_schema('str'), str_schema('break')),
@@ -127,7 +127,7 @@ public function test_with_scalar_function_break(): void
public function test_with_scalar_function_cut(): void
{
- static::assertEquals("Hel\nlo", (new FunctionContext(flow_context()))->eval(
+ static::assertEquals("Hel\nlo", new FunctionContext(flow_context())->eval(
ref('str')->wordwrap(3, "\n", ref('cut')),
['str' => 'Hello', 'cut' => true],
schema(str_schema('str'), bool_schema('cut')),
@@ -136,7 +136,7 @@ public function test_with_scalar_function_cut(): void
public function test_with_scalar_function_width(): void
{
- static::assertEquals("Hello\nWorld\nTest", (new FunctionContext(flow_context()))->eval(
+ static::assertEquals("Hello\nWorld\nTest", new FunctionContext(flow_context())->eval(
ref('str')->wordwrap(ref('width')),
['str' => 'Hello World Test', 'width' => 8],
schema(str_schema('str'), int_schema('width')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/XPathTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/XPathTest.php
index ff520fe75d..b07035cb35 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/XPathTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/XPathTest.php
@@ -24,7 +24,7 @@ public function test_xpath_on_simple_xml_with_only_one_node_returned(): void
static::assertInstanceOf(DOMElement::class, $xml->documentElement);
static::assertEquals(
[$xml->documentElement->firstChild],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->xpath('/root/foo'),
['value' => $xml],
schema(xml_schema('value')),
@@ -43,7 +43,7 @@ public function test_xpath_when_there_are_more_than_one_elements_under_given_pat
$xml->documentElement->firstChild,
$xml->documentElement->lastChild,
],
- (new FunctionContext(flow_context()))->eval(
+ new FunctionContext(flow_context())->eval(
ref('value')->xpath('/root/foo'),
['value' => $xml],
schema(xml_schema('value')),
@@ -56,7 +56,7 @@ public function test_xpath_with_invalid_path_syntax(): void
$xml = new DOMDocument();
$xml->loadXML('bar');
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('value')->xpath('/root/foo/asa'),
['value' => $xml],
schema(xml_schema('value')),
@@ -68,7 +68,7 @@ public function test_xpath_with_non_existing_path(): void
$xml = new DOMDocument();
$xml->loadXML('bar');
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('value')->xpath('/root/bar'),
['value' => $xml],
schema(xml_schema('value')),
@@ -80,12 +80,12 @@ public function test_xpath_selecting_non_element_nodes_returns_null(): void
$xml = new DOMDocument();
$xml->loadXML('bar');
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('value')->xpath('/root/foo/text()'),
['value' => $xml],
schema(xml_schema('value')),
));
- static::assertNull((new FunctionContext(flow_context()))->eval(
+ static::assertNull(new FunctionContext(flow_context())->eval(
ref('value')->xpath('/root/foo/@baz'),
['value' => $xml],
schema(xml_schema('value')),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/CriteriaTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/CriteriaTest.php
index 1fcda407cb..d7dcb3eeba 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/CriteriaTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/CriteriaTest.php
@@ -43,7 +43,7 @@ public function test_a_limit_below_one_is_refused(int $limit): void
public function test_a_zero_offset_is_accepted_and_keeps_the_offset(): void
{
- static::assertSame(2, (new Criteria())->withOffset(2)->withOffset(0)->offset);
+ static::assertSame(2, new Criteria()->withOffset(2)->withOffset(0)->offset);
}
public function test_a_filter_appends_its_conjuncts_in_push_order(): void
@@ -52,7 +52,7 @@ public function test_a_filter_appends_its_conjuncts_in_push_order(): void
$second = ref('id')->lessThan(lit(10));
$third = ref('id')->notEquals(lit(5));
- $criteria = (new Criteria(5))
+ $criteria = new Criteria(5)
->withFilter($first)
->withFilter($second->and($third));
@@ -64,7 +64,7 @@ public function test_a_filter_appends_its_conjuncts_in_push_order(): void
public function test_a_second_limit_only_lowers_the_first_and_keeps_the_conjuncts(): void
{
$filter = ref('id')->greaterThan(lit(1));
- $criteria = (new Criteria())
+ $criteria = new Criteria()
->withFilter($filter)
->withLimit(5);
@@ -72,7 +72,7 @@ public function test_a_second_limit_only_lowers_the_first_and_keeps_the_conjunct
static::assertSame(5, $criteria->withLimit(8)->limit);
static::assertSame([$filter], $criteria->withLimit(8)->conjuncts);
static::assertTrue(
- (new Criteria())
+ new Criteria()
->withLimit(1)
->narrows(),
);
@@ -84,7 +84,7 @@ public function test_path_filters_compose_and_keep_the_conjuncts(): void
$first = new RejectingFilter();
$second = new RejectingFilter();
- $criteria = (new Criteria())
+ $criteria = new Criteria()
->withFilter($filter)
->withPathFilter($first)
->withPathFilter($second);
@@ -92,7 +92,7 @@ public function test_path_filters_compose_and_keep_the_conjuncts(): void
static::assertEquals(new Filters(new OnlyFiles(), $first, $second), $criteria->pathFilter);
static::assertSame([$filter], $criteria->conjuncts);
static::assertTrue(
- (new Criteria())
+ new Criteria()
->withPathFilter($first)
->narrows(),
);
@@ -100,7 +100,7 @@ public function test_path_filters_compose_and_keep_the_conjuncts(): void
public function test_a_split_narrows(): void
{
- $criteria = (new Criteria())->withSplit(new FileSplit(path('memory://orders.csv'), 0, 1_024));
+ $criteria = new Criteria()->withSplit(new FileSplit(path('memory://orders.csv'), 0, 1_024));
static::assertTrue($criteria->narrows());
static::assertSame(0, $criteria->split?->start);
@@ -112,7 +112,7 @@ public function test_with_split_keeps_limit_path_filter_and_conjuncts_and_every_
$pathFilter = new RejectingFilter();
$split = new FileSplit(path('memory://orders.csv'), 1_024, 1_024);
- $criteria = (new Criteria(5))
+ $criteria = new Criteria(5)
->withFilter($filter)
->withPathFilter($pathFilter)
->withSplit($split);
@@ -128,17 +128,17 @@ public function test_with_split_keeps_limit_path_filter_and_conjuncts_and_every_
public function test_pushed_columns_keep_each_name_once(): void
{
- static::assertSame(['a', 'b'], (new Criteria())->withColumns('a', 'b', 'a')->columns);
+ static::assertSame(['a', 'b'], new Criteria()->withColumns('a', 'b', 'a')->columns);
}
public function test_a_second_push_of_columns_keeps_only_the_columns_both_name_in_the_first_order(): void
{
- static::assertSame(['a', 'c'], (new Criteria())->withColumns('a', 'b', 'c')->withColumns('c', 'a')->columns);
+ static::assertSame(['a', 'c'], new Criteria()->withColumns('a', 'b', 'c')->withColumns('c', 'a')->columns);
}
public function test_pushed_columns_survive_every_other_push(): void
{
- $criteria = (new Criteria())->withColumns('a', 'b');
+ $criteria = new Criteria()->withColumns('a', 'b');
static::assertSame(['a', 'b'], $criteria->withFilter(ref('a')->greaterThan(lit(1)))->columns);
static::assertSame(['a', 'b'], $criteria->withLimit(3)->columns);
@@ -157,7 +157,7 @@ public function test_an_offset_below_zero_is_refused(): void
public function test_an_offset_narrows(): void
{
- static::assertTrue((new Criteria(offset: 1))->narrows());
+ static::assertTrue(new Criteria(offset: 1)->narrows());
}
public function test_offsets_add_up_and_keep_limit_path_filter_and_conjuncts(): void
@@ -165,7 +165,7 @@ public function test_offsets_add_up_and_keep_limit_path_filter_and_conjuncts():
$filter = ref('id')->greaterThan(lit(1));
$pathFilter = new RejectingFilter();
- $criteria = (new Criteria(5))
+ $criteria = new Criteria(5)
->withFilter($filter)
->withPathFilter($pathFilter)
->withOffset(3)
@@ -185,7 +185,7 @@ public function test_a_negative_offset_push_is_refused(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Offset must be greater than or equal to 0, given: -1');
- (new Criteria(offset: 5))->withOffset(-1);
+ new Criteria(offset: 5)->withOffset(-1);
}
public function test_a_read_with_an_offset_cannot_be_split(): void
@@ -193,7 +193,7 @@ public function test_a_read_with_an_offset_cannot_be_split(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('A read with an offset cannot be split, given offset: 3');
- (new Criteria(offset: 3))->withSplit(new FileSplit(path('memory://orders.csv'), 0, 1_024));
+ new Criteria(offset: 3)->withSplit(new FileSplit(path('memory://orders.csv'), 0, 1_024));
}
public function test_a_split_read_refuses_an_offset(): void
@@ -201,7 +201,7 @@ public function test_a_split_read_refuses_an_offset(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('A read with an offset cannot be split, given offset: 3');
- (new Criteria())
+ new Criteria()
->withSplit(new FileSplit(path('memory://orders.csv'), 0, 1_024))
->withOffset(3);
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/FeedExtractorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/FeedExtractorTest.php
index 8667da30c0..e74c4c259f 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/FeedExtractorTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/FeedExtractorTest.php
@@ -24,7 +24,7 @@ final class FeedExtractorTest extends FlowTestCase
{
public function test_extract_outside_a_fiber_fails(): void
{
- $generator = (new FeedExtractor(schema(int_schema('id'))))->extract(
+ $generator = new FeedExtractor(schema(int_schema('id')))->extract(
flow_context(config())->backend(),
new Criteria(),
);
@@ -64,7 +64,7 @@ public function test_it_describes_the_shape_it_was_seeded_with(): void
{
static::assertEquals(
schema(int_schema('id'), str_schema('name')),
- (new FeedExtractor(schema(int_schema('id'), str_schema('name'))))->schema(),
+ new FeedExtractor(schema(int_schema('id'), str_schema('name')))->schema(),
);
}
@@ -144,7 +144,7 @@ public function test_with_schema_replaces_the_seeded_shape(): void
{
static::assertEquals(
schema(str_schema('name')),
- (new FeedExtractor(schema(int_schema('id'))))
+ new FeedExtractor(schema(int_schema('id')))
->withSchema(schema(str_schema('name')))
->schema(),
);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/ByteUnitTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/ByteUnitTest.php
index b503a14d8f..f9a6f4e7ca 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/ByteUnitTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/ByteUnitTest.php
@@ -27,7 +27,7 @@ public function test_a_negative_value_is_rejected(int $start, int $bytes, int $r
#[TestWith([100, 0, 100])]
public function test_the_midpoint_is_the_start_plus_half_the_bytes(int $start, int $bytes, int $midpoint): void
{
- static::assertSame($midpoint, (new ByteUnit($start, $bytes, 1))->midpoint());
+ static::assertSame($midpoint, new ByteUnit($start, $bytes, 1)->midpoint());
}
public function test_zero_is_accepted_everywhere(): void
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/DerivedFromFilesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/DerivedFromFilesTest.php
index cd5f253e69..746e9351b9 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/DerivedFromFilesTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/DerivedFromFilesTest.php
@@ -23,7 +23,7 @@ final class DerivedFromFilesTest extends FlowTestCase
{
public function test_an_empty_listing_derives_an_empty_schema(): void
{
- static::assertEquals(schema(), (new DerivedFromFiles())->fold(
+ static::assertEquals(schema(), new DerivedFromFiles()->fold(
SelfDescribingFilesContext::describing()->generator(),
false,
));
@@ -33,7 +33,7 @@ public function test_an_empty_listing_folds_zero_rows_and_zero_bytes(): void
{
static::assertEquals(
new Statistics(rows: Cardinality::exact(0), size: Cardinality::exact(0)),
- (new DerivedFromFiles())->footers(SelfDescribingFilesContext::describing()->generator(), false)->of(0),
+ new DerivedFromFiles()->footers(SelfDescribingFilesContext::describing()->generator(), false)->of(0),
);
}
@@ -41,7 +41,7 @@ public function test_every_file_but_the_first_is_closed_the_first_stays_with_its
{
$files = SelfDescribingFilesContext::describing(schema(int_schema('id')), schema(str_schema('name')));
- (new DerivedFromFiles())->fold($files->generator(), true);
+ new DerivedFromFiles()->fold($files->generator(), true);
static::assertSame(array_slice($files->files, 1), $files->closed());
}
@@ -51,7 +51,7 @@ public function test_a_first_file_that_cannot_describe_itself_stays_with_its_own
$files = SelfDescribingFilesContext::failing();
try {
- (new DerivedFromFiles())->fold($files->generator(), false);
+ new DerivedFromFiles()->fold($files->generator(), false);
} catch (RuntimeException) {
static::assertSame([], $files->closed());
@@ -65,7 +65,7 @@ public function test_the_fold_stops_at_the_first_file(): void
{
$files = SelfDescribingFilesContext::describing(schema(int_schema('id')), schema(str_schema('name')));
- static::assertEquals(schema(int_schema('id')), (new DerivedFromFiles())->fold($files->generator(), false));
+ static::assertEquals(schema(int_schema('id')), new DerivedFromFiles()->fold($files->generator(), false));
static::assertSame(1, $files->advanced);
}
@@ -86,7 +86,7 @@ public function test_union_by_name_folds_every_file(): void
static::assertEquals(
schema(int_schema('id', nullable: true), str_schema('name', nullable: true)),
- (new DerivedFromFiles())->fold($files->generator(), true),
+ new DerivedFromFiles()->fold($files->generator(), true),
);
static::assertSame(2, $files->advanced);
}
@@ -104,14 +104,14 @@ public function test_the_fold_remembers_the_file_it_read_first(): void
public function test_nothing_folded_was_read_from_no_file(): void
{
- static::assertSame('', (new DerivedFromFiles())->from());
+ static::assertSame('', new DerivedFromFiles()->from());
}
public function test_footers_count_the_files_the_fold_read(): void
{
static::assertSame(
2,
- (new DerivedFromFiles())->footers(
+ new DerivedFromFiles()->footers(
SelfDescribingFilesContext::describing(schema(int_schema('id')), schema(int_schema('id')))->generator(),
true,
)->files,
@@ -185,7 +185,7 @@ public function test_a_later_file_that_cannot_describe_itself_is_closed(): void
);
try {
- (new DerivedFromFiles())->fold($files->generator(), true);
+ new DerivedFromFiles()->fold($files->generator(), true);
} catch (RuntimeException) {
static::assertSame([$files->files[1]], $files->closed());
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/DerivedSchemaTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/DerivedSchemaTest.php
index f01c736149..855ae7e9c7 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/DerivedSchemaTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/DerivedSchemaTest.php
@@ -18,7 +18,7 @@ public function test_a_file_of_the_derived_schema_passes(): void
{
$this->expectNotToPerformAssertions();
- (new DerivedSchema(schema(int_schema('id')), 'memory://a.floe'))->refuseDivergence(
+ new DerivedSchema(schema(int_schema('id')), 'memory://a.floe')->refuseDivergence(
'memory://b.floe',
schema(int_schema('id')),
);
@@ -29,7 +29,7 @@ public function test_a_file_of_another_schema_is_refused_naming_both_files(): vo
$this->expectException(InferredSchemaException::class);
$this->expectExceptionMessage('memory://b.floe');
- (new DerivedSchema(schema(int_schema('id')), 'memory://a.floe'))->refuseDivergence(
+ new DerivedSchema(schema(int_schema('id')), 'memory://a.floe')->refuseDivergence(
'memory://b.floe',
schema(str_schema('name')),
);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileColumnsSourceTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileColumnsSourceTest.php
index 066d93a0fa..87c01e93e3 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileColumnsSourceTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileColumnsSourceTest.php
@@ -45,11 +45,11 @@ public function test_the_withers_share_the_listing(): void
public function test_the_columns_carry_the_declared_partition_types_and_the_metadata_flag(): void
{
- $source = (new FileColumnsSource(
+ $source = new FileColumnsSource(
new SourceFiles(MemoryFiles::with([
'memory://orders/year=2024/a.csv' => 'id',
]), path('memory://orders/*/*.csv')),
- ))
+ )
->withPartitionTypes(partition_types(year: type_integer()))
->withMetadataColumns(true);
@@ -66,8 +66,8 @@ public function test_the_columns_carry_the_declared_partition_types_and_the_meta
public function test_no_partition_type_is_declared_by_default(): void
{
static::assertEquals(
- (new PartitionTypes())->normalize(),
- (new FileColumnsSource(new SourceFiles(MemoryFiles::with([]), path('memory://orders/*.csv'))))
+ new PartitionTypes()->normalize(),
+ new FileColumnsSource(new SourceFiles(MemoryFiles::with([]), path('memory://orders/*.csv')))
->columns()
->normalize()['partition_types'],
);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileConstantsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileConstantsTest.php
index 52d05432ce..5413d15f7e 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileConstantsTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileConstantsTest.php
@@ -17,14 +17,14 @@ final class FileConstantsTest extends FlowTestCase
{
public function test_values_are_empty_without_metadata_columns_and_partitions(): void
{
- static::assertSame([], (new FileConstants(null, [], []))->values());
+ static::assertSame([], new FileConstants(null, [], [])->values());
}
public function test_values_carry_the_uri_when_metadata_columns_are_on(): void
{
static::assertSame(
['_input_file_uri' => 'memory://orders/data.csv'],
- (new FileConstants('memory://orders/data.csv', [], []))->values(),
+ new FileConstants('memory://orders/data.csv', [], [])->values(),
);
}
@@ -32,11 +32,11 @@ public function test_values_carry_every_partition_and_null_for_one_the_path_lack
{
static::assertSame(
['_input_file_uri' => 'memory://orders/year=2024/data.csv', 'year' => 2024, 'month' => null],
- (new FileConstants(
+ new FileConstants(
'memory://orders/year=2024/data.csv',
['year' => false, 'month' => true],
['year' => 2024],
- ))->values(),
+ )->values(),
);
}
@@ -44,11 +44,7 @@ public function test_fill_rows_returns_a_batch_with_nothing_to_add_as_it_is(): v
{
$rows = array_to_rows([['name' => 'Norbert']], schema(str_schema('name')));
- static::assertSame($rows, (new FileConstants(null, [], []))->fillRows(
- $rows,
- $rows->schema(),
- new PhpBackend(),
- ));
+ static::assertSame($rows, new FileConstants(null, [], [])->fillRows($rows, $rows->schema(), new PhpBackend()));
}
public function test_fill_rows_adds_the_constants_to_every_row_under_the_declared_schema(): void
@@ -60,7 +56,7 @@ public function test_fill_rows_adds_the_constants_to_every_row_under_the_declare
['name' => 'Norbert', '_input_file_uri' => 'memory://orders/data.csv', 'year' => 2024],
['name' => 'Flow', '_input_file_uri' => 'memory://orders/data.csv', 'year' => 2024],
], $declared),
- (new FileConstants('memory://orders/data.csv', ['year' => false], ['year' => 2024]))->fillRows(
+ new FileConstants('memory://orders/data.csv', ['year' => false], ['year' => 2024])->fillRows(
array_to_rows([
['name' => 'Norbert'],
['name' => 'Flow'],
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileMetadataRowTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileMetadataRowTest.php
index f91ec7fc35..54b6311911 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileMetadataRowTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileMetadataRowTest.php
@@ -16,8 +16,8 @@ final class FileMetadataRowTest extends FlowTestCase
public function test_the_schema_names_every_column_of_the_row_and_no_partition_column(): void
{
static::assertSame(
- array_keys((new FileMetadataRow())->row(new FileStatus(path('memory://dir/year=2024/a.csv'), true))),
- (new FileMetadataRow())->schema()->names(),
+ array_keys(new FileMetadataRow()->row(new FileStatus(path('memory://dir/year=2024/a.csv'), true))),
+ new FileMetadataRow()->schema()->names(),
);
}
@@ -33,14 +33,14 @@ public function test_a_file_is_described_by_its_path_names_kind_and_extension():
'is_dir' => false,
'extension' => 'csv',
],
- (new FileMetadataRow())->row(new FileStatus(path('memory://dir/a.csv'), true)),
+ new FileMetadataRow()->row(new FileStatus(path('memory://dir/a.csv'), true)),
);
}
public function test_the_extension_column_is_nullable(): void
{
static::assertTrue(
- (new FileMetadataRow())
+ new FileMetadataRow()
->schema()
->get('extension')
->isNullable(),
@@ -49,6 +49,6 @@ public function test_the_extension_column_is_nullable(): void
public function test_a_file_without_an_extension_has_a_null_extension(): void
{
- static::assertNull((new FileMetadataRow())->row(new FileStatus(path('memory://dir/a'), true))['extension']);
+ static::assertNull(new FileMetadataRow()->row(new FileStatus(path('memory://dir/a'), true))['extension']);
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileReadLoopTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileReadLoopTest.php
index d80967adfd..2af4864e4d 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileReadLoopTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileReadLoopTest.php
@@ -37,7 +37,7 @@ public function test_every_batch_carries_its_files_constants(): void
[[['id' => 1, 'year' => '2023'], ['id' => 2, 'year' => '2023']], [['id' => 3, 'year' => '2024']]],
array_map(static fn(CorruptedRecordException|Rows $batch): array => (
$batch instanceof Rows ? $batch->toArray() : [$batch->getMessage()]
- ), iterator_to_array((new FileReadLoop(FileReadMother::of(schema(int_schema('id'), str_schema('year')), FileColumnsContext::discovering(), 10)))->read([
+ ), iterator_to_array(new FileReadLoop(FileReadMother::of(schema(int_schema('id'), str_schema('year')), FileColumnsContext::discovering(), 10))->read([
new SourceFile(path('memory://orders/year=2023/a.csv')),
new SourceFile(path('memory://orders/year=2024/b.csv')),
], new InMemoryFileBatches([
@@ -61,10 +61,10 @@ public function test_a_corrupted_record_passes_through_outside_the_filter_and_th
$batch instanceof Rows ? $batch->toArray() : [$batch->getMessage()]
),
iterator_to_array(
- (new FileReadLoop(
+ new FileReadLoop(
FileReadMother::of(schema(int_schema('id')), FileColumnsContext::discovering(names: []), 10),
new Criteria(conjuncts: [ref('id')->greaterThan(lit(1))]),
- ))->read(
+ )->read(
[new SourceFile(path('memory://a.csv'))],
new InMemoryFileBatches(['memory://a.csv' => [1, 2, 3]], corrupted: [
'memory://a.csv' => new CorruptedRecordException('memory://a.csv', 4, 2, 'reason', 'x'),
@@ -89,10 +89,10 @@ public function test_a_filter_a_file_yields_applies_to_that_file_only(): void
$batch instanceof Rows ? $batch->toArray() : [$batch->getMessage()]
),
iterator_to_array(
- (new FileReadLoop(
+ new FileReadLoop(
FileReadMother::of($schema, FileColumnsContext::discovering(names: []), 10),
new Criteria(conjuncts: [ref('id')->greaterThan(lit(1))]),
- ))->read(
+ )->read(
[new SourceFile(path('memory://a.parquet')), new SourceFile(path('memory://b.parquet'))],
new InMemoryFileBatches(['memory://a.parquet' => [1, 2, 3], 'memory://b.parquet' => [1, 5]], [
'memory://a.parquet' => Filter::bind($schema),
@@ -108,11 +108,11 @@ public function test_a_filter_a_file_yields_applies_to_that_file_only(): void
public function test_stop_after_the_first_batch_ends_the_read(): void
{
- $read = (new FileReadLoop(FileReadMother::of(
+ $read = new FileReadLoop(FileReadMother::of(
schema(int_schema('id')),
FileColumnsContext::discovering(names: []),
1,
- )))->read(
+ ))->read(
[new SourceFile(path('memory://a.csv')), new SourceFile(path('memory://b.csv'))],
new InMemoryFileBatches(['memory://a.csv' => [1, 2, 3], 'memory://b.csv' => [4]]),
flow_context()->backend(),
@@ -137,7 +137,7 @@ public function test_a_limit_inside_a_file_ends_the_read_and_is_pushed_down(): v
[[['id' => 1], ['id' => 2]]],
array_map(static fn(CorruptedRecordException|Rows $batch): array => (
$batch instanceof Rows ? $batch->toArray() : [$batch->getMessage()]
- ), iterator_to_array((new FileReadLoop(FileReadMother::of(schema(int_schema('id')), FileColumnsContext::discovering(names: []), 10)))->read([new SourceFile(path('memory://a.csv')), new SourceFile(path('memory://b.csv'))], $batches, flow_context()->backend(), new ReadWindow(limit: 2)))),
+ ), iterator_to_array(new FileReadLoop(FileReadMother::of(schema(int_schema('id')), FileColumnsContext::discovering(names: []), 10))->read([new SourceFile(path('memory://a.csv')), new SourceFile(path('memory://b.csv'))], $batches, flow_context()->backend(), new ReadWindow(limit: 2)))),
);
static::assertEquals(['memory://a.csv' => [new ReadWindow(0, 2)]], $batches->windows);
}
@@ -148,11 +148,11 @@ public function test_a_limit_at_a_file_boundary_opens_no_further_file(): void
static::assertCount(
2,
- iterator_to_array((new FileReadLoop(FileReadMother::of(
+ iterator_to_array(new FileReadLoop(FileReadMother::of(
schema(int_schema('id')),
FileColumnsContext::discovering(names: []),
1,
- )))->read(
+ ))->read(
[new SourceFile(path('memory://a.csv')), new SourceFile(path('memory://b.csv'))],
$batches,
flow_context()->backend(),
@@ -174,7 +174,7 @@ public function test_the_offset_a_file_leaves_and_the_rows_still_wanted_reach_th
[[['id' => 4]], [['id' => 5]]],
array_map(static fn(CorruptedRecordException|Rows $batch): array => (
$batch instanceof Rows ? $batch->toArray() : [$batch->getMessage()]
- ), iterator_to_array((new FileReadLoop(FileReadMother::of(schema(int_schema('id')), FileColumnsContext::discovering(names: []), 10)))->read([
+ ), iterator_to_array(new FileReadLoop(FileReadMother::of(schema(int_schema('id')), FileColumnsContext::discovering(names: []), 10))->read([
new SourceFile(path('memory://a.csv')),
new SourceFile(path('memory://b.csv')),
new SourceFile(path('memory://c.csv')),
@@ -194,11 +194,11 @@ public function test_no_sources_read_nothing(): void
{
static::assertSame(
[],
- iterator_to_array((new FileReadLoop(FileReadMother::of(
+ iterator_to_array(new FileReadLoop(FileReadMother::of(
schema(int_schema('id')),
FileColumnsContext::discovering(names: []),
10,
- )))->read([], new InMemoryFileBatches([]), flow_context()->backend(), new ReadWindow())),
+ ))->read([], new InMemoryFileBatches([]), flow_context()->backend(), new ReadWindow())),
);
}
@@ -217,11 +217,11 @@ public function test_the_loop_slices_the_offset_a_format_cannot_skip_across_file
$batch instanceof Rows ? $batch->toArray() : [$batch->getMessage()]
),
iterator_to_array(
- (new FileReadLoop(FileReadMother::of(
+ new FileReadLoop(FileReadMother::of(
schema(int_schema('id')),
FileColumnsContext::discovering(names: []),
10,
- )))->read(
+ ))->read(
[
new SourceFile(path('memory://a.csv')),
new SourceFile(path('memory://b.csv')),
@@ -256,11 +256,11 @@ public function test_the_loop_skips_the_offset_and_trims_to_the_limit_for_a_form
$batch instanceof Rows ? $batch->toArray() : [$batch->getMessage()]
),
iterator_to_array(
- (new FileReadLoop(FileReadMother::of(
+ new FileReadLoop(FileReadMother::of(
schema(int_schema('id')),
FileColumnsContext::discovering(names: []),
10,
- )))->read(
+ ))->read(
[new SourceFile(path('memory://a.csv'))],
$batches,
flow_context()->backend(),
@@ -282,10 +282,10 @@ public function test_a_filter_drops_the_rows_it_does_not_match_and_skips_a_batch
$batch instanceof Rows ? $batch->toArray() : [$batch->getMessage()]
),
iterator_to_array(
- (new FileReadLoop(
+ new FileReadLoop(
FileReadMother::of(schema(int_schema('id')), FileColumnsContext::discovering(names: []), 2),
new Criteria(conjuncts: [ref('id')->greaterThan(lit(2))]),
- ))->read(
+ )->read(
[new SourceFile(path('memory://a.csv'))],
new InMemoryFileBatches(['memory://a.csv' => [1, 2, 3, 4, 5]]),
flow_context()->backend(),
@@ -311,12 +311,12 @@ public function test_an_offset_counts_the_rows_the_filter_keeps_even_for_a_forma
$batch instanceof Rows ? $batch->toArray() : [$batch->getMessage()]
),
iterator_to_array(
- (new FileReadLoop(
+ new FileReadLoop(
FileReadMother::of(schema(int_schema('id')), FileColumnsContext::discovering(names: []), 10),
new Criteria(conjuncts: [
ref('id')->greaterThan(lit(2)),
]),
- ))->read(
+ )->read(
[new SourceFile(path('memory://a.csv')), new SourceFile(path('memory://b.csv'))],
$batches,
flow_context()->backend(),
@@ -341,7 +341,7 @@ public function test_a_filter_mixing_a_body_and_a_partition_column_sees_the_part
$batch instanceof Rows ? $batch->toArray() : [$batch->getMessage()]
),
iterator_to_array(
- (new FileReadLoop(
+ new FileReadLoop(
FileReadMother::of(
schema(int_schema('id'), str_schema('year')),
FileColumnsContext::discovering(),
@@ -351,7 +351,7 @@ public function test_a_filter_mixing_a_body_and_a_partition_column_sees_the_part
ref('year')->equals(lit('2024')),
ref('id')->greaterThan(lit(3)),
]),
- ))->read(
+ )->read(
[
new SourceFile(path('memory://orders/year=2023/a.csv')),
new SourceFile(path('memory://orders/year=2024/b.csv')),
@@ -380,10 +380,10 @@ public function test_the_offset_and_the_limit_count_filtered_rows(): void
$batch instanceof Rows ? $batch->toArray() : [$batch->getMessage()]
),
iterator_to_array(
- (new FileReadLoop(
+ new FileReadLoop(
FileReadMother::of(schema(int_schema('id')), FileColumnsContext::discovering(names: []), 10),
new Criteria(conjuncts: [ref('id')->greaterThan(lit(5))]),
- ))->read(
+ )->read(
[new SourceFile(path('memory://a.csv'))],
$batches,
flow_context()->backend(),
@@ -407,10 +407,10 @@ public function test_the_loop_skips_the_offset_after_the_filter_for_a_format_tha
$batch instanceof Rows ? $batch->toArray() : [$batch->getMessage()]
),
iterator_to_array(
- (new FileReadLoop(
+ new FileReadLoop(
FileReadMother::of(schema(int_schema('id')), FileColumnsContext::discovering(names: []), 10),
new Criteria(conjuncts: [ref('id')->greaterThan(lit(5))]),
- ))->read(
+ )->read(
[new SourceFile(path('memory://a.csv'))],
$batches,
flow_context()->backend(),
@@ -438,10 +438,10 @@ public function test_a_limit_beside_a_filter_counts_matching_rows_across_files_a
$batch instanceof Rows ? $batch->toArray() : [$batch->getMessage()]
),
iterator_to_array(
- (new FileReadLoop(
+ new FileReadLoop(
FileReadMother::of(schema(int_schema('id')), FileColumnsContext::discovering(names: []), 10),
new Criteria(conjuncts: [ref('id')->greaterThan(lit(1))]),
- ))->read(
+ )->read(
[
new SourceFile(path('memory://a.csv')),
new SourceFile(path('memory://b.csv')),
@@ -472,10 +472,10 @@ public function test_the_rows_a_format_yields_after_its_skipped_rows_are_not_sli
$batch instanceof Rows ? $batch->toArray() : [$batch->getMessage()]
),
iterator_to_array(
- (new FileReadLoop(
+ new FileReadLoop(
FileReadMother::of($schema, FileColumnsContext::discovering(names: []), 10),
new Criteria(conjuncts: [ref('id')->greaterThan(lit(9))]),
- ))->read(
+ )->read(
[new SourceFile(path('memory://a.parquet'))],
new InMemoryFileBatches(
['memory://a.parquet' => [10, 11, 12]],
@@ -507,10 +507,10 @@ public function test_a_file_with_a_residual_between_exact_files_is_sliced_by_the
$batch instanceof Rows ? $batch->toArray() : [$batch->getMessage()]
),
iterator_to_array(
- (new FileReadLoop(
+ new FileReadLoop(
FileReadMother::of($schema, FileColumnsContext::discovering(names: []), 10),
new Criteria(conjuncts: [ref('id')->greaterThan(lit(2))]),
- ))->read(
+ )->read(
[
new SourceFile(path('memory://a.parquet')),
new SourceFile(path('memory://b.parquet')),
@@ -543,13 +543,13 @@ public function test_each_conjunct_of_the_filter_sees_only_the_rows_the_ones_bef
$batch instanceof Rows ? $batch->toArray() : [$batch->getMessage()]
),
iterator_to_array(
- (new FileReadLoop(
+ new FileReadLoop(
FileReadMother::of(schema(int_schema('id')), FileColumnsContext::discovering(names: []), 10),
new Criteria(conjuncts: [
ref('id')->notEquals(lit(0)),
lit(10)->divide(ref('id'))->greaterThan(lit(1)),
]),
- ))->read(
+ )->read(
[new SourceFile(path('memory://a.csv'))],
new InMemoryFileBatches(['memory://a.csv' => [0, 2, 10]]),
flow_context()->backend(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileReadTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileReadTest.php
index 616ed8819b..c22436844c 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileReadTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileReadTest.php
@@ -61,12 +61,12 @@ public function test_a_rebuilt_batch_size_is_at_least_one_and_keeps_one(): void
public function test_a_read_skips_the_offset_of_its_criteria(): void
{
- $rows = (new FileRead(
+ $rows = new FileRead(
new SourceFiles(MemoryFiles::with(['memory://a.csv' => 'abcd']), path('memory://a.csv')),
FileColumnsContext::discovering([]),
schema(int_schema('id')),
10,
- ))
+ )
->scan(
flow_context()->backend(),
new Criteria(offset: 2),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileSplitReaderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileSplitReaderTest.php
index 77f654edcb..1c875680d0 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileSplitReaderTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileSplitReaderTest.php
@@ -76,7 +76,7 @@ public function test_a_read_stopped_early_still_closes_the_batches(): void
public function test_a_read_abandoned_midway_still_closes_the_batches(): void
{
$batches = new InMemoryFileBatches(['memory://a.csv' => [1, 2, 3]]);
- $read = (new FileSplitReader(
+ $read = new FileSplitReader(
FileReadMother::of(
schema(int_schema('id')),
batchSize: 2,
@@ -84,7 +84,7 @@ public function test_a_read_abandoned_midway_still_closes_the_batches(): void
path: path('memory://a.csv'),
),
$batches,
- ))->extract(flow_context()->backend(), new Criteria());
+ )->extract(flow_context()->backend(), new Criteria());
$read->current();
unset($read);
@@ -95,7 +95,7 @@ public function test_a_read_abandoned_midway_still_closes_the_batches(): void
public function test_batches_that_do_not_describe_leave_the_reader_undescribed(): void
{
static::assertNull(
- (new FileSplitReader(
+ new FileSplitReader(
FileReadMother::of(
schema(int_schema('id')),
batchSize: 2,
@@ -103,7 +103,7 @@ public function test_batches_that_do_not_describe_leave_the_reader_undescribed()
path: path('memory://a.csv'),
),
new InMemoryFileBatches([]),
- ))->describe(),
+ )->describe(),
);
}
@@ -116,9 +116,9 @@ public function test_a_reject_loader_that_does_not_describe_leaves_the_reader_un
);
$batches = new FloeFileBatches(new NoopCodec(), 65_536, null);
- static::assertNotNull((new FileSplitReader($read, $batches))->describe());
+ static::assertNotNull(new FileSplitReader($read, $batches)->describe());
static::assertNull(
- (new FileSplitReader($read, $batches, new InlineLoader(static function (): void {})))->describe(),
+ new FileSplitReader($read, $batches, new InlineLoader(static function (): void {}))->describe(),
);
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileSplitTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileSplitTest.php
index c32b9f88e7..a426145ba5 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileSplitTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileSplitTest.php
@@ -33,7 +33,7 @@ public function test_a_negative_start_is_rejected(): void
public function test_a_null_length_means_to_the_end_of_the_file(): void
{
- static::assertNull((new FileSplit(path('memory://orders.csv'), 0, null))->length);
+ static::assertNull(new FileSplit(path('memory://orders.csv'), 0, null)->length);
}
public function test_a_zero_length_is_rejected(): void
@@ -55,23 +55,23 @@ public function test_it_accepts_the_smallest_valid_values(): void
public function test_only_the_window_at_the_start_of_the_file_is_first(): void
{
- static::assertTrue((new FileSplit(path('memory://orders.csv'), 0, null))->isFirst());
- static::assertFalse((new FileSplit(path('memory://orders.csv'), 1, null))->isFirst());
+ static::assertTrue(new FileSplit(path('memory://orders.csv'), 0, null)->isFirst());
+ static::assertFalse(new FileSplit(path('memory://orders.csv'), 1, null)->isFirst());
}
public function test_the_bytes_a_launcher_sizes_by_are_the_window_length(): void
{
- static::assertSame(8_388_608, (new FileSplit(path('memory://orders.csv'), 0, 8_388_608, 20_000_000))->bytes());
+ static::assertSame(8_388_608, new FileSplit(path('memory://orders.csv'), 0, 8_388_608, 20_000_000)->bytes());
}
public function test_the_bytes_of_a_whole_file_split_are_the_listed_file_size(): void
{
- static::assertSame(20_000_000, (new FileSplit(path('memory://orders.csv'), 0, null, 20_000_000))->bytes());
+ static::assertSame(20_000_000, new FileSplit(path('memory://orders.csv'), 0, null, 20_000_000)->bytes());
}
public function test_the_bytes_of_an_unlisted_whole_file_split_are_unknown(): void
{
- static::assertSame(0, (new FileSplit(path('memory://orders.csv'), 0, null))->bytes());
+ static::assertSame(0, new FileSplit(path('memory://orders.csv'), 0, null)->bytes());
}
public function test_it_is_a_window_of_one_file(): void
@@ -107,7 +107,7 @@ public function test_a_split_describes_itself_and_is_rebuilt_equal(): void
$split->describe()->data,
);
static::assertFalse($split->describe()->sensitive());
- static::assertEquals($split, (new Rebuild())->object(
+ static::assertEquals($split, new Rebuild()->object(
Description::fromArray($split->describe()->normalize()),
Split::class,
));
@@ -117,7 +117,7 @@ public function test_an_unsized_window_to_the_end_rebuilds_with_nulls(): void
{
$split = new FileSplit(path('memory://orders.csv'), 0, null);
- static::assertEquals($split, (new Rebuild())->object($split->describe(), FileSplit::class));
+ static::assertEquals($split, new Rebuild()->object($split->describe(), FileSplit::class));
}
public function test_a_file_smaller_than_the_target_is_one_window(): void
@@ -165,7 +165,7 @@ public function test_a_split_without_a_length_owns_every_unit(): void
{
static::assertEquals(
new RowRange(0, 30),
- (new FileSplit(path('memory://a.parquet'), 0, null))->owns([
+ new FileSplit(path('memory://a.parquet'), 0, null)->owns([
new ByteUnit(4, 100, 10),
new ByteUnit(104, 100, 20),
]),
@@ -189,7 +189,7 @@ public function test_a_window_holding_no_midpoint_owns_nothing(): void
{
static::assertEquals(
new RowRange(10, 0),
- (new FileSplit(path('memory://a.parquet'), 100, 10))->owns([
+ new FileSplit(path('memory://a.parquet'), 100, 10)->owns([
new ByteUnit(4, 100, 10),
new ByteUnit(104, 100, 20),
]),
@@ -236,7 +236,7 @@ public function test_the_first_window_starts_at_zero_and_ends_at_the_end_boundar
static::assertSame(
'01234',
- (new FileSplit(path('memory://f.txt'), 0, 4))
+ new FileSplit(path('memory://f.txt'), 0, 4)
->window($stream, 2, 5)
->content(),
);
@@ -246,7 +246,7 @@ public function test_a_later_window_starts_at_its_start_boundary(): void
{
static::assertSame(
'23456789',
- (new FileSplit(path('memory://f.txt'), 1, null))
+ new FileSplit(path('memory://f.txt'), 1, null)
->window(self::content('0123456789'), 2, null)
->content(),
);
@@ -256,7 +256,7 @@ public function test_a_window_without_a_start_boundary_is_empty(): void
{
static::assertSame(
'',
- (new FileSplit(path('memory://f.txt'), 3, 2))
+ new FileSplit(path('memory://f.txt'), 3, 2)
->window(self::content('0123456789'), null, 7)
->content(),
);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FooterStatisticsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FooterStatisticsTest.php
index 07a33ac133..bd123dc2ea 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FooterStatisticsTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FooterStatisticsTest.php
@@ -16,7 +16,7 @@ public function test_every_listed_footer_read_is_exact(): void
{
static::assertEquals(
new Statistics(rows: Cardinality::exact(30), size: Cardinality::exact(300)),
- (new FooterStatistics(new Statistics(Cardinality::exact(30), Cardinality::exact(300)), 3))->of(3),
+ new FooterStatistics(new Statistics(Cardinality::exact(30), Cardinality::exact(300)), 3)->of(3),
);
}
@@ -24,7 +24,7 @@ public function test_the_first_footer_is_scaled_to_the_listing(): void
{
static::assertEquals(
new Statistics(rows: Cardinality::approximately(40), size: Cardinality::approximately(400)),
- (new FooterStatistics(new Statistics(Cardinality::exact(10), Cardinality::exact(100)), 1))->of(4),
+ new FooterStatistics(new Statistics(Cardinality::exact(10), Cardinality::exact(100)), 1)->of(4),
);
}
@@ -32,7 +32,7 @@ public function test_no_footer_read_is_zero_exactly(): void
{
static::assertEquals(
new Statistics(rows: Cardinality::exact(0), size: Cardinality::exact(0)),
- (new FooterStatistics(new Statistics(Cardinality::exact(0), Cardinality::exact(0)), 0))->of(0),
+ new FooterStatistics(new Statistics(Cardinality::exact(0), Cardinality::exact(0)), 0)->of(0),
);
}
@@ -40,7 +40,7 @@ public function test_unknown_footer_statistics_count_as_zero(): void
{
static::assertEquals(
new Statistics(rows: Cardinality::exact(0), size: Cardinality::exact(0)),
- (new FooterStatistics(new Statistics(Cardinality::unknown(), Cardinality::unknown()), 3))->of(3),
+ new FooterStatistics(new Statistics(Cardinality::unknown(), Cardinality::unknown()), 3)->of(3),
);
}
@@ -48,7 +48,7 @@ public function test_no_footer_read_keeps_the_statistics_exact_for_any_listing()
{
static::assertEquals(
new Statistics(rows: Cardinality::exact(10), size: Cardinality::exact(100)),
- (new FooterStatistics(new Statistics(Cardinality::exact(10), Cardinality::exact(100)), 0))->of(4),
+ new FooterStatistics(new Statistics(Cardinality::exact(10), Cardinality::exact(100)), 0)->of(4),
);
}
@@ -56,11 +56,11 @@ public function test_a_scaled_estimate_rounds_to_the_nearest_integer(): void
{
static::assertEquals(
new Statistics(rows: Cardinality::approximately(13), size: Cardinality::approximately(133)),
- (new FooterStatistics(new Statistics(Cardinality::exact(10), Cardinality::exact(100)), 3))->of(4),
+ new FooterStatistics(new Statistics(Cardinality::exact(10), Cardinality::exact(100)), 3)->of(4),
);
static::assertEquals(
new Statistics(rows: Cardinality::approximately(7), size: Cardinality::approximately(67)),
- (new FooterStatistics(new Statistics(Cardinality::exact(5), Cardinality::exact(50)), 3))->of(4),
+ new FooterStatistics(new Statistics(Cardinality::exact(5), Cardinality::exact(50)), 3)->of(4),
);
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/InferredColumnsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/InferredColumnsTest.php
index 1ffe8b8032..5e8c9b4d26 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/InferredColumnsTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/InferredColumnsTest.php
@@ -19,24 +19,24 @@ public function test_a_file_with_the_inferred_columns_in_any_order_passes(): voi
{
$this->expectNotToPerformAssertions();
- (new InferredColumns(
+ new InferredColumns(
schema(int_schema('id'), str_schema('name')),
['_input_file_uri'],
new SchemaInference(),
'memory://a.csv',
- ))->refuseDivergence('memory://b.csv', ['name', 'id', 'id', '_input_file_uri']);
+ )->refuseDivergence('memory://b.csv', ['name', 'id', 'id', '_input_file_uri']);
}
public function test_a_file_without_columns_passes(): void
{
$this->expectNotToPerformAssertions();
- (new InferredColumns(
+ new InferredColumns(
schema(int_schema('id'), str_schema('name')),
['_input_file_uri'],
new SchemaInference(),
'memory://a.csv',
- ))->refuseDivergence('memory://empty.csv', []);
+ )->refuseDivergence('memory://empty.csv', []);
}
public function test_a_file_whose_columns_diverge_is_refused_naming_both_sources(): void
@@ -46,12 +46,12 @@ public function test_a_file_whose_columns_diverge_is_refused_naming_both_sources
'Columns of memory://b.csv do not match the schema inferred from memory://a.csv: unexpected [age], missing [name]',
);
- (new InferredColumns(
+ new InferredColumns(
schema(int_schema('id'), str_schema('name')),
['_input_file_uri'],
new SchemaInference(),
'memory://a.csv',
- ))->refuseDivergence('memory://b.csv', ['id', 'age']);
+ )->refuseDivergence('memory://b.csv', ['id', 'age']);
}
public function test_normalize_round_trips_and_the_rebuilt_check_refuses_the_same_divergence(): void
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/ListingScanTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/ListingScanTest.php
index 7622970447..26633852d5 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/ListingScanTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/ListingScanTest.php
@@ -36,7 +36,7 @@ public function test_each_listed_file_is_one_row_in_batches_of_the_batch_size():
array_map(
static fn(Rows $rows): array => $rows->reduceToArray('path'),
iterator_to_array(
- (new ListingScan(
+ new ListingScan(
new SourceFiles(MemoryFiles::with([
'memory://dir/a' => 'a',
'memory://dir/b' => 'b',
@@ -44,7 +44,7 @@ public function test_each_listed_file_is_one_row_in_batches_of_the_batch_size():
]), path('memory://dir/*')),
new FileColumns([], new PartitionTypes(), false),
new PathPartitionsRow(),
- ))->scan(
+ )->scan(
flow_context()->backend(),
new Criteria(),
schema(str_schema('path'), map_schema('partitions', type_map(type_string(), type_string()))),
@@ -63,7 +63,7 @@ public function test_a_batch_holds_only_the_files_every_conjunct_keeps_and_an_em
array_map(
static fn(Rows $rows): array => $rows->reduceToArray('path'),
iterator_to_array(
- (new ListingScan(
+ new ListingScan(
new SourceFiles(MemoryFiles::with([
'memory://dir/a' => 'a',
'memory://dir/b' => 'b',
@@ -71,7 +71,7 @@ public function test_a_batch_holds_only_the_files_every_conjunct_keeps_and_an_em
]), path('memory://dir/*')),
new FileColumns([], new PartitionTypes(), false),
new PathPartitionsRow(),
- ))->scan(
+ )->scan(
flow_context()->backend(),
new Criteria(conjuncts: [
ref('path')->notEquals(lit('memory://dir/a')),
@@ -89,7 +89,7 @@ public function test_a_batch_holds_only_the_files_every_conjunct_keeps_and_an_em
public function test_the_scan_stops_once_the_limit_of_rows_is_handed_out(): void
{
static::assertCount(1, iterator_to_array(
- (new ListingScan(
+ new ListingScan(
new SourceFiles(MemoryFiles::with([
'memory://dir/a' => 'a',
'memory://dir/b' => 'b',
@@ -97,7 +97,7 @@ public function test_the_scan_stops_once_the_limit_of_rows_is_handed_out(): void
]), path('memory://dir/*')),
new FileColumns([], new PartitionTypes(), false),
new PathPartitionsRow(),
- ))->scan(
+ )->scan(
flow_context()->backend(),
new Criteria(limit: 1),
schema(str_schema('path'), map_schema('partitions', type_map(type_string(), type_string()))),
@@ -114,7 +114,7 @@ public function test_an_offset_skips_the_listed_files_the_filter_keeps(): void
array_map(
static fn(Rows $rows): array => $rows->reduceToArray('path'),
iterator_to_array(
- (new ListingScan(
+ new ListingScan(
new SourceFiles(MemoryFiles::with([
'memory://dir/a' => 'a',
'memory://dir/b' => 'b',
@@ -123,7 +123,7 @@ public function test_an_offset_skips_the_listed_files_the_filter_keeps(): void
]), path('memory://dir/*')),
new FileColumns([], new PartitionTypes(), false),
new PathPartitionsRow(),
- ))->scan(
+ )->scan(
flow_context()->backend(),
new Criteria(offset: 1, conjuncts: [ref('path')->notEquals(lit('memory://dir/a'))]),
schema(str_schema('path'), map_schema('partitions', type_map(type_string(), type_string()))),
@@ -142,7 +142,7 @@ public function test_a_batch_past_the_limit_is_trimmed_to_it(): void
array_map(
static fn(Rows $rows): array => $rows->reduceToArray('path'),
iterator_to_array(
- (new ListingScan(
+ new ListingScan(
new SourceFiles(MemoryFiles::with([
'memory://dir/a' => 'a',
'memory://dir/b' => 'b',
@@ -150,7 +150,7 @@ public function test_a_batch_past_the_limit_is_trimmed_to_it(): void
]), path('memory://dir/*')),
new FileColumns([], new PartitionTypes(), false),
new PathPartitionsRow(),
- ))->scan(
+ )->scan(
flow_context()->backend(),
new Criteria(limit: 2),
schema(str_schema('path'), map_schema('partitions', type_map(type_string(), type_string()))),
@@ -164,14 +164,14 @@ public function test_a_batch_past_the_limit_is_trimmed_to_it(): void
public function test_a_stop_signal_ends_the_scan(): void
{
- $criteria = (new ListingScan(
+ $criteria = new ListingScan(
new SourceFiles(MemoryFiles::with([
'memory://dir/a' => 'a',
'memory://dir/b' => 'b',
]), path('memory://dir/*')),
new FileColumns([], new PartitionTypes(), false),
new PathPartitionsRow(),
- ))->scan(
+ )->scan(
flow_context()->backend(),
new Criteria(),
schema(str_schema('path'), map_schema('partitions', type_map(type_string(), type_string()))),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/MetadataColumnsExtractorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/MetadataColumnsExtractorTest.php
index e0a27c4edc..bff65cd93d 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/MetadataColumnsExtractorTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/MetadataColumnsExtractorTest.php
@@ -27,7 +27,7 @@ public static function classesDeclaringMetadataColumns(): array
$declaring = [];
foreach (ExtractorClasses::all(ExtractorClasses::root('core/etl')) as $class) {
- if ((new ReflectionClass($class))->implementsInterface(MetadataColumnsExtractor::class)) {
+ if (new ReflectionClass($class)->implementsInterface(MetadataColumnsExtractor::class)) {
$declaring[] = $class;
}
}
@@ -41,7 +41,7 @@ public static function classesDeclaringMetadataColumns(): array
public static function provide_extractor_classes_without_metadata(): Generator
{
foreach (ExtractorClasses::all(ExtractorClasses::root('core/etl')) as $class) {
- if (!(new ReflectionClass($class))->implementsInterface(MetadataColumnsExtractor::class)) {
+ if (!new ReflectionClass($class)->implementsInterface(MetadataColumnsExtractor::class)) {
yield $class => [$class];
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/PartitionTypesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/PartitionTypesTest.php
index 9d107515b1..6db0655cd5 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/PartitionTypesTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/PartitionTypesTest.php
@@ -63,7 +63,7 @@ public function test_an_undeclared_name_is_refused_by_get(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('No partition type declared for "month"');
- (new PartitionTypes())->get('month');
+ new PartitionTypes()->get('month');
}
public function test_the_dsl_delegates_without_normalising(): void
@@ -80,6 +80,6 @@ public function test_normalize_round_trips_every_type(): void
$types->normalize(),
);
static::assertEquals($types, PartitionTypes::fromArray($types->normalize()));
- static::assertSame([], (new PartitionTypes())->normalize());
+ static::assertSame([], new PartitionTypes()->normalize());
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/PathPartitionsRowTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/PathPartitionsRowTest.php
index 8f34764aaf..1916b6e8c8 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/PathPartitionsRowTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/PathPartitionsRowTest.php
@@ -16,8 +16,8 @@ final class PathPartitionsRowTest extends FlowTestCase
public function test_the_schema_names_every_column_of_the_row_and_no_partition_column(): void
{
static::assertSame(
- array_keys((new PathPartitionsRow())->row(new FileStatus(path('memory://dir/year=2024/a.csv'), true))),
- (new PathPartitionsRow())->schema()->names(),
+ array_keys(new PathPartitionsRow()->row(new FileStatus(path('memory://dir/year=2024/a.csv'), true))),
+ new PathPartitionsRow()->schema()->names(),
);
}
@@ -25,7 +25,7 @@ public function test_a_file_is_described_by_its_uri_and_its_partitions(): void
{
static::assertSame(
['path' => 'memory://dir/year=2024/month=01/a.csv', 'partitions' => ['year' => '2024', 'month' => '01']],
- (new PathPartitionsRow())->row(new FileStatus(path('memory://dir/year=2024/month=01/a.csv'), true)),
+ new PathPartitionsRow()->row(new FileStatus(path('memory://dir/year=2024/month=01/a.csv'), true)),
);
}
@@ -33,7 +33,7 @@ public function test_a_file_outside_partitions_has_none(): void
{
static::assertSame(
[],
- (new PathPartitionsRow())->row(new FileStatus(path('memory://dir/a.csv'), true))['partitions'],
+ new PathPartitionsRow()->row(new FileStatus(path('memory://dir/a.csv'), true))['partitions'],
);
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/ReadWindowTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/ReadWindowTest.php
index f9c25a50a9..e5885a98a9 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/ReadWindowTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/ReadWindowTest.php
@@ -32,7 +32,7 @@ public function test_a_negative_limit_is_refused(): void
public function test_a_zero_limit_is_accepted(): void
{
- static::assertSame(0, (new ReadWindow(limit: 0))->limit);
+ static::assertSame(0, new ReadWindow(limit: 0)->limit);
}
public function test_the_default_window_skips_nothing_and_wants_everything(): void
@@ -49,12 +49,12 @@ public function test_trim_cuts_rows_to_what_the_limit_still_wants(): void
static::assertSame(
[['id' => 1]],
- (new ReadWindow(limit: 3))
+ new ReadWindow(limit: 3)
->trim($rows, 2)
->toArray(),
);
- static::assertSame($rows, (new ReadWindow(limit: 5))->trim($rows, 2));
- static::assertSame($rows, (new ReadWindow())->trim($rows, 100));
+ static::assertSame($rows, new ReadWindow(limit: 5)->trim($rows, 2));
+ static::assertSame($rows, new ReadWindow()->trim($rows, 100));
}
public function test_skip_drops_what_the_offset_still_skips(): void
@@ -63,30 +63,30 @@ public function test_skip_drops_what_the_offset_still_skips(): void
static::assertSame(
[['id' => 3]],
- (new ReadWindow(offset: 4))
+ new ReadWindow(offset: 4)
->skip($rows, 2)
->toArray(),
);
static::assertSame(
[],
- (new ReadWindow(offset: 4))
+ new ReadWindow(offset: 4)
->skip($rows, 0)
->toArray(),
);
static::assertSame(
[],
- (new ReadWindow(offset: 3))
+ new ReadWindow(offset: 3)
->skip($rows, 0)
->toArray(),
);
- static::assertSame($rows, (new ReadWindow(offset: 2))->skip($rows, 2));
- static::assertSame($rows, (new ReadWindow())->skip($rows, 0));
+ static::assertSame($rows, new ReadWindow(offset: 2)->skip($rows, 2));
+ static::assertSame($rows, new ReadWindow()->skip($rows, 0));
}
public function test_reached_only_once_the_limit_was_yielded(): void
{
- static::assertFalse((new ReadWindow(limit: 3))->reached(2));
- static::assertTrue((new ReadWindow(limit: 3))->reached(3));
- static::assertFalse((new ReadWindow())->reached(1_000));
+ static::assertFalse(new ReadWindow(limit: 3)->reached(2));
+ static::assertTrue(new ReadWindow(limit: 3)->reached(3));
+ static::assertFalse(new ReadWindow()->reached(1_000));
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/SkippedRowsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/SkippedRowsTest.php
index 0ac71f1f5d..58307c5cb9 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/SkippedRowsTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/SkippedRowsTest.php
@@ -12,12 +12,12 @@ final class SkippedRowsTest extends FlowTestCase
{
public function test_it_carries_the_rows_skipped(): void
{
- static::assertSame(3, (new SkippedRows(3))->count);
+ static::assertSame(3, new SkippedRows(3)->count);
}
public function test_zero_skipped_rows_are_accepted(): void
{
- static::assertSame(0, (new SkippedRows(0))->count);
+ static::assertSame(0, new SkippedRows(0)->count);
}
public function test_a_negative_count_is_refused(): void
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/SourceFileTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/SourceFileTest.php
index b4266957f5..6aeff207a5 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/SourceFileTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/SourceFileTest.php
@@ -13,14 +13,14 @@ final class SourceFileTest extends FlowTestCase
{
public function test_a_path_without_partitions_carries_no_values(): void
{
- static::assertSame([], (new SourceFile(path('memory://orders/data.csv')))->partitionValues);
+ static::assertSame([], new SourceFile(path('memory://orders/data.csv'))->partitionValues);
}
public function test_partition_values_come_from_the_path(): void
{
static::assertSame(
['country' => 'PL', 'year' => '2024'],
- (new SourceFile(path('memory://orders/country=PL/year=2024/data.csv')))->partitionValues,
+ new SourceFile(path('memory://orders/country=PL/year=2024/data.csv'))->partitionValues,
);
}
@@ -28,18 +28,18 @@ public function test_uri_is_the_paths_uri(): void
{
static::assertSame(
'memory://orders/year=2024/data.csv',
- (new SourceFile(path('memory://orders/year=2024/data.csv')))->uri(),
+ new SourceFile(path('memory://orders/year=2024/data.csv'))->uri(),
);
}
public function test_it_carries_the_listed_size(): void
{
- static::assertSame(1024, (new SourceFile(path('memory://orders/data.csv'), 1024))->size);
+ static::assertSame(1024, new SourceFile(path('memory://orders/data.csv'), 1024)->size);
}
public function test_a_size_may_be_absent(): void
{
- static::assertNull((new SourceFile(path('memory://orders/data.csv')))->size);
+ static::assertNull(new SourceFile(path('memory://orders/data.csv'))->size);
}
public function test_it_normalizes_and_rebuilds_equal(): void
@@ -50,7 +50,7 @@ public function test_it_normalizes_and_rebuilds_equal(): void
static::assertEquals($source, SourceFile::fromArray($source->normalize()));
static::assertEquals(
new SourceFile(path('memory://a.csv')),
- SourceFile::fromArray((new SourceFile(path('memory://a.csv')))->normalize()),
+ SourceFile::fromArray(new SourceFile(path('memory://a.csv'))->normalize()),
);
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/SourceFilesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/SourceFilesTest.php
index 6bcc91f03f..e3567fe988 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/SourceFilesTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/SourceFilesTest.php
@@ -28,7 +28,7 @@ public function test_a_sized_split_names_its_file_without_listing(): void
static::assertEquals(
[new SourceFile(path('memory://dir/a.csv'), 7)],
- (new SourceFiles($counting, path('memory://dir/*.csv')))->of((new Criteria())->withSplit(
+ new SourceFiles($counting, path('memory://dir/*.csv'))->of(new Criteria()->withSplit(
new FileSplit(path('memory://dir/a.csv'), 0, null, 7),
)),
);
@@ -44,7 +44,7 @@ public function test_an_unsized_split_lists_its_path(): void
static::assertEquals(
[new SourceFile(path('memory://dir/b.csv'), 2)],
- (new SourceFiles($counting, path('memory://dir/*.csv')))->of((new Criteria())->withSplit(
+ new SourceFiles($counting, path('memory://dir/*.csv'))->of(new Criteria()->withSplit(
new FileSplit(path('memory://dir/b.csv'), 0, null),
)),
);
@@ -126,10 +126,10 @@ public function test_windows_of_consecutive_files_follow_the_listing_order(): vo
new FileSplit(path('memory://orders/a.csv'), 1, 1, 2),
new FileSplit(path('memory://orders/c.csv'), 0, 1, 1),
],
- (new SourceFiles(MemoryFiles::with([
+ new SourceFiles(MemoryFiles::with([
'memory://orders/a.csv' => 'ab',
'memory://orders/c.csv' => 'c',
- ]), path('memory://orders/*.csv')))->byteWindows(1),
+ ]), path('memory://orders/*.csv'))->byteWindows(1),
);
}
@@ -192,9 +192,9 @@ public function test_a_listing_without_partitions_names_none(): void
{
static::assertSame(
[],
- (new SourceFiles(MemoryFiles::with([
+ new SourceFiles(MemoryFiles::with([
'memory://plain/data.csv' => 'id',
- ]), path('memory://plain/*.csv')))->partitionNames(),
+ ]), path('memory://plain/*.csv'))->partitionNames(),
);
}
@@ -202,9 +202,9 @@ public function test_partition_names_are_sorted_by_name_not_by_path_order(): voi
{
static::assertSame(
['month' => false, 'region' => false, 'year' => false],
- (new SourceFiles(MemoryFiles::with([
+ new SourceFiles(MemoryFiles::with([
'memory://sorted/year=2026/month=01/region=eu/data.csv' => 'id',
- ]), path('memory://sorted/*/*/*/*.csv')))->partitionNames(),
+ ]), path('memory://sorted/*/*/*/*.csv'))->partitionNames(),
);
}
@@ -212,10 +212,10 @@ public function test_a_partition_only_some_paths_carry_is_nullable(): void
{
static::assertSame(
['date' => true],
- (new SourceFiles(MemoryFiles::with([
+ new SourceFiles(MemoryFiles::with([
'memory://mixed/date=2026-01-01/data.csv' => 'id',
'memory://mixed/plain/data.csv' => 'id',
- ]), path('memory://mixed/*/*.csv')))->partitionNames(),
+ ]), path('memory://mixed/*/*.csv'))->partitionNames(),
);
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/FileListingExtractorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/FileListingExtractorTest.php
index ca2fbe32eb..07ec169f4e 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/FileListingExtractorTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/FileListingExtractorTest.php
@@ -260,7 +260,7 @@ public function test_extract_split_stops_on_the_stop_signal(): void
->withBatchSize(1)
->extract(
flow_context()->backend(),
- (new Criteria())->withSplit(
+ new Criteria()->withSplit(
new FileSplit(path(__DIR__ . '/../../../Fixtures/FileListExtractor/*'), 0, null),
),
);
@@ -282,7 +282,7 @@ public function test_a_split_reads_one_listed_file(): void
'memory://dir/b.txt' => 'bb',
]))->extract(
flow_context()->backend(),
- (new Criteria())->withSplit(new FileSplit(path('memory://dir/b.txt'), 0, null)),
+ new Criteria()->withSplit(new FileSplit(path('memory://dir/b.txt'), 0, null)),
),
false,
);
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/Grid/GridHeaderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/Grid/GridHeaderTest.php
index 80f7d4dda2..421c09e695 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/Grid/GridHeaderTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/Grid/GridHeaderTest.php
@@ -21,12 +21,12 @@ public function test_it_normalizes_and_rebuilds_equal(): void
{
static::assertSame(
['names' => ['id'], 'source' => 'file:///a.csv'],
- (new GridHeader(['id'], 'file:///a.csv'))->normalize(),
+ new GridHeader(['id'], 'file:///a.csv')->normalize(),
);
static::assertEquals(
new GridHeader(['id'], 'file:///a.csv'),
- GridHeader::fromArray((new GridHeader(['id'], 'file:///a.csv'))->normalize()),
+ GridHeader::fromArray(new GridHeader(['id'], 'file:///a.csv')->normalize()),
);
- static::assertEquals(new GridHeader([], null), GridHeader::fromArray((new GridHeader([], null))->normalize()));
+ static::assertEquals(new GridHeader([], null), GridHeader::fromArray(new GridHeader([], null)->normalize()));
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/Grid/HeaderNamesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/Grid/HeaderNamesTest.php
index db4e7d4904..deaa9e0c07 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/Grid/HeaderNamesTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/Grid/HeaderNamesTest.php
@@ -12,19 +12,19 @@ final class HeaderNamesTest extends FlowTestCase
{
public function test_scalar_cells_are_trimmed_text(): void
{
- static::assertSame(['id', '1', '2.5', '1'], (new HeaderNames())->of([' id ', 1, 2.5, true]));
+ static::assertSame(['id', '1', '2.5', '1'], new HeaderNames()->of([' id ', 1, 2.5, true]));
}
public function test_form_feed_padded_header_is_trimmed(): void
{
- static::assertSame(['id', 'name'], (new HeaderNames())->of(["\fid", "name\f"]));
+ static::assertSame(['id', 'name'], new HeaderNames()->of(["\fid", "name\f"]));
}
public function test_a_blank_or_non_scalar_cell_is_named_by_its_position(): void
{
static::assertSame(
['e00', 'e01', 'e02', 'name', 'e04'],
- (new HeaderNames())->of(['', null, ' ', 'name', new DateTimeImmutable('2026-01-01')]),
+ new HeaderNames()->of(['', null, ' ', 'name', new DateTimeImmutable('2026-01-01')]),
);
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/Grid/RecordDecoderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/Grid/RecordDecoderTest.php
index b06349441c..2359745db3 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/Grid/RecordDecoderTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/Grid/RecordDecoderTest.php
@@ -137,7 +137,7 @@ public function test_an_empty_record_is_no_row_before_and_after_the_header(array
public function test_headers_are_null_before_the_first_decode(): void
{
- static::assertNull((new RecordDecoder(withHeader: true, emptyToNull: true))->headers());
+ static::assertNull(new RecordDecoder(withHeader: true, emptyToNull: true)->headers());
}
/**
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/Memory/InMemoryRowsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/Memory/InMemoryRowsTest.php
index 3f29710a37..8e53ea9ffc 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/Memory/InMemoryRowsTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/Memory/InMemoryRowsTest.php
@@ -25,14 +25,14 @@ public function test_positional_keys_are_named_like_the_hydrator_names_them(): v
{
static::assertSame(
['e00', 'e01'],
- array_keys(iterator_to_array((new InMemoryRows([[1, 2]]))->values(), false)[0]),
+ array_keys(iterator_to_array(new InMemoryRows([[1, 2]])->values(), false)[0]),
);
}
public function test_the_dataset_is_one_unit_without_a_header(): void
{
- static::assertSame(1, (new InMemoryRows([['id' => 1]]))->units());
- static::assertSame([], (new InMemoryRows([['id' => 1]]))->names());
+ static::assertSame(1, new InMemoryRows([['id' => 1]])->units());
+ static::assertSame([], new InMemoryRows([['id' => 1]])->names());
}
public function test_a_sample_is_complete_only_below_its_budget_and_has_no_bytes(): void
@@ -50,11 +50,11 @@ public function test_sniff_folds_at_most_its_budget(): void
{
static::assertSame(
1,
- (new InMemoryRows([['id' => 1], ['id' => 2], ['id' => 3]]))->sniff(0, 1, new VoidProgress())->columns->rows,
+ new InMemoryRows([['id' => 1], ['id' => 2], ['id' => 3]])->sniff(0, 1, new VoidProgress())->columns->rows,
);
static::assertSame(
3,
- (new InMemoryRows([['id' => 1], ['id' => 2], ['id' => 3]]))
+ new InMemoryRows([['id' => 1], ['id' => 2], ['id' => 3]])
->sniff(0, null, new VoidProgress())
->columns
->rows,
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/SequenceExtractorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/SequenceExtractorTest.php
index f28f001003..f3c56615a2 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/SequenceExtractorTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/SequenceExtractorTest.php
@@ -167,15 +167,15 @@ public function test_extracting_from_numbers_range(): void
public function test_a_bounded_sample_types_only_its_prefix(): void
{
- $extractor = (new SequenceExtractor(
+ $extractor = new SequenceExtractor(
new MixedSequenceGenerator(),
'code',
- ))->inferSchema(infer_schema()->sampleSize(1));
+ )->inferSchema(infer_schema()->sampleSize(1));
static::assertSame('integer', $extractor->schema()->get('code')->type()->toString());
static::assertSame(
'string',
- (new SequenceExtractor(new MixedSequenceGenerator(), 'code'))
+ new SequenceExtractor(new MixedSequenceGenerator(), 'code')
->schema()
->get('code')
->type()
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/SequenceGenerator/DatePeriodSequenceGeneratorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/SequenceGenerator/DatePeriodSequenceGeneratorTest.php
index e53b4346fc..0312e4b9c2 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/SequenceGenerator/DatePeriodSequenceGeneratorTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/SequenceGenerator/DatePeriodSequenceGeneratorTest.php
@@ -19,13 +19,13 @@ public function test_an_empty_period_declares_zero_rows(): void
{
static::assertEquals(
Cardinality::exact(0),
- (new DatePeriodSequenceGenerator(
+ new DatePeriodSequenceGenerator(
new DatePeriod(
new DateTimeImmutable('2023-01-10'),
new DateInterval('P1D'),
new DateTimeImmutable('2023-01-01'),
),
- ))->rows(),
+ )->rows(),
);
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/SequenceGenerator/NumberSequenceGeneratorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/SequenceGenerator/NumberSequenceGeneratorTest.php
index 79f967498a..456c3306e5 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/SequenceGenerator/NumberSequenceGeneratorTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/SequenceGenerator/NumberSequenceGeneratorTest.php
@@ -60,7 +60,7 @@ public function test_generate_yields_the_values_range_yields(
array $expected,
): void {
static::assertSame($expected, iterator_to_array(
- (new NumberSequenceGenerator($start, $end, $step))->generate(),
+ new NumberSequenceGenerator($start, $end, $step)->generate(),
false,
));
static::assertSame(range($start, $end, $step), $expected);
@@ -68,7 +68,7 @@ public function test_generate_yields_the_values_range_yields(
public function test_an_integer_sequence_is_generated_without_building_it_first(): void
{
- $generator = (new NumberSequenceGenerator(0, PHP_INT_MAX))->generate();
+ $generator = new NumberSequenceGenerator(0, PHP_INT_MAX)->generate();
static::assertSame(0, $generator->current());
$generator->next();
@@ -83,7 +83,7 @@ public function test_a_step_the_range_rejects_is_rejected_the_same_way(int $star
{
$this->expectException(ValueError::class);
- (new NumberSequenceGenerator($start, $end, $step))->rows();
+ new NumberSequenceGenerator($start, $end, $step)->rows();
}
public function test_generate_rejects_a_step_wider_than_the_span(): void
@@ -93,7 +93,7 @@ public function test_generate_rejects_a_step_wider_than_the_span(): void
'range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end)',
);
- iterator_to_array((new NumberSequenceGenerator(2, 3, 4))->generate());
+ iterator_to_array(new NumberSequenceGenerator(2, 3, 4)->generate());
}
public function test_generate_rejects_a_zero_step_the_way_range_does(): void
@@ -101,6 +101,6 @@ public function test_generate_rejects_a_zero_step_the_way_range_does(): void
$this->expectException(ValueError::class);
$this->expectExceptionMessage('range(): Argument #3 ($step) cannot be 0');
- iterator_to_array((new NumberSequenceGenerator(1, 10, 0))->generate());
+ iterator_to_array(new NumberSequenceGenerator(1, 10, 0)->generate());
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/StatisticsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/StatisticsTest.php
index 38558009d7..e343f44d35 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/StatisticsTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/StatisticsTest.php
@@ -22,7 +22,7 @@ public function test_merge_adds_rows_and_size_independently(): void
{
static::assertEquals(
new Statistics(Cardinality::exact(30), Cardinality::approximately(300)),
- (new Statistics(Cardinality::exact(10), Cardinality::approximately(100)))->merge(
+ new Statistics(Cardinality::exact(10), Cardinality::approximately(100))->merge(
new Statistics(Cardinality::exact(20), Cardinality::exact(200)),
),
);
@@ -32,7 +32,7 @@ public function test_merging_with_an_unknown_partial_yields_unknown(): void
{
static::assertEquals(
new Statistics(),
- (new Statistics(Cardinality::exact(10), Cardinality::exact(100)))->merge(new Statistics()),
+ new Statistics(Cardinality::exact(10), Cardinality::exact(100))->merge(new Statistics()),
);
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Filesystem/ScalarFunctionFilterTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Filesystem/ScalarFunctionFilterTest.php
index 776a9b7151..83310aeef5 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Filesystem/ScalarFunctionFilterTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Filesystem/ScalarFunctionFilterTest.php
@@ -32,16 +32,16 @@ public function test_a_declared_partition_the_path_lacks_is_evaluated_as_null_as
$partitions = schema(str_schema('year', nullable: true));
$file = new FileStatus(path('memory://part/a.parquet'), true);
- static::assertTrue((new ScalarFunctionFilter(
+ static::assertTrue(new ScalarFunctionFilter(
ref('year')->isNull(),
$partitions,
flow_context()->backend(),
- ))->accept($file));
- static::assertFalse((new ScalarFunctionFilter(
+ )->accept($file));
+ static::assertFalse(new ScalarFunctionFilter(
ref('year')->equals(lit('2023')),
$partitions,
flow_context()->backend(),
- ))->accept($file));
+ )->accept($file));
}
public function test_a_listing_keeps_the_files_of_every_partition_the_function_accepts(): void
@@ -111,21 +111,21 @@ public function test_function_is_the_one_given_not_its_resolved_copy(): void
static::assertSame(
$function,
- (new ScalarFunctionFilter(
+ new ScalarFunctionFilter(
$function,
schema(int_schema('year')),
flow_context(config())->backend(),
- ))->function(),
+ )->function(),
);
}
public function test_accept_evaluates_the_resolved_function(): void
{
- static::assertTrue((new ScalarFunctionFilter(
+ static::assertTrue(new ScalarFunctionFilter(
new ReportsResolvedOperand(ref('year')),
schema(int_schema('year')),
flow_context(config())->backend(),
- ))->accept(new FileStatus(path('flow-file://data/year=2024/file.csv'), true)));
+ )->accept(new FileStatus(path('flow-file://data/year=2024/file.csv'), true)));
}
public function test_a_hive_null_partition_value_against_a_declared_nullable_type(): void
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Filesystem/VisibleFilesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Filesystem/VisibleFilesTest.php
index f3a40455a3..37a458c04c 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Filesystem/VisibleFilesTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Filesystem/VisibleFilesTest.php
@@ -20,7 +20,7 @@ final class VisibleFilesTest extends FlowTestCase
#[TestWith(['file:///out/year=2024/.hidden/part.csv'])]
public function test_a_hidden_segment_below_the_root_hides_the_file(string $file): void
{
- static::assertFalse((new VisibleFiles(path('file:///out')))->accept(new FileStatus(path($file), true)));
+ static::assertFalse(new VisibleFiles(path('file:///out'))->accept(new FileStatus(path($file), true)));
}
#[TestWith(['file:///out/part.csv'])]
@@ -31,47 +31,47 @@ public function test_a_hidden_segment_below_the_root_hides_the_file(string $file
#[TestWith(['file:///out/a.b/part.csv'])]
public function test_a_visible_file_below_the_root_is_kept(string $file): void
{
- static::assertTrue((new VisibleFiles(path('file:///out')))->accept(new FileStatus(path($file), true)));
+ static::assertTrue(new VisibleFiles(path('file:///out'))->accept(new FileStatus(path($file), true)));
}
public function test_a_root_with_a_trailing_slash_still_hides_a_hidden_segment(): void
{
- static::assertFalse((new VisibleFiles(path('file:///out/')))->accept(
+ static::assertFalse(new VisibleFiles(path('file:///out/'))->accept(
new FileStatus(path('file:///out/.hidden/part.csv'), true),
));
}
public function test_a_file_outside_the_root_is_kept_whatever_its_segments(): void
{
- static::assertTrue((new VisibleFiles(path('file:///a')))->accept(
+ static::assertTrue(new VisibleFiles(path('file:///a'))->accept(
new FileStatus(path('file:///b/_x/part.csv'), true),
));
}
public function test_a_hidden_segment_of_the_root_itself_is_read(): void
{
- static::assertTrue((new VisibleFiles(path('file:///home/u/.local/_exports')))->accept(
+ static::assertTrue(new VisibleFiles(path('file:///home/u/.local/_exports'))->accept(
new FileStatus(path('file:///home/u/.local/_exports/part.csv'), true),
));
}
public function test_an_explicit_hidden_file_is_read(): void
{
- static::assertTrue((new VisibleFiles(path('file:///out/.hidden.csv')))->accept(
+ static::assertTrue(new VisibleFiles(path('file:///out/.hidden.csv'))->accept(
new FileStatus(path('file:///out/.hidden.csv'), true),
));
}
public function test_a_root_prefix_is_not_a_parent(): void
{
- static::assertTrue((new VisibleFiles(path('file:///out')))->accept(
+ static::assertTrue(new VisibleFiles(path('file:///out'))->accept(
new FileStatus(path('file:///out.csv'), true),
));
}
public function test_a_directory_is_not_a_file(): void
{
- static::assertFalse((new VisibleFiles(path('file:///out')))->accept(
+ static::assertFalse(new VisibleFiles(path('file:///out'))->accept(
new FileStatus(path('file:///out/a'), false),
));
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeExtractorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeExtractorTest.php
index 694cd452ff..8d95d7e62a 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeExtractorTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeExtractorTest.php
@@ -649,7 +649,7 @@ public function test_extract_split_reads_no_more_than_the_limit(): void
foreach (FlowTestCase::extracted(
$extractor,
flow_context()->backend(),
- (new Criteria(25))->withSplit($extractor->splits(new Criteria(), 100_000)[0]),
+ new Criteria(25)->withSplit($extractor->splits(new Criteria(), 100_000)[0]),
) as $rows) {
$total += $rows->count();
}
@@ -666,7 +666,7 @@ public function test_extract_split_stops_on_the_stop_signal(): void
$generator = FlowTestCase::extracted(
$extractor,
flow_context()->backend(),
- (new Criteria())->withSplit($extractor->splits(new Criteria(), 100_000)[0]),
+ new Criteria()->withSplit($extractor->splits(new Criteria(), 100_000)[0]),
);
$totalRows = 0;
@@ -685,7 +685,7 @@ public function test_extract_split_stops_on_the_stop_signal_of_a_whole_source_sp
$generator = FlowTestCase::extracted(
from_floe(path('memory://split/a.floe'), filesystem: $memory)->withBatchSize(1),
flow_context()->backend(),
- (new Criteria())->withSplit(new FileSplit(path('memory://split/a.floe'), 0, null)),
+ new Criteria()->withSplit(new FileSplit(path('memory://split/a.floe'), 0, null)),
);
$totalRows = 0;
@@ -741,7 +741,7 @@ public function test_a_pushed_path_filter_prunes_the_files_splits_are_cut_from()
static::assertEquals(
[new FileSplit($extractor->source(), 0, null)],
- $extractor->splits((new Criteria())->withPathFilter(new RejectingFilter()), 1),
+ $extractor->splits(new Criteria()->withPathFilter(new RejectingFilter()), 1),
);
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeFileBatchesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeFileBatchesTest.php
index 16219dfaec..5ab32ea4d6 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeFileBatchesTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeFileBatchesTest.php
@@ -41,7 +41,7 @@ public function test_an_offset_that_covers_the_file_skips_it_and_yields_its_row_
['id' => 2],
['id' => 3],
], schema(int_schema('id')))]);
- $file = (new FloeFileBatches(new NoopCodec(), 65536, null))->batches(
+ $file = new FloeFileBatches(new NoopCodec(), 65536, null)->batches(
FileReadMother::of(schema(int_schema('id')), FileColumnsContext::discovering(names: []), 10, $filesystem),
new Criteria(),
new SourceFile(path('memory://a.floe')),
@@ -61,7 +61,7 @@ public function test_an_offset_past_the_file_skips_only_its_row_count(): void
['id' => 2],
['id' => 3],
], schema(int_schema('id')))]);
- $file = (new FloeFileBatches(new NoopCodec(), 65536, null))->batches(
+ $file = new FloeFileBatches(new NoopCodec(), 65536, null)->batches(
FileReadMother::of(schema(int_schema('id')), FileColumnsContext::discovering(names: []), 10, $filesystem),
new Criteria(),
new SourceFile(path('memory://a.floe')),
@@ -80,7 +80,7 @@ public function test_no_offset_skips_nothing(): void
['id' => 1],
['id' => 2],
], schema(int_schema('id')))]);
- $file = (new FloeFileBatches(new NoopCodec(), 65536, null))->batches(
+ $file = new FloeFileBatches(new NoopCodec(), 65536, null)->batches(
FileReadMother::of(schema(int_schema('id')), FileColumnsContext::discovering(names: []), 10, $filesystem),
new Criteria(),
new SourceFile(path('memory://a.floe')),
@@ -108,7 +108,7 @@ public function test_an_offset_inside_the_file_starts_the_read_there_and_is_cons
['id' => 2],
['id' => 3],
], schema(int_schema('id')))]);
- $file = (new FloeFileBatches(new NoopCodec(), 65536, null))->batches(
+ $file = new FloeFileBatches(new NoopCodec(), 65536, null)->batches(
FileReadMother::of(schema(int_schema('id')), FileColumnsContext::discovering(names: []), 10, $filesystem),
new Criteria(),
new SourceFile(path('memory://a.floe')),
@@ -136,7 +136,7 @@ public function test_beside_a_conjunct_it_answers_no_row_so_it_leaves_the_offset
['id' => 2],
['id' => 3],
], schema(int_schema('id')))]);
- $file = (new FloeFileBatches(new NoopCodec(), 65536, null))->batches(
+ $file = new FloeFileBatches(new NoopCodec(), 65536, null)->batches(
FileReadMother::of(schema(int_schema('id')), FileColumnsContext::discovering(names: []), 10, $filesystem),
new Criteria(conjuncts: [ref('id')->greaterThan(lit(1))]),
new SourceFile(path('memory://a.floe')),
@@ -162,7 +162,7 @@ public function test_a_file_narrower_than_the_body_is_padded_with_nulls(): void
[[['id' => 1, 'name' => null]]],
array_map(
static fn(Rows $rows): array => $rows->toArray(),
- FloeFilesContext::rows((new FloeFileBatches(new NoopCodec(), 65536, null))->batches(
+ FloeFilesContext::rows(new FloeFileBatches(new NoopCodec(), 65536, null)->batches(
FileReadMother::of(
schema(int_schema('id'), str_schema('name', nullable: true)),
FileColumnsContext::discovering(names: []),
@@ -187,11 +187,11 @@ public function test_a_file_that_diverges_from_the_derived_schema_is_refused_and
]], schema(str_schema('name')))]);
try {
- iterator_to_array((new FloeFileBatches(
+ iterator_to_array(new FloeFileBatches(
new NoopCodec(),
65536,
new DerivedSchema(schema(int_schema('id')), 'memory://a.floe'),
- ))->batches(
+ )->batches(
FileReadMother::of(
schema(int_schema('id')),
FileColumnsContext::discovering(names: []),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeFileWriterFactoryTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeFileWriterFactoryTest.php
index 590a82ef96..ee3af01211 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeFileWriterFactoryTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeFileWriterFactoryTest.php
@@ -43,7 +43,7 @@ public function test_a_declared_schema_is_the_written_one(): void
{
$filesystem = memory_filesystem();
$declared = schema(int_schema('id', nullable: true));
- $writer = (new FloeFileWriterFactory($declared, null, new Options()))->writer(
+ $writer = new FloeFileWriterFactory($declared, null, new Options())->writer(
$filesystem->writeTo(path('memory://a.floe')),
schema(int_schema('id')),
new PhpBackend(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeFileWriterTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeFileWriterTest.php
index 033aa9744f..6011508841 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeFileWriterTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeFileWriterTest.php
@@ -23,7 +23,7 @@ public function test_a_writer_closed_before_any_write_leaves_a_file_without_rows
$filesystem = memory_filesystem();
$stream = $filesystem->writeTo(path('memory://a.floe'));
- (new FloeFileWriterFactory(null, null, new Options()))
+ new FloeFileWriterFactory(null, null, new Options())
->writer($stream, schema(int_schema('id')), new PhpBackend())
->close();
$stream->close();
@@ -38,7 +38,7 @@ public function test_every_write_lands_in_the_file(): void
{
$filesystem = memory_filesystem();
$stream = $filesystem->writeTo(path('memory://a.floe'));
- $writer = (new FloeFileWriterFactory(null, null, new Options()))->writer(
+ $writer = new FloeFileWriterFactory(null, null, new Options())->writer(
$stream,
schema(int_schema('id')),
new PhpBackend(),
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeLoaderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeLoaderTest.php
index 5e1b8b588a..6e428f6ca3 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeLoaderTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeLoaderTest.php
@@ -55,7 +55,7 @@ public function test_discarding_a_loader_that_never_loaded_is_a_no_op(): void
{
$filesystem = new RecordingFilesystem(memory_filesystem());
- (new FloeLoader(path('memory://never-written.floe'), filesystem: $filesystem))->discard();
+ new FloeLoader(path('memory://never-written.floe'), filesystem: $filesystem)->discard();
static::assertSame([], $filesystem->calls);
}
@@ -240,7 +240,7 @@ public function test_describe_round_trips(): void
{
$scratch = ReaderRoundTrip::scratch('floe-describe');
$file = $scratch->suffix('/rows.floe');
- $loader = (new FloeLoader($file, Metadata::fromArray(['owner' => 'tests']), new Options(1024)))
+ $loader = new FloeLoader($file, Metadata::fromArray(['owner' => 'tests']), new Options(1024))
->saveMode(SaveMode::Overwrite)
->withSchema(schema(int_schema('id'), str_schema('name')));
$rebuilt = DescribeRoundTrip::rebuilt($loader);
@@ -263,11 +263,11 @@ public function test_a_partitioned_loader_describes_its_partitioning(): void
static::assertSame(
['by' => ['name'], 'write_columns' => true],
DescribeRoundTrip::rebuilt(
- (new FloeLoader(
+ new FloeLoader(
$scratch->suffix('/{name}/rows.floe'),
Metadata::fromArray(['owner' => 'tests']),
new Options(1024),
- ))
+ )
->saveMode(SaveMode::Overwrite)
->withSchema(schema(int_schema('id'), str_schema('name')))
->partitionBy('name', writeColumns: true),
@@ -285,7 +285,7 @@ public function test_a_live_filesystem_does_not_describe(): void
public function test_a_loader_with_another_codec_does_not_describe(): void
{
static::assertNull(
- (new FloeLoader(
+ new FloeLoader(
($scratch = ReaderRoundTrip::scratch('floe-codec'))->suffix('/rows.floe'),
options: new Options(1024, new class implements Codec {
public function encode(string $data): string
@@ -303,7 +303,7 @@ public function id(): int
return 7;
}
}),
- ))->describe(),
+ )->describe(),
);
native_local_filesystem()->rm($scratch);
@@ -312,11 +312,11 @@ public function id(): int
public function test_in_task_copies_every_setting_and_leaves_the_original(): void
{
$scratch = ReaderRoundTrip::scratch('in-task');
- $loader = (new FloeLoader(
+ $loader = new FloeLoader(
$scratch->suffix('/rows.out'),
Metadata::fromArray(['owner' => 'tests']),
new Options(1024),
- ))
+ )
->saveMode(SaveMode::Overwrite)
->partitionBy('name')
->withSchema(schema(int_schema('id')));
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeSourceFileTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeSourceFileTest.php
index c5bf95a973..bf5f46b316 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeSourceFileTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeSourceFileTest.php
@@ -39,10 +39,10 @@ public function test_schema_comes_from_the_footer(): void
static::assertEquals(
schema(int_schema('id')),
- (new FloeSourceFile(
+ new FloeSourceFile(
FloeFilesContext::files($memory)->read(path('memory://parts/country=PL/data.floe'))->footer(),
new SourceFile(path('memory://parts/country=PL/data.floe')),
- ))->schema(),
+ )->schema(),
);
}
@@ -53,10 +53,10 @@ public function test_source_returns_the_listed_file(): void
static::assertEquals(
new SourceFile(path('memory://parts/country=PL/data.floe')),
- (new FloeSourceFile(
+ new FloeSourceFile(
FloeFilesContext::files($memory)->read(path('memory://parts/country=PL/data.floe'))->footer(),
new SourceFile(path('memory://parts/country=PL/data.floe')),
- ))->source(),
+ )->source(),
);
}
}
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Formatter/ASCII/ASCIIValueTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Formatter/ASCII/ASCIIValueTest.php
index 737c7ec368..f0f1034c03 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Formatter/ASCII/ASCIIValueTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Formatter/ASCII/ASCIIValueTest.php
@@ -44,7 +44,7 @@ public static function values_without_truncating(): Generator
#[DataProvider('values_without_truncating')]
public function test_converting_value_to_ascii_value(Type $type, mixed $value, string $asciiValue): void
{
- static::assertSame($asciiValue, (new ASCIIValue($type, $value))->print(false));
+ static::assertSame($asciiValue, new ASCIIValue($type, $value)->print(false));
}
/**
@@ -56,24 +56,24 @@ public function test_converting_value_to_ascii_value_with_truncating(
mixed $value,
string $asciiValue,
): void {
- static::assertSame($asciiValue, (new ASCIIValue($type, $value))->print(3));
+ static::assertSame($asciiValue, new ASCIIValue($type, $value)->print(3));
}
public function test_the_default_truncation_keeps_twenty_characters(): void
{
- static::assertSame('abcdefghijklmnopqrst', (new ASCIIValue(type_string(), 'abcdefghijklmnopqrstu'))->print());
- static::assertSame(20, (new ASCIIValue(type_string(), 'abcdefghijklmnopqrstu'))->length());
- static::assertSame('abcdefghijklmnopqrst', (new ASCIIValue(type_string(), 'abcdefghijklmnopqrst'))->print());
+ static::assertSame('abcdefghijklmnopqrst', new ASCIIValue(type_string(), 'abcdefghijklmnopqrstu')->print());
+ static::assertSame(20, new ASCIIValue(type_string(), 'abcdefghijklmnopqrstu')->length());
+ static::assertSame('abcdefghijklmnopqrst', new ASCIIValue(type_string(), 'abcdefghijklmnopqrst')->print());
}
public function test_a_zero_truncation_prints_the_whole_value(): void
{
- static::assertSame('abcdefghijklmnopqrstu', (new ASCIIValue(type_string(), 'abcdefghijklmnopqrstu'))->print(0));
+ static::assertSame('abcdefghijklmnopqrstu', new ASCIIValue(type_string(), 'abcdefghijklmnopqrstu')->print(0));
}
public function test_truncation_counts_characters_not_bytes(): void
{
- static::assertSame('ąćę', (new ASCIIValue(type_string(), 'ąćęź'))->print(3));
+ static::assertSame('ąćę', new ASCIIValue(type_string(), 'ąćęź')->print(3));
}
public function test_mb_str_pad_with_a_multibyte_padding(): void
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Formatter/AsciiTableFormatterTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Formatter/AsciiTableFormatterTest.php
index 009815cf7e..b911de1c80 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Formatter/AsciiTableFormatterTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Formatter/AsciiTableFormatterTest.php
@@ -22,7 +22,7 @@ final class AsciiTableFormatterTest extends FlowTestCase
{
public function test_values_are_truncated_to_twenty_characters_by_default(): void
{
- $table = (new AsciiTableFormatter())->format(array_to_rows([[
+ $table = new AsciiTableFormatter()->format(array_to_rows([[
'row' => 'abcdefghijklmnopqrstu',
]], schema(str_schema('row'))));
@@ -54,7 +54,7 @@ public function test_a_table_with_mb_strings(): void
| [763][805]/nieśmiertelnym, najmędrszym|/i najbliższym magii spośród wszystkich ras. |
| [816][853]/Siedem - władcom krasnoludów,|/wspaniałym górnikom |
+-------------------------------------------------------------------------------------+
- TABLE, (new AsciiTableFormatter())->format($rows, false));
+ TABLE, new AsciiTableFormatter()->format($rows, false));
}
public function test_a_table_with_mb_strings_truncate(): void
@@ -81,7 +81,7 @@ public function test_a_table_with_mb_strings_truncate(): void
| [763][805]/nieśmiert |
| [816][853]/Siedem - |
+----------------------+
- TABLE, (new AsciiTableFormatter())->format($rows, true));
+ TABLE, new AsciiTableFormatter()->format($rows, true));
}
public function test_a_table_with_non_symmetric_entries(): void
@@ -111,7 +111,7 @@ public function test_a_table_with_non_symmetric_entries(): void
| [763][805]/nieśmiertelnym, najmędrszym|/i najbliższym magii spośród wszystkich ras. | |
| | [816][853]/Siedem - władcom krasnoludów,|/wspaniałym górnikom |
+-------------------------------------------------------------------------------------+---------------------------------------------------------------+
- TABLE, (new AsciiTableFormatter())->format($rows, false));
+ TABLE, new AsciiTableFormatter()->format($rows, false));
}
public function test_a_table_with_single_row(): void
@@ -123,7 +123,7 @@ public function test_a_table_with_single_row(): void
| 1 | EN |
| 2 | PL |
+----+------+
- TABLE, (new AsciiTableFormatter())->format(
+ TABLE, new AsciiTableFormatter()->format(
array_to_rows(
[['id' => 1, 'name' => 'EN'], ['id' => 2, 'name' => 'PL']],
schema(int_schema('id'), str_schema('name')),
@@ -134,7 +134,7 @@ public function test_a_table_with_single_row(): void
public function test_a_batch_of_2000_rows_prints_every_row_at_one_width_per_column(): void
{
- $output = (new AsciiTableFormatter())->format(array_to_rows(
+ $output = new AsciiTableFormatter()->format(array_to_rows(
array_map(static fn(int $id): array => ['id' => $id, 'name' => 'name-' . $id], range(1, 2000)),
schema(int_schema('id'), str_schema('name')),
));
diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Formatter/Row/ASCIISchemaFormatterTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Formatter/Row/ASCIISchemaFormatterTest.php
index c488bac756..6f435c8ece 100644
--- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Formatter/Row/ASCIISchemaFormatterTest.php
+++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Formatter/Row/ASCIISchemaFormatterTest.php
@@ -74,7 +74,7 @@ public function test_format_nested_schema(): void
|-- uuid: uuid
|-- datetime: datetime
- SCHEMA, (new ASCIISchemaFormatter())->format($schema));
+ SCHEMA, new ASCIISchemaFormatter()->format($schema));
}
public function test_format_schema_with_optional_structure_elements(): void
@@ -97,7 +97,7 @@ public function test_format_schema_with_optional_structure_elements(): void
| |-- zip?: string
| |-- nickname?: string
- SCHEMA, (new ASCIISchemaFormatter())->format($schema));
+ SCHEMA, new ASCIISchemaFormatter()->format($schema));
}
public function test_format_nested_schema_as_table(): void
@@ -142,7 +142,22 @@ public function test_format_nested_schema_as_table(): void
+-------------+--------------+----------+----------+
11 rows
- SCHEMA, (new ASCIISchemaFormatter(true, true))->format($schema));
+ SCHEMA, new ASCIISchemaFormatter(true, true)->format($schema));
+ }
+
+ public function test_format_as_table_keeps_names_longer_than_twenty_characters(): void
+ {
+ CommandOutputNormalizer::assertCommandOutputIdentical(<<<'SCHEMA'
+ +----------------------------------+--------+----------+
+ | name | type | nullable |
+ +----------------------------------+--------+----------+
+ | a_column_name_longer_than_twenty | string | false |
+ +----------------------------------+--------+----------+
+ 1 rows
+
+ SCHEMA, new ASCIISchemaFormatter(true, false)->format(schema(string_schema(
+ 'a_column_name_longer_than_twenty',
+ ))));
}
public function test_format_nested_schema_as_table_without_metadata(): void
@@ -187,7 +202,7 @@ public function test_format_nested_schema_as_table_without_metadata(): void
+-------------+--------------+----------+
11 rows
- SCHEMA, (new ASCIISchemaFormatter(true, false))->format($schema));
+ SCHEMA, new ASCIISchemaFormatter(true, false)->format($schema));
}
public function test_format_schema(): void
@@ -210,6 +225,6 @@ public function test_format_schema(): void
|-- map: map
|-- list: list