Skip to content

Commit 2d16105

Browse files
committed
Upgrade dependencies, scope, and downgrade to match minimum PHP
1 parent d351900 commit 2d16105

898 files changed

Lines changed: 31915 additions & 41980 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.

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,27 @@
33
## Description
44

55
Allow generating OpenAPI documentation for the Matomo public APIs.
6+
7+
## Dependencies
8+
This plugin had its vendored dependencies scoped using [matomo scoper](https://github.com/matomo-org/matomo-scoper). This means that composer packages are prefixed so that they won't conflict with the same libraries used by other plugins.
9+
If you need to update a dependency, you should be able to run `composer install` to populate the vendor directory and then follow the [instructions for scoping a plugin](https://github.com/matomo-org/matomo-scoper#how-to-scope-a-matomo-plugin). Since the scoper.inc.php file already exists, it will hopefully be as simple as running the scoper for this plugin. Once that's done, you'll also need to make some of the dependencies compatible with Matomo's minimum supported version of PHP.
10+
This is done using the [Rector library](https://github.com/rectorphp/rector-downgrade-php). It's preferable that you install the composer package in a separate project and point to this project so that it doesn't get committed in this project. You should also have a config file saved containing the following:
11+
```php
12+
<?php
13+
14+
use Rector\Config\RectorConfig;
15+
16+
return static function (RectorConfig $rectorConfig): void {
17+
// Matomo requires PHP >= 7.2.5, but PHP 7.3 is close enough. We don't want to downgrade further than necessary.
18+
$rectorConfig->sets([
19+
\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_73
20+
]);
21+
22+
$rectorConfig->skip([
23+
\Rector\DowngradePhp80\Rector\Class_\DowngradeAttributeToAnnotationRector::class
24+
]);
25+
};
26+
```
27+
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}`
28+
29+
> **_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: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{
22
"require": {
3-
"zircote/swagger-php": "^5.1.4",
4-
"doctrine/annotations": "^2.0",
5-
"symfony/yaml": "^6.4",
6-
"symfony/finder": "^6.4"
3+
"zircote/swagger-php": "^5.4"
74
},
85
"replace": {
96
"monolog/monolog": "*",

0 commit comments

Comments
 (0)