Skip to content

Fix the Redis Cluster backend failing to parse on PHP 7.2 and 7.3 - #354

Merged
snake14 merged 2 commits into
5.x-devfrom
fix-php72-redis-cluster
Oct 21, 2026
Merged

snake14 merged 2 commits into
5.x-devfrom
fix-php72-redis-cluster

Conversation

@snake14

@snake14 snake14 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

Since 5.1.0, using the Redis Cluster backend on PHP 7.2 or 7.3 fails with a parse error, because Queue/Backend/RedisCluster.php builds its host list with an arrow function, which needs PHP 7.4. Matomo 5 still supports PHP 7.2.5, so this replaces it with an ordinary closure. Other backends never load that file and are unaffected.

Issue No

No GitHub issue. Found by the umbrella CI's PHPStan run at PHP 7.2 on the 5.x-dev migration branch.

Steps to Replicate the Issue

  1. On PHP 7.2 or 7.3, run php -l Queue/Backend/RedisCluster.php (or configure QueuedTracking to use Redis Cluster).
  2. Expected: the file parses and the backend connects.
  3. Actual: syntax error, unexpected ':', expecting ',' or ')' on line 308.

Checklist

  • [✔] Tested locally or on demo2/demo3?
  • [✔] New test case added/updated?
  • [NA] Are all newly added texts included via translation?
  • [NA] Are text sanitized properly? (Eg use of v-text v/s v-html for vue)
  • [✔] Version bumped?
  • [✔] I have understood, reviewed, and tested all AI outputs before use
  • [✔] All AI instructions respect security, IP, and privacy rules
  • [NA] Documentation updated?

@snake14
snake14 requested a review from a team October 20, 2026 20:59
@snake14
snake14 enabled auto-merge (squash) October 20, 2026 20:59
snake14 added a commit that referenced this pull request Oct 20, 2026
snake14 added a commit that referenced this pull request Oct 21, 2026
…elease] (#355)

* Move the 5.x-dev checks onto the shared Plugins CI umbrella [ignore_release]

* Carry #354's PHP 7.2 parse fix for RedisCluster so PHPStan can analyse the plugin [ignore_release]

* Port 6.x-dev's PHPStan fixes so the analysis passes on 5.x-dev [ignore_release]

Suppresses the remaining findings where the ext-redis stubs or Matomo 5.0's docblocks are narrower than the code's real contract.
@snake14
snake14 merged commit 5566631 into 5.x-dev Oct 21, 2026
8 checks passed
@snake14
snake14 deleted the fix-php72-redis-cluster branch October 21, 2026 06:00
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.

2 participants