Skip to content

Commit

Permalink
Fix static analysis errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus committed Nov 24, 2023
1 parent f427c3d commit 4342efe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 3 additions & 1 deletion lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
use Doctrine\ODM\MongoDB\Utility\CollectionHelper;
use Doctrine\Persistence\Mapping\MappingException;
use InvalidArgumentException;
use Iterator as SplIterator;
use MongoDB\BSON\ObjectId;
use MongoDB\Collection;
use MongoDB\Driver\Cursor;

Check failure on line 35 in lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php

View workflow job for this annotation

GitHub Actions / Coding Standards / Coding Standards (8.2)

Type MongoDB\Driver\Cursor is not used in this file.
use MongoDB\Driver\CursorInterface;
use MongoDB\Driver\Exception\Exception as DriverException;
use MongoDB\Driver\Exception\WriteException;
use MongoDB\Driver\WriteConcern;
Expand Down Expand Up @@ -581,7 +583,7 @@ private function getShardKeyQuery(object $document): array
/**
* Wraps the supplied base cursor in the corresponding ODM class.
*/
private function wrapCursor(Cursor $baseCursor): Iterator
private function wrapCursor(SplIterator&CursorInterface $baseCursor): Iterator
{
return new CachingIterator(new HydratingIterator($baseCursor, $this->dm->getUnitOfWork(), $this->class));
}
Expand Down
3 changes: 1 addition & 2 deletions lib/Doctrine/ODM/MongoDB/Types/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,7 @@ public static function getTypesMap(): array
return self::$typesMap;
}

/** @return string */
public function __toString()
public function __toString(): string
{
$e = explode('\\', static::class);
$className = end($e);
Expand Down
5 changes: 0 additions & 5 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,6 @@
<code>$datetime instanceof DateTime</code>
</RedundantCondition>
</file>
<file src="lib/Doctrine/ODM/MongoDB/Types/Type.php">
<MethodSignatureMustProvideReturnType>
<code>__toString</code>
</MethodSignatureMustProvideReturnType>
</file>
<file src="lib/Doctrine/ODM/MongoDB/UnitOfWork.php">
<InvalidArgument>
<code>$assoc</code>
Expand Down

0 comments on commit 4342efe

Please sign in to comment.