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
Post a Comment