Skip to content

Commit ee1513a

Browse files
authored
ci: Add Symfony 7.x to the pipeline (#267)
1 parent b66deb1 commit ee1513a

File tree

8 files changed

+285
-90
lines changed

8 files changed

+285
-90
lines changed

.github/workflows/tests.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
- "8.1"
2020
- "8.2"
2121
- "8.3"
22+
- "8.4"
2223

2324
steps:
2425
- name: "Check out repository code"
@@ -53,6 +54,12 @@ jobs:
5354
symfony:
5455
- version_name: "6.4"
5556
conflict: "<6.4 || >=7.0"
57+
- version_name: "7.2"
58+
conflict: "<7.2 || >=8.0"
59+
exclude:
60+
- symfony:
61+
version_name: "7.2"
62+
php: "8.1"
5663

5764
steps:
5865
- name: "Check out repository code"

composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
"fidry/cpu-core-counter": "^0.5.0 || ^1.0",
1919
"nikic/iter": "^2.2",
2020
"psr/log": "^1.1 || ^2.0 || ^3.0",
21-
"symfony/console": "^6.4.15",
22-
"symfony/dependency-injection": "^6.4.15",
21+
"symfony/console": "^6.4.15 || ^7.2",
22+
"symfony/dependency-injection": "^6.4.16 || ^7.2",
2323
"symfony/deprecation-contracts": "^2.5 || ^3.1",
24-
"symfony/process": "^6.4.15",
24+
"symfony/process": "^6.4.15 || ^7.2",
2525
"symfony/service-contracts": "^3.3",
2626
"thecodingmachine/safe": "^1.3.3 || ^2.4",
2727
"webmozart/assert": "^1.5"
@@ -41,7 +41,7 @@
4141
"phpstan/phpstan-symfony": "^1.2",
4242
"phpstan/phpstan-webmozart-assert": "^1.2",
4343
"phpunit/phpunit": "^10.5.38 || ^11.0",
44-
"symfony/framework-bundle": "^6.4.10",
44+
"symfony/framework-bundle": "^6.4.10 || ^7.2",
4545
"webmozarts/strict-phpunit": "^7.3"
4646
},
4747
"autoload": {

phpstan-tests.neon.dist

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ parameters:
88
- tests/Input/FakeInput.php
99
- tests/Input/FakeInput74.php
1010
- tests/Input/FakeInput81.php
11+
- tests/Input/FakeSymfony6Input.php
1112
- tests/Process/DummyProcess.php
1213
- tests/Process/DummyProcess74.php
1314
- tests/Process/DummyProcess81.php
@@ -37,3 +38,6 @@ parameters:
3738

3839
- path: tests/Fixtures/Command/LegacyCommand.php
3940
message: '#Static method .* is unused#'
41+
42+
- path: tests/Input/RawInputTest.php
43+
message: '#Webmozarts\\Console\\Parallelization\\Input\\FakeInput#'

src/Input/RawInput.php

+5
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,9 @@ protected function parse(): void
9191
{
9292
throw new DomainException('Not implemented.');
9393
}
94+
95+
public function __toString(): string
96+
{
97+
return 'RawInput';
98+
}
9499
}

tests/Input/FakeInput.php

+16-86
Original file line numberDiff line numberDiff line change
@@ -13,89 +13,19 @@
1313

1414
namespace Webmozarts\Console\Parallelization\Input;
1515

16-
use Symfony\Component\Console\Input\InputDefinition;
17-
use Symfony\Component\Console\Input\InputInterface;
18-
use Webmozarts\Console\Parallelization\UnexpectedCall;
19-
20-
final class FakeInput implements InputInterface
21-
{
22-
public function __call($name, $arguments): void
23-
{
24-
throw UnexpectedCall::forMethod(__METHOD__);
25-
}
26-
27-
public function getFirstArgument(): ?string
28-
{
29-
throw UnexpectedCall::forMethod(__METHOD__);
30-
}
31-
32-
public function hasParameterOption($values, bool $onlyParams = false): bool
33-
{
34-
throw UnexpectedCall::forMethod(__METHOD__);
35-
}
36-
37-
public function getParameterOption(array|string $values, array|bool|float|int|string|null $default = false, bool $onlyParams = false): void
38-
{
39-
throw UnexpectedCall::forMethod(__METHOD__);
40-
}
41-
42-
public function bind(InputDefinition $definition): void
43-
{
44-
throw UnexpectedCall::forMethod(__METHOD__);
45-
}
46-
47-
public function validate(): void
48-
{
49-
throw UnexpectedCall::forMethod(__METHOD__);
50-
}
51-
52-
public function getArguments(): array
53-
{
54-
throw UnexpectedCall::forMethod(__METHOD__);
55-
}
56-
57-
public function getArgument(string $name): void
58-
{
59-
throw UnexpectedCall::forMethod(__METHOD__);
60-
}
61-
62-
public function setArgument(string $name, $value): void
63-
{
64-
throw UnexpectedCall::forMethod(__METHOD__);
65-
}
66-
67-
public function hasArgument(string $name): bool
68-
{
69-
throw UnexpectedCall::forMethod(__METHOD__);
70-
}
71-
72-
public function getOptions(): array
73-
{
74-
throw UnexpectedCall::forMethod(__METHOD__);
75-
}
76-
77-
public function getOption(string $name): void
78-
{
79-
throw UnexpectedCall::forMethod(__METHOD__);
80-
}
81-
82-
public function setOption(string $name, $value): void
83-
{
84-
throw UnexpectedCall::forMethod(__METHOD__);
85-
}
86-
87-
public function hasOption(string $name): bool
88-
{
89-
throw UnexpectedCall::forMethod(__METHOD__);
90-
}
91-
92-
public function isInteractive(): bool
93-
{
94-
throw UnexpectedCall::forMethod(__METHOD__);
95-
}
96-
97-
public function setInteractive(bool $interactive): void
98-
{
99-
throw UnexpectedCall::forMethod(__METHOD__);
100-
}
101-
}
16+
use Composer\InstalledVersions;
17+
use Composer\Semver\VersionParser;
18+
use function class_alias;
19+
20+
$isSfConsole7OrHigher = InstalledVersions::satisfies(
21+
new VersionParser(),
22+
'symfony/console',
23+
'^7.0',
24+
);
25+
26+
class_alias(
27+
$isSfConsole7OrHigher
28+
? FakeSymfony7Input::class
29+
: FakeSymfony6Input::class,
30+
FakeInput::class,
31+
);

tests/Input/FakeSymfony6Input.php

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Webmozarts Console Parallelization package.
5+
*
6+
* (c) Webmozarts GmbH <office@webmozarts.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Webmozarts\Console\Parallelization\Input;
15+
16+
use Symfony\Component\Console\Input\InputDefinition;
17+
use Symfony\Component\Console\Input\InputInterface;
18+
use Webmozarts\Console\Parallelization\UnexpectedCall;
19+
20+
final class FakeSymfony6Input implements InputInterface
21+
{
22+
public function __call($name, $arguments): void
23+
{
24+
throw UnexpectedCall::forMethod(__METHOD__);
25+
}
26+
27+
public function getFirstArgument(): ?string
28+
{
29+
throw UnexpectedCall::forMethod(__METHOD__);
30+
}
31+
32+
public function hasParameterOption($values, bool $onlyParams = false): bool
33+
{
34+
throw UnexpectedCall::forMethod(__METHOD__);
35+
}
36+
37+
public function getParameterOption(array|string $values, array|bool|float|int|string|null $default = false, bool $onlyParams = false): void
38+
{
39+
throw UnexpectedCall::forMethod(__METHOD__);
40+
}
41+
42+
public function bind(InputDefinition $definition): void
43+
{
44+
throw UnexpectedCall::forMethod(__METHOD__);
45+
}
46+
47+
public function validate(): void
48+
{
49+
throw UnexpectedCall::forMethod(__METHOD__);
50+
}
51+
52+
public function getArguments(): array
53+
{
54+
throw UnexpectedCall::forMethod(__METHOD__);
55+
}
56+
57+
public function getArgument(string $name): void
58+
{
59+
throw UnexpectedCall::forMethod(__METHOD__);
60+
}
61+
62+
public function setArgument(string $name, $value): void
63+
{
64+
throw UnexpectedCall::forMethod(__METHOD__);
65+
}
66+
67+
public function hasArgument(string $name): bool
68+
{
69+
throw UnexpectedCall::forMethod(__METHOD__);
70+
}
71+
72+
public function getOptions(): array
73+
{
74+
throw UnexpectedCall::forMethod(__METHOD__);
75+
}
76+
77+
public function getOption(string $name): void
78+
{
79+
throw UnexpectedCall::forMethod(__METHOD__);
80+
}
81+
82+
public function setOption(string $name, $value): void
83+
{
84+
throw UnexpectedCall::forMethod(__METHOD__);
85+
}
86+
87+
public function hasOption(string $name): bool
88+
{
89+
throw UnexpectedCall::forMethod(__METHOD__);
90+
}
91+
92+
public function isInteractive(): bool
93+
{
94+
throw UnexpectedCall::forMethod(__METHOD__);
95+
}
96+
97+
public function setInteractive(bool $interactive): void
98+
{
99+
throw UnexpectedCall::forMethod(__METHOD__);
100+
}
101+
}

tests/Input/FakeSymfony7Input.php

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Webmozarts Console Parallelization package.
5+
*
6+
* (c) Webmozarts GmbH <office@webmozarts.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Webmozarts\Console\Parallelization\Input;
15+
16+
use Symfony\Component\Console\Input\InputDefinition;
17+
use Symfony\Component\Console\Input\InputInterface;
18+
use Webmozarts\Console\Parallelization\UnexpectedCall;
19+
20+
final class FakeSymfony7Input implements InputInterface
21+
{
22+
public function __call($name, $arguments): void
23+
{
24+
throw UnexpectedCall::forMethod(__METHOD__);
25+
}
26+
27+
public function getFirstArgument(): ?string
28+
{
29+
throw UnexpectedCall::forMethod(__METHOD__);
30+
}
31+
32+
public function hasParameterOption($values, bool $onlyParams = false): bool
33+
{
34+
throw UnexpectedCall::forMethod(__METHOD__);
35+
}
36+
37+
public function getParameterOption(array|string $values, array|string|int|float|bool|null $default = false, bool $onlyParams = false): mixed
38+
{
39+
throw UnexpectedCall::forMethod(__METHOD__);
40+
}
41+
42+
public function bind(InputDefinition $definition): void
43+
{
44+
throw UnexpectedCall::forMethod(__METHOD__);
45+
}
46+
47+
public function validate(): void
48+
{
49+
throw UnexpectedCall::forMethod(__METHOD__);
50+
}
51+
52+
public function getArguments(): array
53+
{
54+
throw UnexpectedCall::forMethod(__METHOD__);
55+
}
56+
57+
public function getArgument(string $name): mixed
58+
{
59+
throw UnexpectedCall::forMethod(__METHOD__);
60+
}
61+
62+
public function setArgument(string $name, $value): void
63+
{
64+
throw UnexpectedCall::forMethod(__METHOD__);
65+
}
66+
67+
public function hasArgument(string $name): bool
68+
{
69+
throw UnexpectedCall::forMethod(__METHOD__);
70+
}
71+
72+
public function getOptions(): array
73+
{
74+
throw UnexpectedCall::forMethod(__METHOD__);
75+
}
76+
77+
public function getOption(string $name): mixed
78+
{
79+
throw UnexpectedCall::forMethod(__METHOD__);
80+
}
81+
82+
public function setOption(string $name, $value): void
83+
{
84+
throw UnexpectedCall::forMethod(__METHOD__);
85+
}
86+
87+
public function hasOption(string $name): bool
88+
{
89+
throw UnexpectedCall::forMethod(__METHOD__);
90+
}
91+
92+
public function isInteractive(): bool
93+
{
94+
throw UnexpectedCall::forMethod(__METHOD__);
95+
}
96+
97+
public function setInteractive(bool $interactive): void
98+
{
99+
throw UnexpectedCall::forMethod(__METHOD__);
100+
}
101+
102+
public function __toString(): string
103+
{
104+
return 'FakeInput';
105+
}
106+
}

0 commit comments

Comments
 (0)