Handler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 8 2
1
<?php
2
3
namespace WZRD\Messaging;
4
5
use BadMethodCallException;
6
use WZRD\Contracts\Messaging\Handler as HandlerContract;
7
use WZRD\Contracts\Messaging\Message as MessageContract;
8
9
abstract class Handler implements HandlerContract
10
{
11
    /**
12
     * Handle the message.
13
     *
14
     * @param WZRD\Contracts\Messaging\Message $message
15
     *
16
     * @return mixed
17
     */
18
    final public function handle(MessageContract $message)
19
    {
20
        if (!method_exists($this, 'process')) {
21
            throw new BadMethodCallException('process() function not defined');
22
        }
23
24
        return $this->process($message);
0 ignored issues
show
Bug introduced by
The method process() does not seem to exist on object<WZRD\Messaging\Handler>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
25
    }
26
}
27