Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add interface for paginated result, without ability to get next/prev page #180

Open
laland opened this issue Jun 10, 2015 · 5 comments
Open

Comments

@laland
Copy link

laland commented Jun 10, 2015

Hi. Interface segregation says: dont depend on something you dont need. Why not to add an interface that can only get current page itmes, nbPages, nbItems but without getPageX stuff. I dont need to get next page when i'm in the view context isn't it? But now i can. Isn't it an ISP violation?

@richsage
Copy link
Contributor

@pablodip thoughts?

@laland
Copy link
Author

laland commented Jul 3, 2015

why not to just add an interface, lets say "PaginatedResultInterface", that i can typehint my method's return type with it (in docblocks in php5 or eplicitly in upcoming php7). i think it'll solve the problem. or not? )

@laland
Copy link
Author

laland commented Jul 3, 2015

i can do it in a pr, should i?

@pablodip
Copy link
Contributor

pablodip commented Jul 3, 2015

Is the only problem pureness or is there anything you cannot do?

@laland
Copy link
Author

laland commented Jul 7, 2015

but why not to add it just for pureness, so people will be able to typehint their methods return types

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants