Completed
Push — master ( f7bdb9...8d2b6e )
by Andrii
10:42
created

ClientResource::decorator()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace hipanel\modules\finance\models;
4
5
use hipanel\modules\finance\models\decorators\client\ClientResourceDecoratorFactory;
6
use hipanel\modules\finance\models\decorators\DecoratedInterface;
7
use hipanel\modules\finance\models\decorators\ResourceDecoratorInterface;
8
9
class ClientResource extends Resource implements DecoratedInterface
10
{
11
    public function decorator(): ResourceDecoratorInterface
12
    {
13
        if (empty($this->decorator)) {
14
            $this->decorator = ClientResourceDecoratorFactory::createFromResource($this);
15
        }
16
17
        return $this->decorator;
18
    }
19
}
20