Skip to content

Commit 28ccadf

Browse files
authored
Initial config changes for 2.x versions: * update to php 8.2 minimum * gitsplit 2.x * skip rector ReadOnlyClassRector
1 parent b515b6b commit 28ccadf

File tree

22 files changed

+55
-217
lines changed

22 files changed

+55
-217
lines changed

.github/workflows/php.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: PHP QA
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ main, 1.x, 2.x ]
66
pull_request:
7-
branches: [ main ]
7+
branches: [ main, 1.x, 2.x ]
88

99
jobs:
1010
php:
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
php-version: ['8.1', '8.2', '8.3']
16+
php-version: ['8.2', '8.3']
1717
experimental: [false]
1818
composer_args: [""]
1919
include:
@@ -154,5 +154,5 @@ jobs:
154154
needs: php
155155
with:
156156
matrix_extension: '["ast, json, grpc"]'
157-
matrix_php_version: '["8.1", "8.2", "8.3"]'
157+
matrix_php_version: '["8.2", "8.3", "8.4"]'
158158
install_directory: '~/.test/.packages'

.github/workflows/shellcheck.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Shellcheck
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ main, 1.x, 2.x ]
66
pull_request:
7-
branches: [ main ]
7+
branches: [ main, 1.x, 2.x ]
88

99
jobs:
1010
shellcheck:

.github/workflows/split-monorepo.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ on:
44
branches:
55
- main
66
- split
7-
release:
8-
types: [published]
7+
- 1.x
8+
- 2.x
99
create:
1010
workflow_dispatch:
1111

.gitsplit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ splits:
3535
origins:
3636
- ^main$
3737
- ^split$
38+
- ^2.x^

DEVELOPMENT.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ This does the following things:
7777
### Other PHP versions
7878

7979
We aim to support officially supported PHP versions, according to https://www.php.net/supported-versions.php. The
80-
developer image `ghcr.io/open-telemetry/opentelemetry-php/opentelemetry-php-base` is tagged as `8.1`, `8.2` and `8.3`
81-
respectively, with `8.1` being the default. You can execute the test suite against other PHP versions by running the
80+
developer image `ghcr.io/open-telemetry/opentelemetry-php/opentelemetry-php-base` is tagged as `8.2`, `8.3` and `8.4`
81+
respectively, with `8.2` being the default. You can execute the test suite against other PHP versions by running the
8282
following command:
8383

8484
```bash
85-
PHP_VERSION=8.1 make all
85+
PHP_VERSION=8.2 make all
8686
#or
8787
PHP_VERSION=8.3 make all
8888
```

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
include .env
22

3-
PHP_VERSION ?= 8.1
3+
PHP_VERSION ?= 8.2
44
DOCKER_COMPOSE ?= docker compose
55
DC_RUN_PHP = $(DOCKER_COMPOSE) run --rm php
66

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@
101101
"phpstan/phpstan": "^1.10.13",
102102
"phpstan/phpstan-mockery": "^1.1",
103103
"phpstan/phpstan-phpunit": "^1.3",
104-
"phpunit/phpunit": "^10 || ^11",
105-
"sebastian/exporter": "<= 6.0.1 || >= 6.1.3",
104+
"phpunit/phpunit": "^11",
105+
"sebastian/exporter": "^6.3",
106106
"symfony/http-client": "^5.2",
107107
"symfony/var-exporter": "^5.4 || ^6.4 || ^7.0",
108108
"symfony/yaml": "^5.4 || ^6.4 || ^7.0"

docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
php:
3-
image: ghcr.io/open-telemetry/opentelemetry-php/opentelemetry-php-base:${PHP_VERSION:-8.1}
3+
image: ghcr.io/open-telemetry/opentelemetry-php/opentelemetry-php-base:${PHP_VERSION:-8.2}
44
volumes:
55
- ./:/usr/src/myapp
66
user: "${PHP_USER}:root"

rector.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,34 @@
22

33
declare(strict_types=1);
44

5-
use Rector\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector;
65
use Rector\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector;
76
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
87
use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector;
98
use Rector\Config\RectorConfig;
10-
use Rector\Php81\Rector\ClassMethod\NewInInitializerRector;
11-
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
9+
use Rector\Php82\Rector\Class_\ReadOnlyClassRector;
1210
use Rector\PHPUnit\Set\PHPUnitSetList;
1311
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
1412
use Rector\ValueObject\PhpVersion;
1513
use Rector\Set\ValueObject\SetList;
1614

1715
return static function (RectorConfig $rectorConfig): void {
18-
$rectorConfig->phpVersion(PhpVersion::PHP_81);
16+
$rectorConfig->phpVersion(PhpVersion::PHP_82);
1917

2018
$rectorConfig->paths([
2119
__DIR__ . '/src',
2220
__DIR__ . '/tests',
2321
]);
2422

2523
$rectorConfig->sets([
26-
SetList::PHP_81,
24+
SetList::PHP_82,
2725
SetList::CODE_QUALITY,
2826
PHPUnitSetList::PHPUNIT_100,
2927
]);
3028
$rectorConfig->skip([
3129
FlipTypeControlToUseExclusiveTypeRector::class,
32-
NewInInitializerRector::class => [
33-
__DIR__ . '/src/SDK/Trace/Sampler/ParentBased.php',
34-
],
35-
ReadOnlyPropertyRector::class => [
36-
__DIR__ . '/src/SDK/Metrics/Stream/SynchronousMetricStream.php',
37-
__DIR__ . '/tests/Unit/Extension/Propagator',
38-
],
3930
DisallowedEmptyRuleFixerRector::class,
4031
ExplicitBoolCompareRector::class,
4132
LocallyCalledStaticMethodToNonStaticRector::class,
33+
ReadOnlyClassRector::class,
4234
]);
4335
};

src/API/composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717
}
1818
],
1919
"require": {
20-
"php": "^8.1",
20+
"php": "^8.2",
2121
"open-telemetry/context": "^1.0",
22-
"psr/log": "^1.1|^2.0|^3.0",
23-
"symfony/polyfill-php82": "^1.26"
22+
"psr/log": "^1.1|^2.0|^3.0"
2423
},
2524
"conflict": {
2625
"open-telemetry/sdk": "<=1.0.8"
@@ -35,7 +34,8 @@
3534
},
3635
"extra": {
3736
"branch-alias": {
38-
"dev-main": "1.1.x-dev"
37+
"dev-main": "1.1.x-dev",
38+
"dev-2.x": "2.x-dev"
3939
},
4040
"spi": {
4141
"OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\HookManagerInterface": [

0 commit comments

Comments
 (0)