Skip to content

Commit af10b0d

Browse files
authored
Update dependencies to address security advisories, #PG-5387 (#644)
* Update dependencies to address security advisories, #PG-5387 * Downgrade the scoped dependencies to PHP 8.1 * Resolve dependencies against the minimum PHP this branch supports * Date the 6.0.0 changelog entry for the next release Monday
1 parent 9fea6ae commit af10b0d

830 files changed

Lines changed: 28668 additions & 8436 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/min-php-lint.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Minimum PHP lint
2+
3+
# The scoped dependencies in vendor/prefixed are transpiled down to the oldest PHP this plugin supports. Tests do not
4+
# prove that worked, because a file is only parsed when something loads it, so lint every file against that PHP.
5+
6+
on: pull_request
7+
8+
permissions:
9+
actions: read
10+
checks: read
11+
contents: read
12+
deployments: none
13+
issues: read
14+
packages: none
15+
pull-requests: read
16+
repository-projects: none
17+
security-events: none
18+
statuses: read
19+
20+
jobs:
21+
min-php-lint:
22+
name: Lint scoped dependencies on minimum PHP
23+
runs-on: ubuntu-24.04
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
lfs: false
28+
persist-credentials: false
29+
- name: Setup PHP
30+
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
31+
with:
32+
php-version: '8.1'
33+
- name: Lint vendor/prefixed
34+
run: |
35+
if [ ! -d vendor/prefixed ]; then
36+
echo "No vendor/prefixed directory to lint."
37+
exit 0
38+
fi
39+
status=0
40+
while IFS= read -r file; do
41+
if ! error=$(php -l "$file" 2>&1); then
42+
echo "::error file=${file}::${error}"
43+
status=1
44+
fi
45+
done < <(find vendor/prefixed -name '*.php')
46+
if [ "$status" -ne 0 ]; then
47+
echo "Scoped dependencies do not parse on PHP 8.1. Re-run the scoper."
48+
fi
49+
exit $status

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
## Changelog
22

3-
# 6.0.0 - 2026-08-11
3+
# 6.0.0 - 2026-08-24
44

55
- Compatibility with Matomo 6
6+
- Updated dependencies to address security advisories
67

78
# 5.2.1 - 2026-08-03
89
- Added PHPStan static analysis (CI check and pre-push hook)

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ This is done using the [Rector library](https://github.com/rectorphp/rector-down
2727
use Rector\Config\RectorConfig;
2828

2929
return static function (RectorConfig $rectorConfig): void {
30-
// Matomo requires PHP >= 7.2.5, but PHP 7.3 is close enough. We don't want to downgrade further than necessary.
30+
// Matomo 6 requires PHP >= 8.1. We don't want to downgrade further than necessary.
3131
$rectorConfig->sets([
32-
\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_73
32+
\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_81
3333
]);
3434

3535
$rectorConfig->skip([
@@ -39,4 +39,8 @@ return static function (RectorConfig $rectorConfig): void {
3939
```
4040
With all that in place, you should be able to run Rector like so: `vendor/bin/rector process {path_to_this_plugin/vendor/prefixed} --config={path_to_config_file}`
4141

42+
The downgrade level has to match this branch's minimum PHP, not Matomo 5's.
43+
44+
Before updating anything, note that `composer.json` pins `config.platform.php` to this branch's minimum. Composer otherwise resolves against whatever PHP you happen to be running, and a newer one silently produces a lock that will not install on the minimum — `ramsey/uuid` pulls in `brick/math`, whose recent releases require PHP 8.2. Keep that pin in place when regenerating. The `min-php-lint` workflow is the backstop, since tests only parse a file when something loads it.
45+
4246
> **_NOTE:_** For Matomo developers, there's an internal DevPluginCommands plugin with a command that handles scoping and running Rector. See the SearchEngineKeywordsPerformance plugin's README.md for more details.

composer.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
{
22
"require": {
33
"php": ">=8.1.0",
4-
"google/apiclient": "^2.15.3",
5-
"google/apiclient-services": "^0.224.1",
6-
"guzzlehttp\/guzzle": "7.10.1",
7-
"guzzlehttp\/psr7": "2.10.4",
4+
"google/apiclient": "^2.19.4",
5+
"google/apiclient-services": "^0.454.0",
6+
"guzzlehttp\/guzzle": "7.15.3",
7+
"guzzlehttp\/psr7": "2.13.0",
88
"guzzlehttp\/promises": "^2.3",
9-
"paragonie/constant_time_encoding": "2.5.0",
10-
"phpseclib/phpseclib": "3.0.52",
9+
"phpseclib/phpseclib": "3.0.56",
1110
"phpseclib/bcmath_compat": "^2.0",
1211
"google/analytics-admin": "^0.22.2",
1312
"google/analytics-data": "^0.17.1",
1413
"google/protobuf": "4.33.6",
1514
"symfony/deprecation-contracts": "^2.5"
1615
},
1716
"config": {
18-
"platform-check": false
17+
"platform-check": false,
18+
"platform": {
19+
"php": "8.1.0"
20+
}
1921
},
2022
"replace": {
2123
"monolog/monolog": "*"

0 commit comments

Comments
 (0)