Passed
Push — master ( 1b6587...c68e47 )
by Vítězslav
02:09
created

Firma   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 20
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFirmaObject() 0 7 2
1
<?php
2
/**
3
 * FlexiPeeHP - Document Default Address support
4
 *
5
 * @author     Vítězslav Dvořák <[email protected]>
6
 * @copyright  (C) 2018 Spoje.Net
7
 */
8
9
namespace FlexiPeeHP;
10
11
/**
12
 * Add for Objects use with "firma" data column
13
 * @author Vítězslav Dvořák <[email protected]>
14
 */
15
trait Firma
16
{
17
    /**
18
     * Here Customer's or Provider's comany object live
19
     * @var \FlexiPeeHP\Adresar
20
     */
21
    public $firma = null;
22
23
    /**
24
     * Instance of Adresar( $this->getDataValue('firma') ) 
25
     * 
26
     * @return Adresar
27
     */
28
    public function getFirmaObject()
29
    {
30
        if (is_null($this->firma)) {
31
            $this->firma = new Adresar($this->getDataValue('firma'),
0 ignored issues
show
Bug introduced by
It seems like getDataValue() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

31
            $this->firma = new Adresar($this->/** @scrutinizer ignore-call */ getDataValue('firma'),
Loading history...
32
                ['details' => 'id']);
33
        }
34
        return $this->firma;
35
    }
36
}
37