Completed
Push — master ( 6ecc4c...c85972 )
by Ivannis Suárez
11:44
created

FromCommandNamedResolver::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 5
rs 9.4285
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/**
4
 * This file is part of the Cubiche package.
5
 *
6
 * Copyright (c) Cubiche
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
namespace Cubiche\Core\Bus\Middlewares\Handler\Resolver\NameOfCommand;
12
13
use Cubiche\Core\Bus\Command\CommandNamedInterface;
14
use Cubiche\Core\Bus\MessageInterface;
15
use Cubiche\Core\Bus\Middlewares\Handler\Resolver\NameOfMessage\FromMessageNamedResolver;
16
17
/**
18
 * FromCommandNamedResolver class.
19
 *
20
 * @author Ivannis Suárez Jerez <[email protected]>
21
 */
22
class FromCommandNamedResolver extends FromMessageNamedResolver implements ResolverInterface
23
{
24
    /**
25
     * {@inheritdoc}
26
     */
27
    protected function getType()
28
    {
29
        return CommandNamedInterface::class;
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    protected function getName(MessageInterface $message)
36
    {
37
        /* @var CommandNamedInterface $message */
38
        return $message->commandName();
39
    }
40
}
41