Skip to content

Commit fb4a601

Browse files
committed
added LogicException
1 parent 73d1659 commit fb4a601

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Strategy/ObjectCollection.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ public function __construct(array $elements = array())
3030
*/
3131
public function sort()
3232
{
33+
if (!$this->comparator){
34+
throw new \LogicException("Comparator is not set");
35+
}
36+
3337
$callback = array($this->comparator, 'compare');
3438
uasort($this->elements, $callback);
3539

0 commit comments

Comments
 (0)