| Total Complexity | 9 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Coverage | 38.89% |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | class Customer extends AbstractTarget implements CustomerInterface |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var integer |
||
| 24 | */ |
||
| 25 | protected $id; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var string |
||
| 29 | */ |
||
| 30 | protected $login; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @var CustomerInterface |
||
| 34 | */ |
||
| 35 | protected $seller; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @var Customer[] |
||
| 39 | */ |
||
| 40 | protected $sellers = []; |
||
| 41 | |||
| 42 | 22 | public function __construct($id, $login, CustomerInterface $seller = null) |
|
| 43 | { |
||
| 44 | 22 | $this->id = $id; |
|
| 45 | 22 | $this->login = $login; |
|
| 46 | 22 | $this->seller = $seller; |
|
| 47 | 22 | } |
|
| 48 | |||
| 49 | /** |
||
| 50 | * {@inheritdoc} |
||
| 51 | */ |
||
| 52 | 1 | public function getUniqueId() |
|
| 53 | { |
||
| 54 | 1 | return $this->getId() ?: $this->getLogin(); |
|
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * {@inheritdoc} |
||
| 59 | */ |
||
| 60 | public function getLogin() |
||
| 63 | } |
||
| 64 | |||
| 65 | public function getSeller() |
||
| 66 | { |
||
| 67 | return $this->seller; |
||
| 68 | } |
||
| 69 | |||
| 70 | public static function fromArray(array $info) |
||
| 79 | } |
||
| 80 | |||
| 81 | public function jsonSerialize() |
||
| 86 |