TestMethodProcessor::processMethod()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 10
rs 10
cc 3
nc 3
nop 1
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
}