Completed
Push — master ( aabf4d...606f02 )
by Frederik
9s
created

RelatedParty   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 90%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 40
ccs 9
cts 10
cp 0.9
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getRelatedPartyType() 0 4 1
A getAccount() 0 7 2
1
<?php
2
3
namespace Genkgo\Camt\Camt053\DTO;
4
5
use BadMethodCallException;
6
7
/**
8
 * Class RelatedParty
9
 * @package Genkgo\Camt\Camt053
10
 */
11
class RelatedParty
12
{
13
    /**
14
     * @var RelatedPartyTypeInterface
15
     */
16
    private $relatedPartyDetails;
17
    /**
18
     * @var Account
19
     */
20
    private $account;
21
22
    /**
23
     * @param RelatedPartyTypeInterface $relatedPartyDetails
24
     * @param Account $account
25
     */
26 10
    public function __construct(RelatedPartyTypeInterface $relatedPartyDetails, Account $account = null)
27
    {
28 10
        $this->relatedPartyDetails = $relatedPartyDetails;
29 10
        $this->account = $account;
30 10
    }
31
32
    /**
33
     * @return RelatedPartyTypeInterface
34
     */
35 2
    public function getRelatedPartyType()
36
    {
37 2
        return $this->relatedPartyDetails;
38
    }
39
40
    /**
41
     * @return Account
42
     */
43 1
    public function getAccount()
44
    {
45 1
        if ($this->account === null) {
46
            throw new BadMethodCallException();
47
        }
48 1
        return $this->account;
49
    }
50
}
51