[automated] Apply Coding Standard (#922)

Co-authored-by: TomasVotruba <TomasVotruba@users.noreply.github.com>
This commit is contained in:
Tomas Votruba 2021-09-26 02:17:11 +02:00 committed by GitHub
parent ce0fdfdee4
commit f2132237d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 6 deletions

View File

@ -11,7 +11,6 @@ use PHPStan\Type\MixedType;
use PHPStan\Type\NeverType;
use PHPStan\Type\Type;
use PHPStan\Type\VoidType;
use PHPStan\Type\UnionType;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
use Rector\NodeTypeResolver\PHPStan\Type\TypeFactory;
use Rector\PHPStanStaticTypeMapper\DoctrineTypeAnalyzer;
@ -89,7 +88,7 @@ final class PropertyTypeInferer
continue;
}
if ($property->type == null && $type instanceof AliasedObjectType && $hasByVarName) {
if ($property->type === null && $type instanceof AliasedObjectType && $hasByVarName) {
return [];
}

View File

@ -6,7 +6,6 @@ namespace Rector\PHPStanRules\Rules;
use Nette\Utils\Strings;
use PhpParser\Node;
use PhpParser\Node\Name\FullyQualified;
use PhpParser\Node\Stmt\Class_;
use PHPStan\Analyser\Scope;
use Symplify\PHPStanRules\Rules\AbstractSymplifyRule;

View File

@ -30,10 +30,24 @@ final class PhpUpgradeDowngradeRegisteredInSetRuleTest extends AbstractServiceAw
{
yield [__DIR__ . '/Fixture/SkipSomePhpFeatureRector.php', []];
yield [__DIR__ . '/Fixture/SomePhpFeatureRector.php', [
[sprintf(PhpUpgradeDowngradeRegisteredInSetRule::ERROR_MESSAGE, 'Rector\Php80\Rector\Class_\SomePhpFeatureRector', 'php80'), 7]
[
sprintf(
PhpUpgradeDowngradeRegisteredInSetRule::ERROR_MESSAGE,
'Rector\Php80\Rector\Class_\SomePhpFeatureRector',
'php80'
),
7,
],
]];
yield [__DIR__ . '/Fixture/SomePhpFeature2Rector.php', [
[sprintf(PhpUpgradeDowngradeRegisteredInSetRule::ERROR_MESSAGE, 'Rector\DowngradePhp80\Rector\Class_\SomePhpFeature2Rector', 'downgrade-php80'), 7]
[
sprintf(
PhpUpgradeDowngradeRegisteredInSetRule::ERROR_MESSAGE,
'Rector\DowngradePhp80\Rector\Class_\SomePhpFeature2Rector',
'downgrade-php80'
),
7,
],
]];
}

View File

@ -31,7 +31,13 @@ final class PhpUpgradeImplementsMinPhpVersionInterfaceRuleTest extends AbstractS
yield [__DIR__ . '/Fixture/SkipDowngradeRector.php', []];
yield [__DIR__ . '/Fixture/SkipAlreadyImplementsMinPhpVersionRector.php', []];
yield [__DIR__ . '/Fixture/SomePhpFeatureRector.php', [
[sprintf(PhpUpgradeImplementsMinPhpVersionInterfaceRule::ERROR_MESSAGE, 'Rector\Php80\Rector\Class_\SomePhpFeatureRector'), 7]
[
sprintf(
PhpUpgradeImplementsMinPhpVersionInterfaceRule::ERROR_MESSAGE,
'Rector\Php80\Rector\Class_\SomePhpFeatureRector'
),
7,
],
]];
}