Check   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 11
c 1
b 0
f 1
dl 0
loc 37
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create_AccountInfo() 0 10 3
A __construct() 0 8 1
1
<?php
2
3
/**
4
 *      Class for response to Check request
5
 *
6
 *      @package php_EasyPay
7
 *      @version 1.1
8
 *      @author Dmitry Shovchko <[email protected]>
9
 *
10
 */
11
12
namespace EasyPay\Provider31\Response;
13
14
use \EasyPay\Provider31\Response as Response;
15
use \EasyPay\Provider31\AccountInfo as AccountInfo;
16
17
final class Check extends Response
18
{
19
    /**
20
     *      @var \DOMElement
21
     */
22
    protected $AccountInfo;
23
24
	/**
25
     *      Check constructor
26
     *
27
     *      @param AccountInfo $accountinfo account information set
28
     */
29
    public function __construct(AccountInfo $accountinfo)
30
    {
31
		parent::__construct();
32
33
		$this->setElementValue('StatusCode', 0);
34
		$this->setElementValue('StatusDetail', 'checked');
35
36
		$this->create_AccountInfo($accountinfo);
37
	}
38
39
	/**
40
     *      Create AccountInfo node with child nodes
41
     *
42
     *      @param AccountInfo $accountinfo account information set
43
     */
44
	public function create_AccountInfo($accountinfo)
45
	{
46
		if (isset($this->AccountInfo)) return;
47
48
		$this->AccountInfo = $this->createElement('AccountInfo');
49
		$this->Response->appendChild($this->AccountInfo);
50
51
		foreach($accountinfo as $parameter=>$value)
52
		{
53
			$this->AccountInfo->appendChild($this->createElement($parameter, $value));
54
		}
55
	}
56
}
57