Skip to content

Conversation

@norberttech
Copy link
Member

@norberttech norberttech commented Jun 20, 2025

Resolves: #1722
Resolves: #1732

Change Log


Added

  • Optional elements to type_structure
  • Allow for extra elements in type_structure

Fixed

  • StructureType narrowing through dedicated phpstan extension

Changed

  • Increased phpstan lvl to 9

Removed

Deprecated

Security

@norberttech norberttech linked an issue Jun 20, 2025 that may be closed by this pull request
@github-actions
Copy link
Contributor

github-actions bot commented Jun 20, 2025

Flow PHP - Benchmarks

Results of the benchmarks from this PR are compared with the results from 1.x branch.

Extractors
+-----------------------+------------------------+------+-----+-----------------+------------------+-----------------+
| benchmark             | subject                | revs | its | mem_peak        | mode             | rstdev          |
+-----------------------+------------------------+------+-----+-----------------+------------------+-----------------+
| CSVExtractorBench     | bench_extract_10k      | 1    | 3   | 4.803mb +0.47%  | 436.192ms +4.25% | ±0.09% -69.85%  |
| ExcelExtractorBench   | bench_extract_10k_ods  | 1    | 3   | 65.513mb +0.04% | 1.084s +1.85%    | ±1.33% +196.77% |
| ExcelExtractorBench   | bench_extract_10k_xlsx | 1    | 3   | 67.559mb +0.03% | 1.706s +1.11%    | ±0.89% +16.89%  |
| JsonExtractorBench    | bench_extract_10k      | 1    | 3   | 5.087mb +6.79%  | 1.171s -0.34%    | ±0.62% -26.26%  |
| ParquetExtractorBench | bench_extract_10k      | 1    | 3   | 86.357mb +0.04% | 984.358ms +3.77% | ±1.45% +133.45% |
| TextExtractorBench    | bench_extract_10k      | 1    | 3   | 4.534mb +0.69%  | 42.315ms +9.37%  | ±0.70% +217.28% |
| XmlExtractorBench     | bench_extract_10k      | 1    | 3   | 4.529mb +0.47%  | 613.068ms +1.41% | ±0.32% +4.54%   |
+-----------------------+------------------------+------+-----+-----------------+------------------+-----------------+
Transformers
+---------------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| benchmark                       | subject                  | revs | its | mem_peak         | mode            | rstdev         |
+---------------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
| RenameEachEntryTransformerBench | bench_transform_10k_rows | 1    | 3   | 18.533mb +0.15%  | 74.320ms -0.04% | ±0.71% -30.62% |
| RenameEntryTransformerBench     | bench_transform_10k_rows | 1    | 3   | 123.271mb +0.02% | 66.292ms -2.54% | ±0.83% +40.26% |
+---------------------------------+--------------------------+------+-----+------------------+-----------------+----------------+
Loaders
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| benchmark          | subject        | revs | its | mem_peak         | mode             | rstdev          |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
| CSVLoaderBench     | bench_load_10k | 1    | 3   | 62.463mb +0.04%  | 89.147ms +4.67%  | ±1.72% +174.42% |
| JsonLoaderBench    | bench_load_10k | 1    | 3   | 79.764mb +1.03%  | 105.301ms +0.22% | ±0.46% -41.08%  |
| ParquetLoaderBench | bench_load_10k | 1    | 3   | 166.240mb +0.03% | 21.167s -3.19%   | ±0.55% -27.31%  |
| TextLoaderBench    | bench_load_10k | 1    | 3   | 17.840mb +0.15%  | 31.919ms +0.22%  | ±0.51% -47.49%  |
+--------------------+----------------+------+-----+------------------+------------------+-----------------+
Building Blocks
+-------------------+----------------------------+------+-----+------------------+------------------+------------------+
| benchmark         | subject                    | revs | its | mem_peak         | mode             | rstdev           |
+-------------------+----------------------------+------+-----+------------------+------------------+------------------+
| TypeDetectorBench | bench_type_detector        | 1    | 3   | 42.106mb +0.96%  | 407.252ms -4.64% | ±0.22% -5.00%    |
| TypeDetectorBench | bench_type_detector        | 1    | 3   | 11.483mb +0.74%  | 81.905ms -4.84%  | ±0.46% -45.12%   |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 101.812mb +4.09% | 657.632ms -0.13% | ±1.16% +511.57%  |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 53.163mb +3.94%  | 328.172ms -2.26% | ±0.69% +68.11%   |
| EntryFactoryBench | bench_entry_factory        | 1    | 3   | 14.412mb +2.97%  | 69.727ms -3.62%  | ±0.88% -17.50%   |
| RowsBench         | bench_chunk_10_on_10k      | 2    | 3   | 93.424mb +0.03%  | 3.968ms -9.69%   | ±3.02% +17.70%   |
| RowsBench         | bench_diff_left_1k_on_10k  | 2    | 3   | 110.795mb +0.02% | 241.036ms +0.43% | ±2.13% +184.12%  |
| RowsBench         | bench_diff_right_1k_on_10k | 2    | 3   | 93.515mb +0.03%  | 23.957ms -2.71%  | ±0.69% -15.75%   |
| RowsBench         | bench_drop_1k_on_10k       | 2    | 3   | 94.299mb +0.03%  | 1.789ms -4.85%   | ±1.04% -49.96%   |
| RowsBench         | bench_drop_right_1k_on_10k | 2    | 3   | 94.299mb +0.03%  | 1.836ms +0.90%   | ±1.80% +82.06%   |
| RowsBench         | bench_entries_on_10k       | 2    | 3   | 92.460mb +0.03%  | 3.715ms -2.68%   | ±1.68% +4.53%    |
| RowsBench         | bench_filter_on_10k        | 2    | 3   | 92.989mb +0.03%  | 16.036ms -0.32%  | ±2.80% +1667.17% |
| RowsBench         | bench_find_on_10k          | 2    | 3   | 92.989mb +0.03%  | 15.884ms -1.47%  | ±0.83% +80.15%   |
| RowsBench         | bench_find_one_on_10k      | 10   | 3   | 91.677mb +0.03%  | 2.094μs -0.58%   | ±2.28% +3.23%    |
| RowsBench         | bench_first_on_10k         | 10   | 3   | 91.677mb +0.03%  | 0.500μs 0.00%    | ±0.00% 0.00%     |
| RowsBench         | bench_flat_map_on_1k       | 2    | 3   | 100.738mb +0.03% | 16.553ms -1.90%  | ±2.01% +936.86%  |
| RowsBench         | bench_map_on_10k           | 2    | 3   | 130.165mb +0.02% | 69.307ms -0.33%  | ±0.96% +118.87%  |
| RowsBench         | bench_merge_1k_on_10k      | 2    | 3   | 93.508mb +0.03%  | 1.717ms -2.82%   | ±0.50% -68.54%   |
| RowsBench         | bench_partition_by_on_10k  | 2    | 3   | 96.877mb +0.03%  | 63.220ms -2.05%  | ±3.01% +647.59%  |
| RowsBench         | bench_remove_on_10k        | 2    | 3   | 94.561mb +0.03%  | 4.397ms +0.38%   | ±1.58% -54.13%   |
| RowsBench         | bench_sort_asc_on_1k       | 2    | 3   | 92.040mb +0.03%  | 41.253ms -5.92%  | ±1.43% +26.87%   |
| RowsBench         | bench_sort_by_on_1k        | 2    | 3   | 92.040mb +0.03%  | 41.195ms -3.11%  | ±0.96% +22.80%   |
| RowsBench         | bench_sort_desc_on_1k      | 2    | 3   | 92.040mb +0.03%  | 41.808ms -1.63%  | ±2.27% +247.76%  |
| RowsBench         | bench_sort_entries_on_1k   | 2    | 3   | 94.120mb +0.03%  | 8.775ms +0.14%   | ±0.95% -64.22%   |
| RowsBench         | bench_sort_on_1k           | 2    | 3   | 91.870mb +0.03%  | 31.573ms -3.77%  | ±1.13% -54.60%   |
| RowsBench         | bench_take_1k_on_10k       | 10   | 3   | 91.677mb +0.03%  | 14.900μs -0.63%  | ±0.55% +73.98%   |
| RowsBench         | bench_take_right_1k_on_10k | 10   | 3   | 91.677mb +0.03%  | 16.988μs -1.59%  | ±1.53% -30.66%   |
| RowsBench         | bench_unique_on_1k         | 2    | 3   | 110.796mb +0.02% | 247.258ms -0.25% | ±0.96% +10.48%   |
+-------------------+----------------------------+------+-----+------------------+------------------+------------------+

@codecov
Copy link

codecov bot commented Jun 20, 2025

Codecov Report

Attention: Patch coverage is 77.33333% with 136 lines in your changes missing coverage. Please review.

Project coverage is 81.22%. Comparing base (1f010ce) to head (1289ee1).
Report is 3 commits behind head on 1.x.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##              1.x    #1723      +/-   ##
==========================================
- Coverage   81.62%   81.22%   -0.40%     
==========================================
  Files         714      715       +1     
  Lines       19416    19872     +456     
==========================================
+ Hits        15849    16142     +293     
- Misses       3567     3730     +163     
Components Coverage Δ
etl 88.33% <80.82%> (-0.07%) ⬇️
cli 85.46% <33.33%> (+1.03%) ⬆️
lib-array-dot 94.56% <100.00%> (+0.02%) ⬆️
lib-azure-sdk 61.35% <52.63%> (-1.21%) ⬇️
lib-doctrine-dbal-bulk 93.88% <100.00%> (+0.38%) ⬆️
lib-filesystem 78.02% <100.00%> (ø)
lib-types 53.57% <ø> (+1.53%) ⬆️
lib-parquet 84.14% <ø> (-0.23%) ⬇️
lib-parquet-viewer 83.11% <92.59%> (+1.08%) ⬆️
lib-snappy 90.69% <ø> (-0.47%) ⬇️
bridge-filesystem-async-aws 90.38% <ø> (ø)
bridge-filesystem-azure 89.92% <ø> (ø)
bridge-monolog-http 97.04% <95.23%> (-1.08%) ⬇️
symfony-http-foundation 74.41% <ø> (ø)
adapter-chartjs 86.70% <100.00%> (+0.25%) ⬆️
adapter-csv 87.74% <69.44%> (-2.63%) ⬇️
adapter-doctrine 89.89% <92.30%> (-0.07%) ⬇️
adapter-elasticsearch 97.23% <100.00%> (+0.04%) ⬆️
adapter-google-sheet 83.87% <ø> (ø)
adapter-http 58.10% <45.45%> (-1.05%) ⬇️
adapter-json 87.98% <61.11%> (-2.65%) ⬇️
adapter-logger 53.84% <ø> (ø)
adapter-meilisearch 97.95% <100.00%> (+0.20%) ⬆️
adapter-parquet 78.64% <ø> (ø)
adapter-text 84.44% <ø> (ø)
adapter-xml 82.73% <66.66%> (-0.43%) ⬇️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@norberttech norberttech force-pushed the 1722-proposal-increase-phpstan-level-to-max branch from 2c4671c to b35dd12 Compare June 25, 2025 01:18
@norberttech norberttech force-pushed the 1722-proposal-increase-phpstan-level-to-max branch from d81267a to 45b1167 Compare June 25, 2025 02:12
@norberttech norberttech merged commit 0d89a3f into 1.x Jun 25, 2025
19 of 21 checks passed
@norberttech norberttech deleted the 1722-proposal-increase-phpstan-level-to-max branch June 25, 2025 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Proposal]: Allow extra and optional fields in structure type [Proposal]: Increase phpstan level to max

2 participants