DummyFallbackMiddleware   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 8 2
1
<?php
2
3
/*
4
 * This file is part of the LineMob package.
5
 *
6
 * (c) Ishmael Doss <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace LineMob\Core\Middleware;
13
14
use League\Tactician\Middleware;
15
use LineMob\Core\Command\AbstractCommand;
16
use LineMob\Core\Command\FallbackCommand;
17
use LineMob\Core\Storage\CommandData;
18
use LineMob\Core\Template\TextTemplate;
19
20
/**
21
 * @author Ishmael Doss <[email protected]>
22
 */
23
class DummyFallbackMiddleware implements Middleware
24
{
25
    /**
26
     * @param AbstractCommand $command
27
     *
28
     * {@inheritdoc}
29
     */
30
    public function execute($command, callable $next)
31
    {
32
        if ($command instanceof FallbackCommand) {
33
            $command->message = new TextTemplate();
34
            $command->message->text = "Oops! I dont know wath you say.";
35
        }
36
37
        return $next($command);
38
    }
39
}
40