Response   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 34
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __get() 0 8 2
1
<?php namespace SOSTheBlack\Moip;
2
3
/**
4
 * Read-only response
5
 * @property boolean|string $response
6
 * @property string $error
7
 * @property string $xml
8
 * @property string $payment_url
9
 * @property string $token
10
 */
11
class Response {
12
13
	/**
14
	 * [$response description]
15
	 * @var [type]
16
	 */
17
	private $response;
18
19
	/**
20
	 * __construct
21
	 * 
22
	 * @param string[]
23
	 * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
24
	 */
25
	function __construct(array $response)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
26
	{
27
		$this->response = $response;
28
	}
29
30
	/**
31
	 * __get
32
	 * 
33
	 * @param string $name 
34
	 * @return null
35
	 */
36
	function __get($name)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
37
	{
38
		if (isset($this->response[$name]))
39
		{
40
			return $this->response[$name];
41
		}
42
		return null;
43
	}
44
}