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.0 syntax via Rector #5541

Merged
merged 2 commits 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\Set\ValueObject\SetList;

return static function (RectorConfig $rectorConfig): void {
    $rectorConfig->paths([__DIR__ . '/src', __DIR__ . '/tests']);
    $rectorConfig->sets([SetList::PHP_80]);
    $rectorConfig->phpVersion(PhpVersion::PHP_80);
    $rectorConfig->phpstanConfig(__DIR__ . '/phpstan.neon.dist');
};

I reverted the addition of implements Stringable as I believe that relying on __toString() in the cases except for logging is an anti-pattern. I'd rather get rid of these methods in the codebase.

We can enforce the above rules on CI as the next step once they are supported by the coding standard.

@morozov morozov added the PHP label Jul 28, 2022
@morozov morozov added this to the 4.0.0 milestone Jul 28, 2022
@morozov morozov changed the title Use PHP 8.0 syntax via Rector Switch to PHP 8.0 syntax via Rector Jul 28, 2022
@morozov morozov marked this pull request as ready for review July 28, 2022 02:42
@morozov morozov requested review from derrabus and greg0ire July 28, 2022 03:58
src/Schema/AbstractSchemaManager.php Outdated Show resolved Hide resolved
src/Schema/ForeignKeyConstraint.php Outdated Show resolved Hide resolved
Copy link
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love how the code looks after this PR. 🥳

@morozov morozov merged commit a6926cd into doctrine:4.0.x Jul 28, 2022
@morozov morozov deleted the php-8.0-rector branch July 28, 2022 12:12
@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