Skip to content

Replace wrapTransversable generators to prevent memory leaks #1561

Replace wrapTransversable generators to prevent memory leaks

Replace wrapTransversable generators to prevent memory leaks #1561

Triggered via pull request December 18, 2024 23:49
Status Failure
Total duration 1m 6s
Artifacts 2

static-analysis.yml

on: pull_request
Matrix: Static Analysis with PHPStan
Matrix: Static Analysis with Psalm
Fit to window
Zoom out
Zoom in

Annotations

13 errors
Static Analysis with PHPStan (8.2): lib/Doctrine/ODM/MongoDB/Aggregation/Aggregation.php#L52
Method Doctrine\ODM\MongoDB\Aggregation\Aggregation::prepareIterator() should return Doctrine\ODM\MongoDB\Iterator\Iterator but returns Doctrine\ODM\MongoDB\Iterator\CachingIterator<mixed>|Doctrine\ODM\MongoDB\Iterator\UnrewindableIterator<mixed>.
Static Analysis with PHPStan (8.2): lib/Doctrine/ODM/MongoDB/Iterator/CachingIterator.php#L73
Method Doctrine\ODM\MongoDB\Iterator\CachingIterator::toArray() return type has no value type specified in iterable type array.
Static Analysis with PHPStan (8.2): lib/Doctrine/ODM/MongoDB/Iterator/UnrewindableIterator.php#L45
Method Doctrine\ODM\MongoDB\Iterator\UnrewindableIterator::toArray() return type has no value type specified in iterable type array.
Static Analysis with PHPStan (8.2): lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php#L595
Method Doctrine\ODM\MongoDB\Persisters\DocumentPersister::wrapCursor() should return Doctrine\ODM\MongoDB\Iterator\Iterator but returns Doctrine\ODM\MongoDB\Iterator\CachingIterator<T of object>.
Static Analysis with PHPStan (8.2): tests/Doctrine/ODM/MongoDB/Tests/Aggregation/BuilderTest.php#L431
Call to static method PHPUnit\Framework\Assert::assertInstanceOf() with 'Doctrine\\ODM\\MongoDB\\Iterator\\UnrewindableIterator' and Doctrine\ODM\MongoDB\Iterator\Iterator will always evaluate to false.
Static Analysis with PHPStan (8.2)
Process completed with exit code 1.
InvalidReturnType: lib/Doctrine/ODM/MongoDB/Aggregation/Aggregation.php#L46
lib/Doctrine/ODM/MongoDB/Aggregation/Aggregation.php:46:76: InvalidReturnType: The declared return type 'Doctrine\ODM\MongoDB\Iterator\Iterator' for Doctrine\ODM\MongoDB\Aggregation\Aggregation::prepareIterator is incorrect, got 'Doctrine\ODM\MongoDB\Iterator\CachingIterator<(TValue:Iterator as mixed)|object>|Doctrine\ODM\MongoDB\Iterator\UnrewindableIterator<(TValue:Iterator as mixed)|object>' (see https://psalm.dev/011)
InvalidReturnStatement: lib/Doctrine/ODM/MongoDB/Aggregation/Aggregation.php#L52
lib/Doctrine/ODM/MongoDB/Aggregation/Aggregation.php:52:16: InvalidReturnStatement: The inferred type 'Doctrine\ODM\MongoDB\Iterator\CachingIterator<(TValue:Iterator as mixed)|object>|Doctrine\ODM\MongoDB\Iterator\UnrewindableIterator<(TValue:Iterator as mixed)|object>' does not match the declared return type 'Doctrine\ODM\MongoDB\Iterator\Iterator' for Doctrine\ODM\MongoDB\Aggregation\Aggregation::prepareIterator (see https://psalm.dev/128)
InvalidReturnType: lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php#L593
lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php:593:75: InvalidReturnType: The declared return type 'Doctrine\ODM\MongoDB\Iterator\Iterator' for Doctrine\ODM\MongoDB\Persisters\DocumentPersister::wrapCursor is incorrect, got 'Doctrine\ODM\MongoDB\Iterator\CachingIterator<T:Doctrine\ODM\MongoDB\Persisters\DocumentPersister as object>' (see https://psalm.dev/011)
InvalidReturnStatement: lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php#L595
lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php:595:16: InvalidReturnStatement: The inferred type 'Doctrine\ODM\MongoDB\Iterator\CachingIterator<T:Doctrine\ODM\MongoDB\Persisters\DocumentPersister as object>' does not match the declared return type 'Doctrine\ODM\MongoDB\Iterator\Iterator' for Doctrine\ODM\MongoDB\Persisters\DocumentPersister::wrapCursor (see https://psalm.dev/128)
InvalidReturnType: lib/Doctrine/ODM/MongoDB/Query/Query.php#L391
lib/Doctrine/ODM/MongoDB/Query/Query.php:391:57: InvalidReturnType: The declared return type 'Doctrine\ODM\MongoDB\Iterator\Iterator' for Doctrine\ODM\MongoDB\Query\Query::makeIterator is incorrect, got 'Doctrine\ODM\MongoDB\Iterator\CachingIterator<mixed|object>|Doctrine\ODM\MongoDB\Iterator\PrimingIterator<mixed|object, object>|Doctrine\ODM\MongoDB\Iterator\UnrewindableIterator<mixed|object>' (see https://psalm.dev/011)
InvalidReturnStatement: lib/Doctrine/ODM/MongoDB/Query/Query.php#L404
lib/Doctrine/ODM/MongoDB/Query/Query.php:404:16: InvalidReturnStatement: The inferred type 'Doctrine\ODM\MongoDB\Iterator\CachingIterator<mixed|object>|Doctrine\ODM\MongoDB\Iterator\PrimingIterator<mixed|object, object>|Doctrine\ODM\MongoDB\Iterator\UnrewindableIterator<mixed|object>' does not match the declared return type 'Doctrine\ODM\MongoDB\Iterator\Iterator' for Doctrine\ODM\MongoDB\Query\Query::makeIterator (see https://psalm.dev/128)
Static Analysis with Psalm (8.2)
Process completed with exit code 2.

Artifacts

Produced during runtime
Name Size
composer-lock-static-analysis-phpstan
23.7 KB
composer-lock-static-analysis-psalm
23.7 KB