Completed
Push — master ( 58092b...0f4ccf )
by Ryan
05:18
created

CreateEntrySearchIndexes::handle()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php namespace Anomaly\Streams\Platform\Installer\Console\Command;
2
3
use Anomaly\Streams\Platform\Search\Command\CheckEntryIndex;
4
use Anomaly\Streams\Platform\Stream\Contract\StreamInterface;
5
use Anomaly\Streams\Platform\Stream\Contract\StreamRepositoryInterface;
6
use Illuminate\Foundation\Bus\DispatchesJobs;
7
8
/**
9
 * Class CreateEntrySearchIndexes
10
 *
11
 * @link   http://pyrocms.com/
12
 * @author PyroCMS, Inc. <[email protected]>
13
 * @author Ryan Thompson <[email protected]>
14
 */
15
class CreateEntrySearchIndexes
16
{
17
18
    use DispatchesJobs;
19
20
    /**
21
     * Handle the command.
22
     *
23
     * @param StreamRepositoryInterface $streams
24
     */
25
    public function handle(StreamRepositoryInterface $streams)
26
    {
27
        /* @var StreamInterface $stream */
28
        foreach ($streams->findAllBySearchable(true) as $stream) {
29
            $this->dispatch(new CheckEntryIndex($stream));
30
        }
31
    }
32
}
33