From fb4a601bcbba17c51eb3af88410357c1c1ab5f63 Mon Sep 17 00:00:00 2001 From: Shaked Date: Thu, 7 Nov 2013 00:45:10 +0100 Subject: [PATCH] added LogicException --- Strategy/ObjectCollection.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Strategy/ObjectCollection.php b/Strategy/ObjectCollection.php index 682a8d0..57836ad 100644 --- a/Strategy/ObjectCollection.php +++ b/Strategy/ObjectCollection.php @@ -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);