We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ResultIterator::getIterator()
@method
Currently 5.2 Generate something like
/** * @method Entity[] getIterator() */ abstract class EntityResultIterator { }
This is not really true as the ResultIterator::getIterator() function returns a InnerResultIteratorInterface which is defined as:
InnerResultIteratorInterface
interface InnerResultIteratorInterface extends \Traversable, \Countable, \ArrayAccess
I guess the correct way is to type-hint the whole chain following this phpstan template: https://phpstan.org/r/f87e4ede-1067-4795-bb40-a8eac8b1f7b8
<?php declare(strict_types = 1); /** * @template T * * @extends Traversable<mixed, T> * @extends ArrayAccess<mixed, T> */ interface HelloWorld extends Countable, Traversable, ArrayAccess { } /** * @template T */ abstract class ATest { /** * @return HelloWorld<T> */ abstract function getIterator(): HelloWorld; } /** * @extends ATest<Entity> */ class Test extends ATest {} class Entity {}
/cc @dsavina
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently 5.2 Generate something like
This is not really true as the
ResultIterator::getIterator()
function returns aInnerResultIteratorInterface
which is defined as:I guess the correct way is to type-hint the whole chain following this phpstan template:
https://phpstan.org/r/f87e4ede-1067-4795-bb40-a8eac8b1f7b8
PHPStan Code Sample
/cc @dsavina
The text was updated successfully, but these errors were encountered: