Skip to content

Commit

Permalink
Run psalm under php 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ostrolucky committed Nov 16, 2023
1 parent c9c29de commit 5b1cbb8
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 14 deletions.
1 change: 0 additions & 1 deletion DependencyInjection/DoctrineExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,6 @@ protected function ormLoad(array $config, ContainerBuilder $container)

if ($config['enable_lazy_ghost_objects'] ?? false) {
// available in Symfony 6.2 and higher
/** @psalm-suppress UndefinedClass */
if (! trait_exists(LazyGhostTrait::class)) {
throw new LogicException(
'Lazy ghost objects cannot be enabled because the "symfony/var-exporter" library'
Expand Down
1 change: 0 additions & 1 deletion Repository/ServiceEntityRepositoryProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ public function matching(Criteria $criteria): AbstractLazyCollection&Selectable

private function resolveRepository(): EntityRepository
{
/** @psalm-suppress UndefinedThisPropertyFetch We should adjust when https://github.com/vimeo/psalm/issues/8984 is fixed */
$manager = $this->registry->getManagerForClass($this->entityClass);

if ($manager === null) {
Expand Down
2 changes: 0 additions & 2 deletions Tests/CacheSchemaSubscriberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ public function getSchemaSubscribers(): Generator
{
/**
* available in Symfony 6.3
*
* @psalm-suppress UndefinedClass
*/
yield ['cache.adapter.doctrine_dbal', 'doctrine.orm.listeners.doctrine_dbal_cache_adapter_schema_listener', DoctrineDbalCacheAdapterSchemaListener::class];

Expand Down
6 changes: 2 additions & 4 deletions Tests/DependencyInjection/DoctrineExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1229,8 +1229,7 @@ public function testAsEntityListenerAttribute()

$reflector = new ReflectionClass(Php8EntityListener::class);
$definition = new ChildDefinition('');
/** @psalm-suppress UndefinedMethod */
$attribute = $reflector->getAttributes(AsEntityListener::class)[0]->newInstance();
$attribute = $reflector->getAttributes(AsEntityListener::class)[0]->newInstance();

$attributes[AsEntityListener::class]($definition, $attribute);

Expand Down Expand Up @@ -1267,8 +1266,7 @@ public function testAsDoctrineListenerAttribute()

$reflector = new ReflectionClass(Php8EventListener::class);
$definition = new ChildDefinition('');
/** @psalm-suppress UndefinedMethod */
$attribute = $reflector->getAttributes(AsDoctrineListener::class)[0]->newInstance();
$attribute = $reflector->getAttributes(AsDoctrineListener::class)[0]->newInstance();

$attributes[AsDoctrineListener::class]($definition, $attribute);

Expand Down
2 changes: 0 additions & 2 deletions Tests/RegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,7 @@ public function testResetLazyObject(): void
self::markTestSkipped('This test requires ORM and VarExporter 6.2+');
}

/** @psalm-suppress MissingDependency https://github.com/vimeo/psalm/issues/8258 */
$ghostManager = $this->createMock(LazyObjectEntityManagerInterface::class);
/** @psalm-suppress MissingDependency https://github.com/vimeo/psalm/issues/8258 */
$ghostManager->expects($this->once())->method('resetLazyObject')->willReturn(true);

$container = new Container();
Expand Down
5 changes: 1 addition & 4 deletions Tests/Repository/ServiceEntityRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ public function testConstructInitializesWhenImplementingLazyObjectInterface(): v
$registry = $this->getMockBuilder(ManagerRegistry::class)->getMock();
$this->expectException(LogicException::class);

/**
* @psalm-suppress MissingDependency
* @psalm-suppress UndefinedClass
*/
/** @psalm-suppress UndefinedClass */
new class ($registry, TestEntity::class) extends ServiceEntityRepository implements LazyObjectInterface {
use LazyGhostTrait;
};
Expand Down

0 comments on commit 5b1cbb8

Please sign in to comment.