GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

AbstractUseCaseCollection   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
register() 0 1 ?
A run() 0 11 2
1
<?php
2
3
namespace APL;
4
5
use APL\Exception\MethodNotFoundException;
6
use APL\Command\CommandInterface;
7
8
/**
9
 *
10
 * @author David Badura <[email protected]>
11
 */
12
abstract class AbstractUseCaseCollection implements UseCaseCollectionInterface
13
{
14
15
    /**
16
     *
17
     * Example:
18
     *
19
     * return [
20
     *  'APL\Example\EditCommand' => 'edit',
21
     *  'APL\Example\AddCommand'  => 'add'
22
     * ];
23
     *
24
     *
25
     * @return array
26
     */
27
    abstract public function register();
28
29
    /**
30
     *
31
     * @param CommandInterface $command
32
     * @return APL\Response\ResponseInterface
33
     */
34
    public function run(CommandInterface $command)
35
    {
36
        $mapping = $this->register();
37
        $method  = $mapping[get_class($command)];
38
39
        if (!method_exists($this, $method)) {
40
            throw new MethodNotFoundException($command, $this, $method);
41
        }
42
43
        return $this->$method($command);
44
    }
45
}
46