mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-02-24 09:42:24 +01:00
added LogicException
This commit is contained in:
parent
73d1659e60
commit
fb4a601bcb
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user