Skip to content

Commit 514ff09

Browse files
authored
chore: Bump to PHP 8.2 (#904)
1 parent 6a3a69e commit 514ff09

39 files changed

+121
-102
lines changed

.github/workflows/composer-root-version.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Setup PHP
2525
uses: shivammathur/setup-php@v2
2626
with:
27-
php-version: '8.1'
27+
php-version: '8.2'
2828
tools: composer
2929
coverage: none
3030

@@ -54,7 +54,7 @@ jobs:
5454
strategy:
5555
fail-fast: false
5656
matrix:
57-
php: [ '8.1', '8.2' ]
57+
php: [ '8.2' ]
5858

5959
steps:
6060
- name: Checkout
@@ -108,7 +108,7 @@ jobs:
108108
- name: Setup PHP
109109
uses: shivammathur/setup-php@v2
110110
with:
111-
php-version: '8.1'
111+
php-version: '8.2'
112112
tools: composer
113113
coverage: none
114114

.github/workflows/e2e-tests.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
php:
26-
- '8.1'
2726
- '8.2'
2827
steps:
2928
- name: Checkout
@@ -88,14 +87,13 @@ jobs:
8887
- 'e2e_036'
8988
- 'e2e_037'
9089
php:
91-
- '8.1'
9290
- '8.2'
9391
composer:
9492
- 'composer:2.2'
9593
- 'composer'
9694
include:
9795
- e2e: 'e2e_039'
98-
php: '8.1'
96+
php: '8.2'
9997
composer: 'composer:2.2'
10098

10199
steps:

.github/workflows/lint.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Setup PHP
2525
uses: shivammathur/setup-php@v2
2626
with:
27-
php-version: '8.1'
27+
php-version: '8.2'
2828
tools: composer
2929
coverage: none
3030

@@ -48,7 +48,7 @@ jobs:
4848
- name: Setup PHP
4949
uses: shivammathur/setup-php@v2
5050
with:
51-
php-version: '8.1'
51+
php-version: '8.2'
5252
tools: composer
5353
coverage: none
5454

@@ -72,7 +72,7 @@ jobs:
7272
- name: Setup PHP
7373
uses: shivammathur/setup-php@v2
7474
with:
75-
php-version: '8.1'
75+
php-version: '8.2'
7676
tools: composer
7777
coverage: none
7878

.github/workflows/release.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Setup PHP
3333
uses: shivammathur/setup-php@v2
3434
with:
35-
php-version: '8.1'
35+
php-version: '8.2'
3636
ini-values: phar.readonly=0
3737
tools: composer
3838
coverage: none
@@ -105,6 +105,11 @@ jobs:
105105
- name: Checkout
106106
uses: actions/checkout@v4
107107

108+
- name: Setup PHP
109+
uses: shivammathur/setup-php@v2
110+
with:
111+
php-version: '8.2'
112+
108113
- uses: actions/download-artifact@v3
109114
with:
110115
name: php-scoper-phar

.github/workflows/tests.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ jobs:
6767
fail-fast: false
6868
matrix:
6969
php:
70-
- '8.1'
7170
- '8.2'
7271
steps:
7372
- name: Checkout

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
!/bin/infection.sh
2+
!/bin/php-scoper
13
/.box_dump/
24
/.php-cs-fixer.cache
35
/.phpcs-cache
46
/.phpunit*
57
/bin/*
6-
!/bin/infection.sh
7-
!/bin/php-scoper
88
/box.json
99
/clover.xml
1010
/fixtures/*/.box_dump/

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8.1-cli-alpine
1+
FROM php:8.2-cli-alpine
22

33
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
44
RUN install-php-extensions zlib phar sodium tokenizer filter

composer-root-version-checker/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Small utility to manipulate the Composer root version.",
44
"license": "proprietary",
55
"require": {
6-
"php": "^8.1",
6+
"php": "^8.2",
77
"psr/log": "^3.0",
88
"thecodingmachine/safe": "^2.4"
99
},

composer-root-version-checker/composer.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818
],
1919
"require": {
20-
"php": "^8.1",
20+
"php": "^8.2",
2121
"fidry/console": "^0.5.0",
2222
"fidry/filesystem": "^1.1",
2323
"jetbrains/phpstorm-stubs": "^v2022.2",
@@ -67,7 +67,7 @@
6767
},
6868
"bin-dir": "bin",
6969
"platform": {
70-
"php": "8.1.0"
70+
"php": "8.2.0"
7171
},
7272
"sort-packages": true
7373
},

composer.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rector.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,27 @@
2121

2222
$rectorConfig->sets([
2323
LevelSetList::UP_TO_PHP_81,
24+
LevelSetList::UP_TO_PHP_82,
2425
]);
2526

2627
$rectorConfig->skip([
27-
'NullToStrictStringFuncCallArgRector'
28+
__DIR__.'/src/PhpParser/TraverserFactory.php',
29+
__DIR__.'/tests/PhpParser/UseStmtNameTest.php',
30+
__DIR__.'/src/PhpParser/NodeVisitor/AttributeAppender/ParentNodeAppender.php',
31+
32+
\Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector::class,
33+
\Rector\Php73\Rector\String_\SensitiveHereNowDocRector::class,
34+
\Rector\Php81\Rector\ClassMethod\NewInInitializerRector::class => [
35+
__DIR__.'/src/Configuration/Configuration.php',
36+
],
37+
\Rector\Php81\Rector\Property\ReadOnlyPropertyRector::class => [
38+
__DIR__.'/src/Configuration/Configuration.php',
39+
],
40+
\Rector\Php55\Rector\String_\StringClassNameToClassConstantRector::class => [
41+
__DIR__.'/tests/Symbol/NamespaceRegistryTest.php',
42+
__DIR__.'/tests/Symbol/Reflector/UserSymbolsReflectorTest.php',
43+
__DIR__.'/tests/Symbol/SymbolRegistryTest.php',
44+
__DIR__.'/tests/Symbol/SymbolsRegistryTest.php',
45+
],
2846
]);
2947
};

src/Autoload/ComposerFileHasher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
use function preg_match;
2121
use function sprintf;
2222

23-
final class ComposerFileHasher
23+
final readonly class ComposerFileHasher
2424
{
2525
private const ROOT_PACKAGE_NAME = '__root__';
2626
private const PACKAGE_PATH_REGEX = '~^%s/(?<vendor>[^/]+?/[^/]+?)/(?<path>.+?)$~';

src/Configuration/ConfigurationFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@
5151
use function trim;
5252
use const DIRECTORY_SEPARATOR;
5353

54-
final class ConfigurationFactory
54+
final readonly class ConfigurationFactory
5555
{
5656
public const DEFAULT_FILE_NAME = 'scoper.inc.php';
5757

5858
public function __construct(
59-
private readonly Filesystem $fileSystem,
60-
private readonly SymbolsConfigurationFactory $symbolsConfigurationFactory,
59+
private Filesystem $fileSystem,
60+
private SymbolsConfigurationFactory $symbolsConfigurationFactory,
6161
) {
6262
}
6363

src/Configuration/SymbolsConfiguration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use Humbug\PhpScoper\Symbol\NamespaceRegistry;
1919
use Humbug\PhpScoper\Symbol\SymbolRegistry;
2020

21-
final class SymbolsConfiguration
21+
final readonly class SymbolsConfiguration
2222
{
2323
use NotInstantiable;
2424

src/Configuration/SymbolsConfigurationFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
use function strrpos;
3030
use function substr;
3131

32-
final class SymbolsConfigurationFactory
32+
final readonly class SymbolsConfigurationFactory
3333
{
34-
public function __construct(private readonly RegexChecker $regexChecker)
34+
public function __construct(private RegexChecker $regexChecker)
3535
{
3636
}
3737

src/Console/Application.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* @private
3131
* @codeCoverageIgnore
3232
*/
33-
final class Application implements FidryApplication
33+
final readonly class Application implements FidryApplication
3434
{
3535
private const LOGO = <<<'ASCII'
3636
@@ -60,11 +60,11 @@ public static function create(): self
6060
}
6161

6262
public function __construct(
63-
private readonly Container $container,
64-
private readonly string $version,
65-
private readonly string $releaseDate,
66-
private readonly bool $isAutoExitEnabled,
67-
private readonly bool $areExceptionsCaught,
63+
private Container $container,
64+
private string $version,
65+
private string $releaseDate,
66+
private bool $isAutoExitEnabled,
67+
private bool $areExceptionsCaught,
6868
) {
6969
}
7070

src/Console/Command/InitCommand.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
namespace Humbug\PhpScoper\Console\Command;
1616

1717
use Fidry\Console\Command\Command;
18-
use Fidry\Console\Command\Configuration;
1918
use Fidry\Console\Command\Configuration as CommandConfiguration;
2019
use Fidry\Console\Input\IO;
2120
use Symfony\Component\Console\Helper\FormatterHelper;
@@ -30,21 +29,21 @@
3029
* @private
3130
* @codeCoverageIgnore
3231
*/
33-
final class InitCommand implements Command
32+
final readonly class InitCommand implements Command
3433
{
3534
private const CONFIG_FILE_OPT = 'config';
3635
private const CONFIG_FILE_TEMPLATE = __DIR__.'/../../scoper.inc.php.tpl';
3736
private const CONFIG_FILE_DEFAULT = 'scoper.inc.php';
3837

3938
public function __construct(
40-
private readonly Filesystem $fileSystem,
41-
private readonly FormatterHelper $formatterHelper,
39+
private Filesystem $fileSystem,
40+
private FormatterHelper $formatterHelper,
4241
) {
4342
}
4443

4544
public function getConfiguration(): CommandConfiguration
4645
{
47-
return new Configuration(
46+
return new CommandConfiguration(
4847
'init',
4948
'Generates a configuration file.',
5049
'',

src/Console/Command/InspectSymbolCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@
4141
/**
4242
* @private
4343
*/
44-
final class InspectSymbolCommand implements Command
44+
final readonly class InspectSymbolCommand implements Command
4545
{
4646
private const SYMBOL_ARG = 'symbol';
4747
private const SYMBOL_TYPE_ARG = 'type';
4848
private const CONFIG_FILE_OPT = 'config';
4949
private const NO_CONFIG_OPT = 'no-config';
5050

5151
public function __construct(
52-
private readonly Filesystem $fileSystem,
53-
private readonly ConfigurationFactory $configFactory,
54-
private readonly EnrichedReflectorFactory $enrichedReflectorFactory,
52+
private Filesystem $fileSystem,
53+
private ConfigurationFactory $configFactory,
54+
private EnrichedReflectorFactory $enrichedReflectorFactory,
5555
) {
5656
}
5757

src/Console/ConfigLoader.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@
3333
/**
3434
* @private
3535
*/
36-
final class ConfigLoader
36+
final readonly class ConfigLoader
3737
{
3838
public function __construct(
39-
private readonly CommandRegistry $commandRegistry,
40-
private readonly Filesystem $fileSystem,
41-
private readonly ConfigurationFactory $configFactory,
39+
private CommandRegistry $commandRegistry,
40+
private Filesystem $fileSystem,
41+
private ConfigurationFactory $configFactory,
4242
) {
4343
}
4444

src/Console/ConsoleScoper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@
4343
/**
4444
* @private
4545
*/
46-
final class ConsoleScoper
46+
final readonly class ConsoleScoper
4747
{
4848
private const VENDOR_DIR_PATTERN = '~((?:.*)\\'.DIRECTORY_SEPARATOR.'vendor)\\'.DIRECTORY_SEPARATOR.'.*~';
4949

5050
public function __construct(
51-
private readonly Filesystem $fileSystem,
52-
private readonly Application $application,
53-
private readonly ScoperFactory $scoperFactory,
51+
private Filesystem $fileSystem,
52+
private Application $application,
53+
private ScoperFactory $scoperFactory,
5454
) {
5555
}
5656

src/Patcher/PatcherChain.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
use function array_reduce;
1818

19-
final class PatcherChain implements Patcher
19+
final readonly class PatcherChain implements Patcher
2020
{
2121
/**
2222
* @param array<(callable(string, string, string): string)|Patcher> $patchers

0 commit comments

Comments
 (0)