Skip to content

Commit

Permalink
chore: Bump to PHP 8.2 (#904)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Nov 18, 2023
1 parent 6a3a69e commit 514ff09
Show file tree
Hide file tree
Showing 39 changed files with 121 additions and 102 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/composer-root-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
tools: composer
coverage: none

Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.2' ]
php: [ '8.2' ]

steps:
- name: Checkout
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
tools: composer
coverage: none

Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
steps:
- name: Checkout
Expand Down Expand Up @@ -88,14 +87,13 @@ jobs:
- 'e2e_036'
- 'e2e_037'
php:
- '8.1'
- '8.2'
composer:
- 'composer:2.2'
- 'composer'
include:
- e2e: 'e2e_039'
php: '8.1'
php: '8.2'
composer: 'composer:2.2'

steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
tools: composer
coverage: none

Expand All @@ -48,7 +48,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
tools: composer
coverage: none

Expand All @@ -72,7 +72,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
tools: composer
coverage: none

Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
ini-values: phar.readonly=0
tools: composer
coverage: none
Expand Down Expand Up @@ -105,6 +105,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'

- uses: actions/download-artifact@v3
with:
name: php-scoper-phar
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ jobs:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
steps:
- name: Checkout
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
!/bin/infection.sh
!/bin/php-scoper
/.box_dump/
/.php-cs-fixer.cache
/.phpcs-cache
/.phpunit*
/bin/*
!/bin/infection.sh
!/bin/php-scoper
/box.json
/clover.xml
/fixtures/*/.box_dump/
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.1-cli-alpine
FROM php:8.2-cli-alpine

COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
RUN install-php-extensions zlib phar sodium tokenizer filter
Expand Down
2 changes: 1 addition & 1 deletion composer-root-version-checker/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Small utility to manipulate the Composer root version.",
"license": "proprietary",
"require": {
"php": "^8.1",
"php": "^8.2",
"psr/log": "^3.0",
"thecodingmachine/safe": "^2.4"
},
Expand Down
6 changes: 3 additions & 3 deletions composer-root-version-checker/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
],
"require": {
"php": "^8.1",
"php": "^8.2",
"fidry/console": "^0.5.0",
"fidry/filesystem": "^1.1",
"jetbrains/phpstorm-stubs": "^v2022.2",
Expand Down Expand Up @@ -67,7 +67,7 @@
},
"bin-dir": "bin",
"platform": {
"php": "8.1.0"
"php": "8.2.0"
},
"sort-packages": true
},
Expand Down
6 changes: 3 additions & 3 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 19 additions & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,27 @@

$rectorConfig->sets([
LevelSetList::UP_TO_PHP_81,
LevelSetList::UP_TO_PHP_82,
]);

$rectorConfig->skip([
'NullToStrictStringFuncCallArgRector'
__DIR__.'/src/PhpParser/TraverserFactory.php',
__DIR__.'/tests/PhpParser/UseStmtNameTest.php',
__DIR__.'/src/PhpParser/NodeVisitor/AttributeAppender/ParentNodeAppender.php',

\Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector::class,
\Rector\Php73\Rector\String_\SensitiveHereNowDocRector::class,
\Rector\Php81\Rector\ClassMethod\NewInInitializerRector::class => [
__DIR__.'/src/Configuration/Configuration.php',
],
\Rector\Php81\Rector\Property\ReadOnlyPropertyRector::class => [
__DIR__.'/src/Configuration/Configuration.php',
],
\Rector\Php55\Rector\String_\StringClassNameToClassConstantRector::class => [
__DIR__.'/tests/Symbol/NamespaceRegistryTest.php',
__DIR__.'/tests/Symbol/Reflector/UserSymbolsReflectorTest.php',
__DIR__.'/tests/Symbol/SymbolRegistryTest.php',
__DIR__.'/tests/Symbol/SymbolsRegistryTest.php',
],
]);
};
2 changes: 1 addition & 1 deletion src/Autoload/ComposerFileHasher.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use function preg_match;
use function sprintf;

final class ComposerFileHasher
final readonly class ComposerFileHasher
{
private const ROOT_PACKAGE_NAME = '__root__';
private const PACKAGE_PATH_REGEX = '~^%s/(?<vendor>[^/]+?/[^/]+?)/(?<path>.+?)$~';
Expand Down
6 changes: 3 additions & 3 deletions src/Configuration/ConfigurationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@
use function trim;
use const DIRECTORY_SEPARATOR;

final class ConfigurationFactory
final readonly class ConfigurationFactory
{
public const DEFAULT_FILE_NAME = 'scoper.inc.php';

public function __construct(
private readonly Filesystem $fileSystem,
private readonly SymbolsConfigurationFactory $symbolsConfigurationFactory,
private Filesystem $fileSystem,
private SymbolsConfigurationFactory $symbolsConfigurationFactory,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Configuration/SymbolsConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Humbug\PhpScoper\Symbol\NamespaceRegistry;
use Humbug\PhpScoper\Symbol\SymbolRegistry;

final class SymbolsConfiguration
final readonly class SymbolsConfiguration
{
use NotInstantiable;

Expand Down
4 changes: 2 additions & 2 deletions src/Configuration/SymbolsConfigurationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
use function strrpos;
use function substr;

final class SymbolsConfigurationFactory
final readonly class SymbolsConfigurationFactory
{
public function __construct(private readonly RegexChecker $regexChecker)
public function __construct(private RegexChecker $regexChecker)
{
}

Expand Down
12 changes: 6 additions & 6 deletions src/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @private
* @codeCoverageIgnore
*/
final class Application implements FidryApplication
final readonly class Application implements FidryApplication
{
private const LOGO = <<<'ASCII'
Expand Down Expand Up @@ -60,11 +60,11 @@ public static function create(): self
}

public function __construct(
private readonly Container $container,
private readonly string $version,
private readonly string $releaseDate,
private readonly bool $isAutoExitEnabled,
private readonly bool $areExceptionsCaught,
private Container $container,
private string $version,
private string $releaseDate,
private bool $isAutoExitEnabled,
private bool $areExceptionsCaught,
) {
}

Expand Down
9 changes: 4 additions & 5 deletions src/Console/Command/InitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
namespace Humbug\PhpScoper\Console\Command;

use Fidry\Console\Command\Command;
use Fidry\Console\Command\Configuration;
use Fidry\Console\Command\Configuration as CommandConfiguration;
use Fidry\Console\Input\IO;
use Symfony\Component\Console\Helper\FormatterHelper;
Expand All @@ -30,21 +29,21 @@
* @private
* @codeCoverageIgnore
*/
final class InitCommand implements Command
final readonly class InitCommand implements Command
{
private const CONFIG_FILE_OPT = 'config';
private const CONFIG_FILE_TEMPLATE = __DIR__.'/../../scoper.inc.php.tpl';
private const CONFIG_FILE_DEFAULT = 'scoper.inc.php';

public function __construct(
private readonly Filesystem $fileSystem,
private readonly FormatterHelper $formatterHelper,
private Filesystem $fileSystem,
private FormatterHelper $formatterHelper,
) {
}

public function getConfiguration(): CommandConfiguration
{
return new Configuration(
return new CommandConfiguration(
'init',
'Generates a configuration file.',
'',
Expand Down
8 changes: 4 additions & 4 deletions src/Console/Command/InspectSymbolCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@
/**
* @private
*/
final class InspectSymbolCommand implements Command
final readonly class InspectSymbolCommand implements Command
{
private const SYMBOL_ARG = 'symbol';
private const SYMBOL_TYPE_ARG = 'type';
private const CONFIG_FILE_OPT = 'config';
private const NO_CONFIG_OPT = 'no-config';

public function __construct(
private readonly Filesystem $fileSystem,
private readonly ConfigurationFactory $configFactory,
private readonly EnrichedReflectorFactory $enrichedReflectorFactory,
private Filesystem $fileSystem,
private ConfigurationFactory $configFactory,
private EnrichedReflectorFactory $enrichedReflectorFactory,
) {
}

Expand Down
8 changes: 4 additions & 4 deletions src/Console/ConfigLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
/**
* @private
*/
final class ConfigLoader
final readonly class ConfigLoader
{
public function __construct(
private readonly CommandRegistry $commandRegistry,
private readonly Filesystem $fileSystem,
private readonly ConfigurationFactory $configFactory,
private CommandRegistry $commandRegistry,
private Filesystem $fileSystem,
private ConfigurationFactory $configFactory,
) {
}

Expand Down
8 changes: 4 additions & 4 deletions src/Console/ConsoleScoper.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@
/**
* @private
*/
final class ConsoleScoper
final readonly class ConsoleScoper
{
private const VENDOR_DIR_PATTERN = '~((?:.*)\\'.DIRECTORY_SEPARATOR.'vendor)\\'.DIRECTORY_SEPARATOR.'.*~';

public function __construct(
private readonly Filesystem $fileSystem,
private readonly Application $application,
private readonly ScoperFactory $scoperFactory,
private Filesystem $fileSystem,
private Application $application,
private ScoperFactory $scoperFactory,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Patcher/PatcherChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use function array_reduce;

final class PatcherChain implements Patcher
final readonly class PatcherChain implements Patcher
{
/**
* @param array<(callable(string, string, string): string)|Patcher> $patchers
Expand Down
Loading

0 comments on commit 514ff09

Please sign in to comment.