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

RelatedParty::getRelatedPartyType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
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