-
-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix AddMethodCallBasedStrictParamTypeRector for invalid generics type (…
- Loading branch information
1 parent
fe7ed4f
commit 774de56
Showing
2 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
...ClassMethod/AddMethodCallBasedStrictParamTypeRector/Fixture/skip_invalid_generics.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector\Fixture; | ||
|
||
use Doctrine\ORM\EntityManagerInterface; | ||
use PHPUnit\Framework\TestCase; | ||
use Symfony\Component\DependencyInjection\Container; | ||
|
||
final class SkipInvalidGenerics extends TestCase | ||
{ | ||
private EntityManagerInterface $entityManager; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->entityManager = $this->get('entity_manager'); | ||
$this->initDatabase($this->entityManager); | ||
} | ||
|
||
/** | ||
* @template TObject as object | ||
* | ||
* @param class-string<TObject> $type | ||
* @return TObject | ||
*/ | ||
public function get(string $type): object | ||
{ | ||
$container = $this->getContainer(); | ||
return $container->get($type); | ||
} | ||
|
||
private function initDatabase(EntityManagerInterface $entityManager) | ||
{ | ||
} | ||
|
||
private function getContainer(): Container | ||
{ | ||
return new Container(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters