BlogService   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 22
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A createBlog() 0 4 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