Skip to content

Commit ed0c8df

Browse files
authored
Merge branch '1.x' into 1905-task-add-support-for-php-85
2 parents 07b4b17 + 205c93d commit ed0c8df

76 files changed

Lines changed: 1389 additions & 270 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test-suite.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
- 'examples/**'
99
- 'composer.lock'
1010
- 'composer.json'
11+
- 'phpunit.xml.dist'
1112
push:
1213
branches: [ 1.x ]
1314
paths:
@@ -18,6 +19,7 @@ on:
1819
- 'examples/**'
1920
- 'composer.lock'
2021
- 'composer.json'
22+
- 'phpunit.xml.dist'
2123
schedule:
2224
- cron: '0 4 * * *'
2325
workflow_dispatch:
@@ -50,4 +52,4 @@ jobs:
5052
uses: ./.github/workflows/job-mutation-tests.yml
5153

5254
benchmark-tests:
53-
uses: ./.github/workflows/job-benchmark-tests.yml
55+
uses: ./.github/workflows/job-benchmark-tests.yml

CHANGELOG.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
1-
## [Unreleased] - 2025-10-28
1+
## [Unreleased] - 2025-10-31
22

33
### Added
4+
- [#1917](https://github.com/flow-php/flow/pull/1917) - **Add a new `HTMLType`** - [@stloyd](https://github.com/stloyd)
5+
6+
### Changed
7+
- [#1932](https://github.com/flow-php/flow/pull/1932) - **Enforce passing `EntryFactory` to `array_to_row(s)` & `to_entry` functions** - [@stloyd](https://github.com/stloyd)
8+
- [#1929](https://github.com/flow-php/flow/pull/1929) - **Pass `EntryFactory` to the `Rows::join*()` methods** - [@stloyd](https://github.com/stloyd)
9+
- [#1929](https://github.com/flow-php/flow/pull/1929) - **Enforce instance of EntryFactory in the join methods** - [@stloyd](https://github.com/stloyd)
10+
- [#1925](https://github.com/flow-php/flow/pull/1925) - **Update Homebrew TAP formula: flow-php to version: 0.26.1** - [@norberttech](https://github.com/norberttech)
11+
12+
### Fixed
13+
- [#1944](https://github.com/flow-php/flow/pull/1944) - **Incorrect library test group names** - [@stloyd](https://github.com/stloyd)
14+
- [#1945](https://github.com/flow-php/flow/pull/1945) - **Fixed broken `HTMLTypeTest`** - [@stloyd](https://github.com/stloyd)
15+
16+
### Removed
17+
- [#1929](https://github.com/flow-php/flow/pull/1929) - **Remove `Rows::fromArray()`** - [@stloyd](https://github.com/stloyd)
18+
19+
## [0.26.1] - 2025-10-28
20+
21+
### Added
22+
- [#1924](https://github.com/flow-php/flow/pull/1924) - **TimeZioneType** - [@norberttech](https://github.com/norberttech)
423
- [#1922](https://github.com/flow-php/flow/pull/1922) - **php versions constraints to each tool composer.json file** - [@norberttech](https://github.com/norberttech)
524
- [#1911](https://github.com/flow-php/flow/pull/1911) - **Added missing Http adapter functions** - [@stloyd](https://github.com/stloyd)
625
- [960090](https://github.com/flow-php/flow/commit/960090aa988a304b67ccf4b165c1416c56760518) - **contact link for issue type guidance** - [@norberttech](https://github.com/norberttech)

documentation/components/core/building-blocks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ $rows = array_to_rows([
4141
['id' => 2, 'name' => 'user_02', 'active' => false],
4242
['id' => 3, 'name' => 'user_03', 'active' => true],
4343
['id' => 4, 'name' => 'user_04', 'active' => false],
44-
]);
44+
], flow_context(config())->entryFactory());
4545
```
4646

4747
## Entry Types

documentation/upgrading.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@ Please follow the instructions for your specific version to ensure a smooth upgr
55

66
---
77

8+
## Upgrading from 0.26.x to 0.27.x
9+
10+
### 1) Force `EntryFactory $entryFactory` to be required on `array_to_row` & `array_to_row(s)`
11+
12+
Before:
13+
```php
14+
to_entry('name', 'data');
15+
array_to_row([]);
16+
array_to_rows([]);
17+
```
18+
19+
After:
20+
21+
```php
22+
to_entry('name', 'data', flow_context(config())->entryFactory());
23+
array_to_row([], flow_context(config())->entryFactory());
24+
array_to_rows([], flow_context(config())->entryFactory());
25+
```
26+
827
## Upgrading from 0.16.x to 0.17.x
928

1029
### 1) Removed $nullable property from all types

phpunit.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@
7272
<testsuite name="lib-parquet-viewer-integration">
7373
<directory>src/lib/parquet-viewer/tests/Flow/ParquetViewer/Tests/Integration</directory>
7474
</testsuite>
75-
<testsuite name="snappy-integration">
75+
<testsuite name="lib-snappy-integration">
7676
<directory>src/lib/snappy/tests/Flow/Snappy/Tests/Integration</directory>
7777
</testsuite>
78-
<testsuite name="types-unit">
78+
<testsuite name="lib-types-unit">
7979
<directory>src/lib/types/tests/Flow/Types/Tests/Unit</directory>
8080
</testsuite>
8181
<testsuite name="bridge-filesystem-azure-unit">

rector.tests.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
use Flow\ETL\FlowContext;
2828
use Flow\Types\Type\Logical\DateTimeType;
2929
use Flow\Types\Type\Logical\DateType;
30+
use Flow\Types\Type\Logical\HTMLType;
3031
use Flow\Types\Type\Logical\JsonType;
3132
use Flow\Types\Type\Logical\ListType;
3233
use Flow\Types\Type\Logical\MapType;
@@ -165,6 +166,7 @@
165166
new NewObjectToFunction(UuidType::class, 'Flow\ETL\DSL\type_uuid'),
166167
new NewObjectToFunction(XMLElementType::class, 'Flow\ETL\DSL\type_xml_element'),
167168
new NewObjectToFunction(XMLType::class, 'Flow\ETL\DSL\type_xml'),
169+
new NewObjectToFunction(HTMLType::class, 'Flow\ETL\DSL\type_html'),
168170

169171
// Extractors
170172
new NewObjectToFunction(CacheExtractor::class, 'from_cache'),

src/core/etl/src/Flow/ETL/Config/ConfigBuilder.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@ public function __construct()
5151
$this->randomValueGenerator = new NativePHPRandomValueGenerator();
5252
}
5353

54-
public function build() : Config
54+
public function build(EntryFactory $entryFactory = new EntryFactory()) : Config
5555
{
5656
$this->id ??= 'flow_php' . $this->randomValueGenerator->string(32);
57-
$entryFactory = new EntryFactory();
5857
$this->serializer ??= new Base64Serializer(new NativePHPSerializer());
5958
$this->clock ??= SystemClock::utc();
6059
$this->optimizer ??= new Optimizer(

src/core/etl/src/Flow/ETL/DSL/functions.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@
203203
UnionType
204204
};
205205
use Flow\Types\Type\Types;
206+
use Flow\Types\Value\HTMLDocument;
206207
use UnitEnum;
207208

208209
/**
@@ -1547,7 +1548,7 @@ function number_format(ScalarFunction|int|float $value, ScalarFunction|int $deci
15471548
* @return Entry<mixed>
15481549
*/
15491550
#[DocumentationDSL(module: Module::CORE, type: DSLType::DATA_FRAME)]
1550-
function to_entry(string $name, mixed $data, EntryFactory $entryFactory = new EntryFactory()) : Entry
1551+
function to_entry(string $name, mixed $data, EntryFactory $entryFactory) : Entry
15511552
{
15521553
return $entryFactory->create($name, $data);
15531554
}
@@ -1558,7 +1559,7 @@ function to_entry(string $name, mixed $data, EntryFactory $entryFactory = new En
15581559
* @param null|Schema $schema
15591560
*/
15601561
#[DocumentationDSL(module: Module::CORE, type: DSLType::DATA_FRAME)]
1561-
function array_to_row(array $data, EntryFactory $entryFactory = new EntryFactory(), array|Partitions $partitions = [], ?Schema $schema = null) : Row
1562+
function array_to_row(array $data, EntryFactory $entryFactory, array|Partitions $partitions = [], ?Schema $schema = null) : Row
15621563
{
15631564
$entries = [];
15641565

@@ -1603,7 +1604,7 @@ function array_to_row(array $data, EntryFactory $entryFactory = new EntryFactory
16031604
* @param null|Schema $schema
16041605
*/
16051606
#[DocumentationDSL(module: Module::CORE, type: DSLType::DATA_FRAME)]
1606-
function array_to_rows(array $data, EntryFactory $entryFactory = new EntryFactory(), array|Partitions $partitions = [], ?Schema $schema = null) : Rows
1607+
function array_to_rows(array $data, EntryFactory $entryFactory, array|Partitions $partitions = [], ?Schema $schema = null) : Rows
16071608
{
16081609
$partitions = \is_array($partitions) ? new Partitions(...$partitions) : $partitions;
16091610

@@ -1957,6 +1958,15 @@ function json_schema(string $name, bool $nullable = false, ?Metadata $metadata =
19571958
return Definition::json($name, $nullable, $metadata);
19581959
}
19591960

1961+
/**
1962+
* @return Definition<HTMLDocument>
1963+
*/
1964+
#[DocumentationDSL(module: Module::CORE, type: DSLType::SCHEMA)]
1965+
function html_schema(string $name, bool $nullable = false, ?Metadata $metadata = null) : Definition
1966+
{
1967+
return Definition::html($name, $nullable, $metadata);
1968+
}
1969+
19601970
/**
19611971
* @return Definition<\DOMDocument>
19621972
*/

src/core/etl/src/Flow/ETL/Function/AggregatingFunction.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Flow\ETL\Function;
66

77
use Flow\ETL\Row;
8-
use Flow\ETL\Row\Entry;
8+
use Flow\ETL\Row\{Entry, EntryFactory};
99

1010
interface AggregatingFunction
1111
{
@@ -14,5 +14,5 @@ public function aggregate(Row $row) : void;
1414
/**
1515
* @return Entry<mixed>
1616
*/
17-
public function result() : Entry;
17+
public function result(EntryFactory $entryFactory) : Entry;
1818
}

src/core/etl/src/Flow/ETL/Function/Average.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Flow\Calculator\{Calculator, Rounding};
99
use Flow\ETL\Exception\{InvalidArgumentException, RuntimeException};
1010
use Flow\ETL\Row\{Entry, Reference};
11+
use Flow\ETL\Row\EntryFactory;
1112
use Flow\ETL\{Row, Rows, Window};
1213

1314
final class Average implements AggregatingFunction, WindowFunction
@@ -65,7 +66,7 @@ public function over(Window $window) : WindowFunction
6566
return $this;
6667
}
6768

68-
public function result() : Entry
69+
public function result(EntryFactory $entryFactory) : Entry
6970
{
7071
if (!$this->ref->hasAlias()) {
7172
$this->ref->as($this->ref->to() . '_avg');

0 commit comments

Comments
 (0)