Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to PHP 8.1 syntax via Rector #5546

Merged
merged 1 commit into from
Jul 28, 2022
Merged

Conversation

morozov
Copy link
Member

@morozov morozov commented Jul 28, 2022

Q A
Type improvement

The following configuration was used to make the changes:

<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Core\ValueObject\PhpVersion;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\Set\ValueObject\SetList;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector;

return static function (RectorConfig $rectorConfig): void {
    $rectorConfig->paths([__DIR__ . '/src', __DIR__ . '/tests']);
    $rectorConfig->sets([SetList::PHP_81]);
    $rectorConfig->skip([
        # this one adds a ton of (string) conversions that seem unnecessary
        NullToStrictStringFuncCallArgRector::class,
        # this one generates the never return types that are incompatible in the inheritance chain
        ReturnNeverTypeRector::class,
    ]);
    $rectorConfig->phpVersion(PhpVersion::PHP_81);
    $rectorConfig->phpstanConfig(__DIR__ . '/phpstan.neon.dist');
};

@morozov morozov added this to the 4.0.0 milestone Jul 28, 2022
@morozov morozov added the PHP label Jul 28, 2022
@morozov morozov marked this pull request as ready for review July 28, 2022 14:46
@morozov morozov merged commit 3764e9d into doctrine:4.0.x Jul 28, 2022
@morozov morozov deleted the php-8.1-rector branch July 28, 2022 15:02
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants