Completed
Pull Request — develop (#92)
by Jaap
02:48
created

Implements_   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 27
ccs 0
cts 11
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 15 3
1
<?php
2
/**
3
 * This file is part of phpDocumentor.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @copyright 2010-2015 Mike van Riel<[email protected]>
9
 * @license   http://www.opensource.org/licenses/mit-license.php MIT
10
 * @link      http://phpdoc.org
11
 */
12
13
namespace phpDocumentor\Reflection\Php\Factory\Middleware;
14
15
16
use phpDocumentor\Reflection\Fqsen;
17
use phpDocumentor\Reflection\Middleware\Middleware;
18
19
final class Implements_ implements Middleware
0 ignored issues
show
Coding Style introduced by
This class is not in CamelCase format.

Classes in PHP are usually named in CamelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. The whole name starts with a capital letter as well.

Thus the name database provider becomes DatabaseProvider.

Loading history...
20
{
21
22
    /**
23
     * Executes this middle ware class.
24
     *
25
     * @param $command
26
     * @param callable $next
27
     *
28
     * @return object
29
     */
30
    public function execute($command, callable $next)
31
    {
32
        $element = $next($command);
33
        $object = $command->getObject();
34
35
        if (isset($object->implements)) {
36
            foreach ($object->implements as $interfaceClassName) {
37
                $element->addInterface(
38
                    new Fqsen('\\' . $interfaceClassName->toString())
39
                );
40
            }
41
        }
42
43
        return $element;
44
    }
45
}
46