mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-24 16:51:19 +02:00
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user