BlogService::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * This file is part of the Cubiche package.
4
 *
5
 * Copyright (c) Cubiche
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Cubiche\Core\Console\Tests\Fixtures\Command;
12
13
use Cubiche\Core\EventBus\Event\EventBus;
14
use Cubiche\Core\Console\Tests\Fixtures\Blog;
15
use Cubiche\Core\Console\Tests\Fixtures\Event\BlogWasCreated;
16
17
/**
18
 * BlogService class.
19
 *
20
 * @author Ivannis Suárez Jerez <[email protected]>
21
 */
22
class BlogService
23
{
24
    protected $eventBus;
25
26
    /**
27
     * BlogService constructor.
28
     *
29
     * @param EventBus $eventBus
30
     */
31
    public function __construct(EventBus $eventBus)
32
    {
33
        $this->eventBus = $eventBus;
34
    }
35
36
    /**
37
     * @param CreateBlogCommand $command
38
     */
39
    public function createBlog(CreateBlogCommand $command)
40
    {
41
        $this->eventBus->dispatch(new BlogWasCreated($command->name()));
42
    }
43
}
44