Use Sami build that supports PHP 8 union types - #979
Open
sgiehl wants to merge 1 commit into
Open
Conversation
sgiehl
force-pushed
the
matomo6-docs/00-generator-uniontypes
branch
from
August 24, 2026 19:45
203cc52 to
36c2fd0
Compare
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
force-pushed
the
matomo6-docs/00-generator-uniontypes
branch
from
August 25, 2026 15:03
36c2fd0 to
39d3caf
Compare
chippison
approved these changes
Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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"togenerate.sh. Sami cannot castUnionType/IntersectionTypeto string, so parsing aborts,generate.shexits 1, andgenerateAndPush.shbails 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/:tsteur/sami→dev-fix-union-and-intersection-types(Support PHP 8 union and intersection types Sami#5), lock reference3292f19php>=5.3.0→>=7.2.5; the old floor was long untrue, php-parser 4 and the Sami fork both need PHP 7Verified: with this lock,
composer installingenerator/checks out3292f19, andphp generator/generate.php --branch=6.x-dev --targetname=6.xcompletes with exit 0. The output is byte-identical to the tree committed in #971.generate.shrunscomposer installonly insidepiwik/(core's dependencies) — it never reinstallsgenerator/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. Runcd generator && composer installon 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. Keepfix-union-and-intersection-typesalive — if Sami#5 is later squash-merged and the branch deleted,3292f19becomes unreachable andcomposer installhere breaks. When Sami#5 does get merged, switch this back todev-dev-4.x-devphp8-twig-updateand re-runcomposer update tsteur/sami.Lock diff note: 12 of the 30 changed lines are cosmetic key reordering inside
thanksblocks, from a newer composer writing the file.