Issues (1574)

src/Model/LazyLoadingPropertyTrait.php (3 issues)

1
<?php
2
0 ignored issues
show
Missing file doc comment
Loading history...
3
namespace DMT\Insolvency\Model;
4
5
trait LazyLoadingPropertyTrait
0 ignored issues
show
Missing doc comment for trait LazyLoadingPropertyTrait
Loading history...
6
{
7 7
    public function __get($key)
0 ignored issues
show
Missing doc comment for function __get()
Loading history...
8
    {
9 7
        if (!property_exists($this, $key)) {
10
            throw new \InvalidArgumentException(sprintf('%s does not exists on %s', $key, get_class($this)));
11
        }
12
13 7
        if ($this->$key instanceof \Closure) {
14 7
            $this->$key = call_user_func($this->$key);
15
        }
16
17 7
        return $this->$key;
18
    }
19
}