Skip to content

Use Sami build that supports PHP 8 union types - #979

Open
sgiehl wants to merge 1 commit into
livefrom
matomo6-docs/00-generator-uniontypes
Open

Use Sami build that supports PHP 8 union types#979
sgiehl wants to merge 1 commit into
livefrom
matomo6-docs/00-generator-uniontypes

Conversation

@sgiehl

@sgiehl sgiehl commented Aug 24, 2026

Copy link
Copy Markdown
Member

Bottom of the Matomo 6 docs stack. Must merge before #970.

Why it has to go first. #970 adds generateDocs "6.x-dev" "6.x" to generate.sh. Sami cannot cast UnionType/IntersectionType to string, so parsing aborts, generate.sh exits 1, and generateAndPush.sh bails before committing anything — losing the 5.x regeneration too, not just 6.x.

The trigger is vendor/matomo/matomo-php-tracker/MatomoTracker.php, which the generator parses directly: 6.x-dev pins tracker ^4.0 (13 union-typed return signatures), 5.x-dev pins ~3.3.0 (none). That is why this only surfaces for 6.x.

Two changes in generator/:

Verified: with this lock, composer install in generator/ checks out 3292f19, and php generator/generate.php --branch=6.x-dev --targetname=6.x completes with exit 0. The output is byte-identical to the tree committed in #971.

⚠️ Deploy step required. generate.sh runs composer install only inside piwik/ (core's dependencies) — it never reinstalls generator/vendor. Merging this PR updates the lock in git but changes nothing on the generation host, so the nightly run would still load the old Sami and still fail. Run cd generator && composer install on the generation host once after merging. Deliberately not scripted; handled manually.

Note on the branch dependency: this intentionally points at an unmerged branch rather than dev-4.x-devphp8-twig-update. Keep fix-union-and-intersection-types alive — if Sami#5 is later squash-merged and the branch deleted, 3292f19 becomes unreachable and composer install here breaks. When Sami#5 does get merged, switch this back to dev-dev-4.x-devphp8-twig-update and re-run composer update tsteur/sami.

Lock diff note: 12 of the 30 changed lines are cosmetic key reordering inside thanks blocks, from a newer composer writing the file.

@sgiehl
sgiehl force-pushed the matomo6-docs/00-generator-uniontypes branch from 203cc52 to 36c2fd0 Compare August 24, 2026 19:45
@sgiehl sgiehl changed the title Generator: prepare for the Sami union-type fix Use Sami build that supports PHP 8 union types Aug 24, 2026
Sami cannot cast UnionType/IntersectionType to string, so generating the 6.x API
reference aborted on the union-typed signatures matomo-php-tracker 4.0 introduced.

Points tsteur/sami at matomo-org/Sami#5 and raises the generator PHP floor to
8.1.0, matching what the locked dependencies actually require.
@sgiehl
sgiehl force-pushed the matomo6-docs/00-generator-uniontypes branch from 36c2fd0 to 39d3caf Compare August 25, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants