added LogicException

This commit is contained in:
Shaked 2013-11-07 00:45:10 +01:00
parent 73d1659e60
commit fb4a601bcb

View File

@ -30,6 +30,10 @@ class ObjectCollection
*/
public function sort()
{
if (!$this->comparator){
throw new \LogicException("Comparator is not set");
}
$callback = array($this->comparator, 'compare');
uasort($this->elements, $callback);