spl - It is okay to implement \Countable in a PHP class that is not meant to be iterable? -


i have multipleexception class collects exceptions (e.g. multiple errors in form fields) , implements countable, don't want iterable list, cause exception (you never throw list).

is okay in terms of software design? or misusing spl countable interface?

which right way?

thanks

it okay.

countable there of classes can customise value returned calling count() instance. completely separate class being iterable.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

broadcastreceiver - blocking specific numbers (call and sms) in android -

asp.net mvc - Cannot display error message on Editor or EditorFor -