Model::__get()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
namespace GloBee\PaymentApi\Models;
4
5
use GloBee\PaymentApi\Exceptions\UnknownPropertyException;
6
7
abstract class Model
8
{
9
    /**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$name" missing
Loading history...
10
     * @param $name
0 ignored issues
show
Coding Style introduced by
Missing parameter name
Loading history...
11
     *
12
     * @return mixed
13
     * @throws UnknownPropertyException
0 ignored issues
show
Coding Style introduced by
Comment missing for @throws tag in function comment
Loading history...
14
     */
15 15
    public function __get($name)
0 ignored issues
show
Coding Style introduced by
Type hint "name" missing for
Loading history...
16
    {
17 15
        if (property_exists($this, $name)) {
18 14
            return $this->{$name};
19
        }
20
21 1
        throw new UnknownPropertyException($name);
22
    }
23
}
24