Pagerfanta icon indicating copy to clipboard operation
Pagerfanta copied to clipboard

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

Open laland opened this issue 9 years ago • 5 comments

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?

laland avatar Jun 10 '15 16:06 laland

@pablodip thoughts?

richsage avatar Jun 30 '15 07:06 richsage

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 avatar Jul 03 '15 16:07 laland

i can do it in a pr, should i?

laland avatar Jul 03 '15 16:07 laland

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

pablodip avatar Jul 03 '15 16:07 pablodip

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

laland avatar Jul 07 '15 16:07 laland