Skip to content

Commit 803dea8

Browse files
authored
list released versions (#14)
* list released versions * fix CI complaints * dont use old workflows repo nothing else uses it, and it's got some bitrot * fixing checks * fix tools locations * fix phpstan
1 parent 7836bb3 commit 803dea8

46 files changed

Lines changed: 441 additions & 106 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/php.yaml

Lines changed: 73 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,78 @@ on:
55
branches: [ main ]
66
pull_request:
77
branches: [ main ]
8-
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
911

1012
jobs:
11-
deploy:
12-
uses: opentelemetry-php/gh-workflows/.github/workflows/php.yml@main
13-
with:
14-
matrix_extension: '["ast, json"]'
13+
php:
14+
runs-on: ubuntu-latest
15+
continue-on-error: ${{ matrix.experimental }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
php-version: ['8.1', '8.2', '8.3', '8.4']
20+
experimental: [false]
21+
22+
env:
23+
extensions: ast
24+
25+
steps:
26+
- uses: actions/checkout@v5
27+
28+
- name: Setup PHP
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: ${{ matrix.php-version }}
32+
extensions: ${{ env.extensions }}
33+
34+
- name: Validate composer.json
35+
run: composer validate
36+
37+
- name: Install dependencies
38+
id: composer
39+
if: steps.composer-cache.outputs.cache-hit != 'true'
40+
run: |
41+
composer --version
42+
composer install --prefer-dist --no-progress
43+
44+
- name: Check Style
45+
id: style
46+
continue-on-error: ${{ matrix.experimental }}
47+
env:
48+
PHP_CS_FIXER_IGNORE_ENV: 1
49+
run: |
50+
vendor-bin/php-cs-fixer/vendor/bin/php-cs-fixer --version
51+
vendor-bin/php-cs-fixer/vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --dry-run --stop-on-violation --using-cache=no -vvv
52+
53+
- name: Run Phan
54+
id: phan
55+
continue-on-error: ${{ matrix.experimental }}
56+
env:
57+
XDEBUG_MODE: off
58+
PHAN_DISABLE_XDEBUG_WARN: 1
59+
run: |
60+
vendor-bin/phan/vendor/bin/phan --version
61+
vendor-bin/phan/vendor/bin/phan
62+
63+
- name: Run Psalm
64+
id: psalm
65+
continue-on-error: ${{ matrix.experimental }}
66+
run: |
67+
vendor-bin/psalm/vendor/bin/psalm --version
68+
vendor-bin/psalm/vendor/bin/psalm --output-format=github
69+
70+
- name: Run Phpstan
71+
id: phpstan
72+
continue-on-error: ${{ matrix.experimental }}
73+
run: |
74+
vendor/bin/phpstan --version
75+
vendor/bin/phpstan analyse --error-format=github
76+
77+
- name: Run PHPUnit
78+
id: phpunit
79+
continue-on-error: ${{ matrix.experimental }}
80+
run: |
81+
vendor/bin/phpunit --version
82+
php -dzend.assertions=1 vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

.php-cs-fixer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
'blank_line_before_statement' => true,
2222
'cast_spaces' => true,
2323
'declare_strict_types' => true,
24-
'function_typehint_space' => true,
24+
'type_declaration_spaces' => true,
2525
'include' => true,
2626
'lowercase_cast' => true,
27-
'new_with_braces' => true,
27+
'new_with_parentheses' => true,
2828
'no_extra_blank_lines' => true,
2929
'no_leading_import_slash' => true,
3030
'echo_tag_syntax' => true,
@@ -35,7 +35,7 @@
3535
'phpdoc_scalar' => true,
3636
'phpdoc_types' => true,
3737
'short_scalar_cast' => true,
38-
'single_blank_line_before_namespace' => true,
38+
'blank_lines_before_namespace' => true,
3939
'single_quote' => true,
4040
'trailing_comma_in_multiline' => true,
4141
])

Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ PHP_VERSION ?= 8.1
77
DC_RUN_PHP = docker compose run --rm php
88
PSALM_THREADS ?= 1
99

10-
all: update style phan psalm phpstan test
10+
all: update all-checks
11+
all-checks: style phan psalm phpstan test
1112
install:
1213
$(DC_RUN_PHP) env XDEBUG_MODE=off composer install
1314
update:
@@ -20,17 +21,15 @@ test-integration:
2021
test-coverage:
2122
$(DC_RUN_PHP) env XDEBUG_MODE=coverage vendor/bin/phpunit --colors=always --testdox --testsuite unit --coverage-html=tests/coverage/html
2223
phan:
23-
$(DC_RUN_PHP) env XDEBUG_MODE=off env PHAN_DISABLE_XDEBUG_WARN=1 vendor/bin/phan
24+
$(DC_RUN_PHP) env XDEBUG_MODE=off env PHAN_DISABLE_XDEBUG_WARN=1 vendor-bin/phan/vendor/bin/phan
2425
psalm:
25-
$(DC_RUN_PHP) env XDEBUG_MODE=off vendor/bin/psalm --threads=${PSALM_THREADS} --no-cache --php-version=${PHP_VERSION}
26+
$(DC_RUN_PHP) env XDEBUG_MODE=off vendor-bin/psalm/vendor/bin/psalm --threads=${PSALM_THREADS} --no-cache --php-version=${PHP_VERSION}
2627
psalm-info:
27-
$(DC_RUN_PHP) env XDEBUG_MODE=off vendor/bin/psalm --show-info=true --threads=${PSALM_THREADS}
28+
$(DC_RUN_PHP) env XDEBUG_MODE=off vendor-bin/psalm/vendor/bin/psalm --show-info=true --threads=${PSALM_THREADS}
2829
phpstan:
2930
$(DC_RUN_PHP) env XDEBUG_MODE=off vendor/bin/phpstan analyse --memory-limit=256M
3031
bash:
3132
$(DC_RUN_PHP) bash
3233
style:
33-
$(DC_RUN_PHP) env XDEBUG_MODE=off vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --using-cache=no -vvv
34-
phpmetrics:
35-
$(DC_RUN_PHP) env XDEBUG_MODE=off vendor/bin/phpmetrics --config=./phpmetrics.json --junit=junit.xml
34+
$(DC_RUN_PHP) env XDEBUG_MODE=off vendor-bin/php-cs-fixer/vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --using-cache=no -vvv
3635
FORCE:

composer.json

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"minimum-stability": "dev",
1313
"prefer-stable": true,
1414
"require": {
15-
"php": "^7.4|^8.0",
15+
"php": "^8.1",
1616
"ext-json": "*",
1717
"ext-simplexml": "*",
1818
"composer/composer": "^2.3",
@@ -21,6 +21,9 @@
2121
"kriswallsmith/buzz": "^1.2",
2222
"nyholm/psr7": "^1.4",
2323
"php-http/discovery": "^1.19",
24+
"symfony/polyfill-php82": "^1.26",
25+
"symfony/polyfill-php83": "^1.32",
26+
"symfony/polyfill-php84": "^1.32",
2427
"symfony/runtime": "^5.0|^6.0",
2528
"symfony/service-contracts": "^1|^2.5",
2629
"symfony/yaml": "^4.4|^5.3|^6.0"
@@ -36,7 +39,12 @@
3639
}
3740
},
3841
"require-dev": {
39-
"open-telemetry/dev-common-metapackage": "dev-main"
42+
"bamarni/composer-bin-plugin": "^1.8",
43+
"mikey179/vfsstream": "^1.6",
44+
"phpstan/phpstan": "^1.10",
45+
"phpstan/phpstan-mockery": "^1.0",
46+
"phpstan/phpstan-phpunit": "^1.0",
47+
"phpunit/phpunit": "^9.3"
4048
},
4149
"scripts": {
4250
"post-install-cmd": [
@@ -52,9 +60,17 @@
5260
"config": {
5361
"sort-packages": true,
5462
"allow-plugins": {
63+
"bamarni/composer-bin-plugin": true,
5564
"composer/package-versions-deprecated": true,
56-
"symfony/runtime": true,
57-
"php-http/discovery": false
65+
"php-http/discovery": false,
66+
"symfony/runtime": true
67+
}
68+
},
69+
"extra": {
70+
"bamarni-bin": {
71+
"bin-links": false,
72+
"target-directory": "vendor-bin",
73+
"forward-command": true
5874
}
5975
}
6076
}

docker-compose.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
version: '3.7'
21
services:
32
php:
4-
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}
54
volumes:
65
- ./:/usr/src/myapp
76
user: "${PHP_USER}:root"

psalm.xml.dist

Lines changed: 69 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd">
88
<projectFiles>
99
<directory name="src"/>
10-
<directory name="tests"/>
1110
<ignoreFiles>
1211
<directory name="vendor"/>
1312
</ignoreFiles>
@@ -16,9 +15,76 @@
1615
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
1716
</plugins>
1817
<issueHandlers>
19-
<UndefinedDocblockClass>
18+
<PossiblyUnusedMethod>
2019
<errorLevel type="suppress">
20+
<directory name="src"/>
2121
</errorLevel>
22-
</UndefinedDocblockClass>
22+
</PossiblyUnusedMethod>
23+
<UnusedClass>
24+
<errorLevel type="suppress">
25+
<directory name="src"/>
26+
</errorLevel>
27+
</UnusedClass>
28+
<FalsableReturnStatement>
29+
<errorLevel type="suppress">
30+
<directory name="src"/>
31+
</errorLevel>
32+
</FalsableReturnStatement>
33+
<PossiblyUnusedReturnValue>
34+
<errorLevel type="suppress">
35+
<directory name="src"/>
36+
</errorLevel>
37+
</PossiblyUnusedReturnValue>
38+
<MissingTemplateParam>
39+
<errorLevel type="suppress">
40+
<directory name="src"/>
41+
</errorLevel>
42+
</MissingTemplateParam>
43+
<PossiblyUnusedParam>
44+
<errorLevel type="suppress">
45+
<directory name="src"/>
46+
</errorLevel>
47+
</PossiblyUnusedParam>
48+
<PossiblyFalseArgument>
49+
<errorLevel type="suppress">
50+
<directory name="src"/>
51+
</errorLevel>
52+
</PossiblyFalseArgument>
53+
<PossiblyFalseOperand>
54+
<errorLevel type="suppress">
55+
<directory name="src"/>
56+
</errorLevel>
57+
</PossiblyFalseOperand>
58+
<PossiblyNullPropertyAssignment>
59+
<errorLevel type="suppress">
60+
<directory name="src"/>
61+
</errorLevel>
62+
</PossiblyNullPropertyAssignment>
63+
<PossiblyNullPropertyFetch>
64+
<errorLevel type="suppress">
65+
<directory name="src"/>
66+
</errorLevel>
67+
</PossiblyNullPropertyFetch>
68+
<PossiblyNullReference>
69+
<errorLevel type="suppress">
70+
<directory name="src"/>
71+
</errorLevel>
72+
</PossiblyNullReference>
73+
<PossiblyInvalidArgument>
74+
<errorLevel type="suppress">
75+
<directory name="src"/>
76+
</errorLevel>
77+
</PossiblyInvalidArgument>
78+
<PossiblyInvalidCast>
79+
<errorLevel type="suppress">
80+
<directory name="src"/>
81+
</errorLevel>
82+
</PossiblyInvalidCast>
83+
<ArgumentTypeCoercion>
84+
<errorLevel type="suppress">
85+
<directory name="src"/>
86+
</errorLevel>
87+
</ArgumentTypeCoercion>
88+
2389
</issueHandlers>
2490
</psalm>

src/Console/Application/Application.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use OpenTelemetry\DevTools\Console\Command\Release\PeclCommand;
1010
use OpenTelemetry\DevTools\Console\Command\Release\PeclTagCommand;
1111
use OpenTelemetry\DevTools\Console\Command\Release\ReleaseCommand;
12+
use OpenTelemetry\DevTools\Console\Command\Release\ReleaseListCommand;
1213
use OpenTelemetry\DevTools\Package\Composer\MultiRepositoryInfoResolver;
1314
use OpenTelemetry\DevTools\Package\Composer\PackageAttributeResolverFactory;
1415
use OpenTelemetry\DevTools\Package\GitSplit\ConfigResolver;
@@ -38,6 +39,7 @@ private function initCommands(): void
3839
)
3940
),
4041
new ReleaseCommand(),
42+
new ReleaseListCommand(),
4143
new PeclCommand(),
4244
new PeclTagCommand(),
4345
]);

src/Console/Command/Packages/Behavior/UsesThirdPartyCommandTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ protected function createAndRunCommand(
2828
string $commandClass,
2929
InputInterface $input,
3030
OutputInterface $output,
31-
string $workingDirectory = null
31+
?string $workingDirectory = null
3232
): int {
3333
return $this->runCommand(
3434
$this->createCommand($commandClass),
@@ -42,7 +42,7 @@ protected function runCommand(
4242
Command $command,
4343
InputInterface $input,
4444
OutputInterface $output,
45-
string $workingDirectory = null
45+
?string $workingDirectory = null
4646
): int {
4747
$oldWorkingDir = WorkingDirectoryResolver::create()->resolve();
4848

src/Console/Command/Packages/ValidateInstallationCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public function __construct(
7474
$this->initWorkingDirectory();
7575
}
7676

77+
#[\Override]
7778
protected function configure(): void
7879
{
7980
$this->setDescription(self::DESCRIPTION);
@@ -97,6 +98,7 @@ protected function configure(): void
9798
);
9899
}
99100

101+
#[\Override]
100102
protected function execute(InputInterface $input, OutputInterface $output): int
101103
{
102104
$this->registerInputAndOutput($input, $output);
@@ -265,7 +267,7 @@ private static function resolveBranchOptionValue(InputInterface $input): ?string
265267
: null;
266268
}
267269

268-
private function runUpdateCommand(string $workingDirectory = null): int
270+
private function runUpdateCommand(?string $workingDirectory = null): int
269271
{
270272
return $this->createAndRunCommand(
271273
UpdateCommand::class,

src/Console/Command/Packages/ValidatePackagesCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ public function __construct(ConfigResolverInterface $resolver, ?CommandRunner $c
3434
$this->commandRunner = $commandRunner ?? CommandRunner::create();
3535
}
3636

37+
#[\Override]
3738
protected function configure(): void
3839
{
3940
$this->setDescription(self::DESCRIPTION);
4041
}
4142

43+
#[\Override]
4244
protected function execute(InputInterface $input, OutputInterface $output): int
4345
{
4446
$this->registerInputAndOutput($input, $output);

0 commit comments

Comments
 (0)