src/Cortex/Commands/Trigger.php
protected function determineWordCount($triggers)
    {
        $triggers = $triggers->each(function ($data, $trigger) use ($triggers) {
            $data['order'] = count(explode(' ', $trigger));

            $triggers->put($trigger, $data);
        });

        return $triggers;
    }
protected function determineWordCount($triggers)
    {
        $triggers = $triggers->each(function ($data, $trigger) use ($triggers) {
            $data['order'] = count(explode(' ', $trigger));

            $triggers->put($trigger, $data);
        });

        return $triggers;
    }
protected function determineWordCount ( $ triggers ) { $ triggers = $ triggers -> each ( function ( $ data , $ trigger ) use ( $ triggers ) { $ data [ 'order' ] = count ( explode ( ' ' , $ trigger ) ) ; $ triggers -> put ( $ trigger , $ data ) ; } ) ; return $ triggers ; }
Sort triggers based on word count from
largest to smallest.

@param Collection $triggers

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