Skip to content

Commit

Permalink
Use intersection type
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Sep 27, 2022
1 parent 22d7757 commit 376449e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 2 additions & 0 deletions build/rector-downgrade.php
Expand Up @@ -12,6 +12,7 @@
use Rector\DowngradePhp80\Rector\FunctionLike\DowngradeMixedTypeDeclarationRector;
use Rector\DowngradePhp80\Rector\FunctionLike\DowngradeUnionTypeDeclarationRector;
use Rector\DowngradePhp80\Rector\Property\DowngradeUnionTypeTypedPropertyRector;
use Rector\DowngradePhp81\Rector\FunctionLike\DowngradePureIntersectionTypeRector;
use Rector\DowngradePhp81\Rector\Property\DowngradeReadonlyPropertyRector;

return static function (RectorConfig $config): void {
Expand All @@ -30,6 +31,7 @@

if ($targetPhpVersionId < 80100) {
$config->rule(DowngradeReadonlyPropertyRector::class);
$config->rule(DowngradePureIntersectionTypeRector::class);
}

if ($targetPhpVersionId < 80000) {
Expand Down
11 changes: 3 additions & 8 deletions tests/PHPStan/Parser/CachedParserTest.php
Expand Up @@ -8,6 +8,7 @@
use PHPStan\File\FileHelper;
use PHPStan\File\FileReader;
use PHPStan\Testing\PHPStanTestCase;
use PHPUnit\Framework\MockObject\MockObject;

class CachedParserTest extends PHPStanTestCase
{
Expand Down Expand Up @@ -61,10 +62,7 @@ public function dataParseFileClearCache(): \Generator
];
}

/**
* @return Parser&\PHPUnit\Framework\MockObject\MockObject
*/
private function getParserMock(): Parser
private function getParserMock(): Parser&MockObject
{
$mock = $this->createMock(Parser::class);

Expand All @@ -74,10 +72,7 @@ private function getParserMock(): Parser
return $mock;
}

/**
* @return \PhpParser\Node&\PHPUnit\Framework\MockObject\MockObject
*/
private function getPhpParserNodeMock(): \PhpParser\Node
private function getPhpParserNodeMock(): \PhpParser\Node&MockObject
{
return $this->createMock(\PhpParser\Node::class);
}
Expand Down

0 comments on commit 376449e

Please sign in to comment.