TestMethodProcessor   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 6
c 1
b 0
f 0
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A processMethod() 0 10 3
1
<?php
2
3
namespace Exsio\PhpObjectDecorator\Tests\Fixtures;
4
5
use Exsio\PhpObjectDecorator\PhpObjectDecoratorMethodDefinition;
6
use Exsio\PhpObjectDecorator\PhpObjectDecoratorMethodProcessorInterface;
7
8
class TestMethodProcessor implements PhpObjectDecoratorMethodProcessorInterface
9
{
10
11
    function processMethod(PhpObjectDecoratorMethodDefinition $methodDefinition): string
12
    {
13
        if ($methodDefinition->getReflector()->isConstructor()) {
14
            return self::SKIP;
15
        }
16
        $parentCall = $methodDefinition->returnsValue() ? "return " . $methodDefinition->getParentCall() . ";" : $methodDefinition->getParentCall() . ";";
17
18
        return "
19
                    echo 'PROCESSED METHOD';
20
                    $parentCall
21
        ";
22
    }
23
}