src/Cortex/Commands/Trigger.php
protected function sortTriggers($triggers)
    {
        $triggers = $this->determineWordCount($triggers);
        $triggers = $this->determineTypeCount($triggers);

        $triggers = $triggers->sort(function ($current, $previous) {
            return ($current['order'] < $previous['order']) ? -1 : 1;
        })->reverse();

        return $triggers;
    }
protected function sortTriggers($triggers)
    {
        $triggers = $this->determineWordCount($triggers);
        $triggers = $this->determineTypeCount($triggers);

        $triggers = $triggers->sort(function ($current, $previous) {
            return ($current['order'] < $previous['order']) ? -1 : 1;
        })->reverse();

        return $triggers;
    }
protected function sortTriggers ( $ triggers ) { $ triggers = $ this -> determineWordCount ( $ triggers ) ; $ triggers = $ this -> determineTypeCount ( $ triggers ) ; $ triggers = $ triggers -> sort ( function ( $ current , $ previous ) { return ( $ current [ 'order' ] < $ previous [ 'order' ] ) ? - 1 : 1 ; } ) -> reverse ( ) ; return $ triggers ; }
Sort triggers based on type and word count from
largest to smallest.

@param Collection $triggers

@return Collection
Sort triggers based on type and word count from largest to smallest .