Skip to content

Commit

Permalink
Fix psalm after release of new major versions of ORM and DBAL
Browse files Browse the repository at this point in the history
  • Loading branch information
ostrolucky committed Feb 10, 2024
1 parent ea8789b commit 4927253
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 12 deletions.
3 changes: 0 additions & 3 deletions DependencyInjection/DoctrineExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -849,13 +849,10 @@ protected function loadOrmEntityManagerMappingInformation(array $entityManager,
$mappingService = $this->getObjectManagerElementName($entityManager['name'] . '_' . $driverType . '_metadata_driver');
$mappingDriverDef = $container->getDefinition($mappingService);
$args = $mappingDriverDef->getArguments();
/** @psalm-suppress TypeDoesNotContainType Psalm doesn't know that $this->drivers is set by $this->loadMappingInformation() call */
if ($driverType === 'annotation') {
$args[2] = $entityManager['report_fields_where_declared'];
/** @psalm-suppress TypeDoesNotContainType Psalm doesn't know that $this->drivers is set by $this->loadMappingInformation() call */
} elseif ($driverType === 'attribute') {
$args[1] = $entityManager['report_fields_where_declared'];
/** @psalm-suppress TypeDoesNotContainType Psalm doesn't know that $this->drivers is set by $this->loadMappingInformation() call */
} elseif ($driverType === 'xml') {
$args[1] ??= SimplifiedXmlDriver::DEFAULT_FILE_EXTENSION;
$args[2] = $entityManager['validate_xml_mapping'];
Expand Down
2 changes: 0 additions & 2 deletions Repository/RepositoryFactoryCompatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ trait RepositoryFactoryCompatibility
* @return EntityRepository<T>
*
* @template T of object
*
* @psalm-suppress MethodSignatureMismatch
*/
public function getRepository(EntityManagerInterface $entityManager, string $entityName): EntityRepository
{
Expand Down
6 changes: 0 additions & 6 deletions Repository/ServiceEntityRepositoryProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,18 @@ public function __construct(
$this->repository = $this->resolveRepository();
}

/** @psalm-suppress MethodSignatureMismatch This proxy is used only in combination with newer parent class */
public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder
{
return ($this->repository ??= $this->resolveRepository())
->createQueryBuilder($alias, $indexBy);
}

/** @psalm-suppress MethodSignatureMismatch This proxy is used only in combination with newer parent class */
public function createResultSetMappingBuilder(string $alias): ResultSetMappingBuilder
{
return ($this->repository ??= $this->resolveRepository())
->createResultSetMappingBuilder($alias);
}

/** @psalm-suppress MethodSignatureMismatch This proxy is used only in combination with newer parent class */
public function find(mixed $id, LockMode|int|null $lockMode = null, int|null $lockVersion = null): object|null
{
/** @psalm-suppress InvalidReturnStatement This proxy is used only in combination with newer parent class */
Expand All @@ -67,7 +64,6 @@ public function find(mixed $id, LockMode|int|null $lockMode = null, int|null $lo
* {@inheritDoc}
*
* @psalm-suppress InvalidReturnStatement This proxy is used only in combination with newer parent class
* @psalm-suppress MethodSignatureMismatch This proxy is used only in combination with newer parent class
* @psalm-suppress InvalidReturnType This proxy is used only in combination with newer parent class
*/
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
Expand All @@ -92,8 +88,6 @@ public function count(array $criteria = []): int

/**
* {@inheritDoc}
*
* @psalm-suppress MethodSignatureMismatch This proxy is used only in combination with newer parent class
*/
public function __call(string $method, array $arguments): mixed
{
Expand Down
1 change: 0 additions & 1 deletion Tests/Mapping/ContainerEntityListenerResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ public function testRegisterStringException(): void
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('An object was expected, but got "string".');
/** @psalm-suppress InvalidArgument */
$this->resolver->register('CompanyContractListener');
}
}
Expand Down

0 comments on commit 4927253

Please sign in to comment.