Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Fixed wrong phpdoc type hint. #7170

Merged
merged 1 commit into from
Feb 1, 2015

Conversation

hver
Copy link
Contributor

@hver hver commented Jan 30, 2015

$pages variable can only has the type stdClass, because it is created with the function _createPages() (line 890), and this function returns stdClass

@Ocramius
Copy link
Member

A little bit of me just died by reading this :-\ Sad stdClass is sad.

@Ocramius Ocramius self-assigned this Jan 30, 2015
@Ocramius Ocramius added this to the 2.3.5 milestone Jan 30, 2015
@hver
Copy link
Contributor Author

hver commented Jan 30, 2015

As git blame shows, this is a rather old class 📆
There are some more type hint errors in this class, but they are not so trivial:
on line 372: $cacheIterator = static::$cache->getIterator();
self::$cache is hinted as Zend\Cache\Storage\StorageInterface but StorageInterface doesn't has the method getIterator(), only Zend\Cache\Storage\IterableInterface has it. I searched through adapters and only some of them implements IterableInterface. So basically Paginator class is using $cache as an instance of concrete Adapter, not as a StorageInterface implementator.

@Ocramius
Copy link
Member

Ocramius commented Feb 1, 2015

@hver consider opening an issue about that. I'm merging this PR meanwhile.

Ocramius added a commit that referenced this pull request Feb 1, 2015
@Ocramius Ocramius merged commit eac55b9 into zendframework:master Feb 1, 2015
Ocramius added a commit that referenced this pull request Feb 1, 2015
@Ocramius
Copy link
Member

Ocramius commented Feb 1, 2015

@hver merged, thanks!

master: 6bf112d
develop: 71f7813

gianarb pushed a commit to zendframework/zend-paginator that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-paginator that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants