Silex::extract()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
namespace Silex\Component\Tactician\CommandNameExtractor;
4
5
use League\Tactician\Handler\CommandNameExtractor\CommandNameExtractor;
6
7
/**
8
 * Class Silex
9
 * @package Silex\Component\Tactician\CommandNameExtractor
10
 */
11
class Silex implements CommandNameExtractor
12
{
13
    /**
14
     * @param object $command
15
     * @return string
16
     */
17
    public function extract($command)
18
    {
19
        if (! is_object($command)) {
20
            throw new \InvalidArgumentException('Command must be an object');
21
        }
22
23
        return get_class($command);
24
    }
25
}
26