Skip to content

Commit

Permalink
[automated] Apply Coding Standard (#922)
Browse files Browse the repository at this point in the history
Co-authored-by: TomasVotruba <TomasVotruba@users.noreply.github.com>
  • Loading branch information
TomasVotruba and TomasVotruba committed Sep 26, 2021
1 parent ce0fdfd commit f213223
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
3 changes: 1 addition & 2 deletions rules/TypeDeclaration/TypeInferer/PropertyTypeInferer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
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;
Expand Down Expand Up @@ -89,7 +88,7 @@ private function getResolvedTypes(Property $property): array
continue;
}

if ($property->type == null && $type instanceof AliasedObjectType && $hasByVarName) {
if ($property->type === null && $type instanceof AliasedObjectType && $hasByVarName) {
return [];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,24 @@ public function provideData(): Iterator
{
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,
],
]];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ public function provideData(): Iterator
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,
],
]];
}

Expand Down

0 comments on commit f213223

Please sign in to comment.