ValueStubAction::run()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 7
c 1
b 0
f 0
nc 3
nop 0
dl 0
loc 12
rs 10
1
<?php
2
3
namespace kosuha606\HtmlUniParser\action;
4
5
class ValueStubAction extends AbstractLogicAction
6
{
7
    public function run()
8
    {
9
        $object = $this->args[0];
10
        $method = $this->args[1];
11
        if (!\is_object($object)) {
12
            return null;
13
        }
14
        if (\property_exists($object, $method)) {
15
            return $object->{$method};
16
        }
17
18
        return null;
19
    }
20
}