AbstractEntity::__get()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 6
ccs 0
cts 4
cp 0
rs 10
cc 2
nc 2
nop 1
crap 6
1
<?php declare(strict_types=1);
2
3
namespace OfxParser\Entities;
4
5
abstract class AbstractEntity
6
{
7
    /**
8
     * Allow functions to be called as properties
9
     * to unify the API
10
     *
11
     * @param string $name
12
     * @return mixed|bool
13
     */
14
    public function __get(string $name)
15
    {
16
        if (method_exists($this, lcfirst($name))) {
17
            return $this->{$name}();
18
        }
19
        return false;
20
    }
21
}
22