Passed
Pull Request — master (#5)
by Petr
04:44 queued 02:20
created

YourMembershipRequestException::getApiMethodName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace P2A\YourMembership\Exceptions;
3
4
/**
5
 * This is an exception that is thrown when an error occurs with the API responses.
6
 */
7 View Code Duplication
class YourMembershipRequestException extends YourMembershipException
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
{
9
10
	/**
11
	 * Arguments used for the Request
12
	 * @var array
13
	 */
14
	private $arguments;
15
16
	/**
17
	 * Api Method That is related to this exception
18
	 * @var string
19
	 */
20
	private $apiMethod;
21
22 3
	public function __construct(string $message, int $code = 0, string $apiMethod, array $arguments, \Exception $e = null)
23
	{
24 3
		$this->apiMethod = $apiMethod;
25 3
		$this->arguments = $arguments;
26 3
		parent::__construct($message, $code, $e);
27 3
	}
28
29
	/**
30
	 * Returns the arguments for API Request
31
	 * @method getArguments
32
	 * @author PA
33
	 * @date   2017-01-12
34
	 * @return array
35
	 */
36
37 1
	public function getArguments() : array
38
	{
39 1
		return $this->arguments;
40
	}
41
42
	/**
43
	 * Returns the arguments for API Request
44
	 * @method getArguments
45
	 * @author PA
46
	 * @date   2017-01-12
47
	 * @return array
48
	 */
49
50 1
	public function getApiMethodName() : string
51
	{
52 1
		return $this->apiMethod;
53
	}
54
55
}
56