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

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

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

php - Using str_replace to translate a MySQL Table in html -