HandleClassNameInflector   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 12
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A inflect() 0 6 1
1
<?php
2
3
namespace League\Tactician\Handler\MethodNameInflector;
4
5
/**
6
 * Assumes the method is handle + the last portion of the class name.
7
 *
8
 * Examples:
9
 *  - \MyGlobalCommand              => $handler->handleMyGlobalCommand()
10
 *  - \My\App\TaskCompletedCommand  => $handler->handleTaskCompletedCommand()
11
 */
12
class HandleClassNameInflector extends ClassNameInflector
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17 5
    public function inflect($command, $commandHandler)
18
    {
19 5
        $commandName = parent::inflect($command, $commandHandler);
20
21 5
        return 'handle' . ucfirst($commandName);
22
    }
23
}
24