DusanKasan / Knapsack

Collection pipeline library for PHP
http://dusankasan.github.io/Knapsack/
MIT License
535 stars 56 forks source link

Implementing \Countable #40

Closed issei-m closed 7 years ago

issei-m commented 7 years ago

More useful.

DusanKasan commented 7 years ago

I was considering implementing this before, but decided against it as I did want people to use the Collection methods rather than built in stuff (this also goes for ArrayAccess).

If we decide to switch to Countable, we should probably just rename size since it doesn't make sense to have both.

Is there a use case you came across that required this functionality? :) In my experience it's always more comfortable either to use the Collection directly or shadow it as an iterable - in both cases the Countable wouldn't help.

issei-m commented 7 years ago

Indeed, as you pointed I've found no reason/benefit to implement \Countable either. Thank you for your opinion. I'm closing this in favor of you.