Test Setup Failed
Pull Request — master (#5)
by Petr
04:25 queued 02:14
created

YourMembershipApiException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 4
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
class YourMembershipApiException extends YourMembershipException
8
{
9
	private $apiMethod;
10
11
	public function __construct(string $message, int $code = 0, string $apiMethod, \Exception $e = null)
12
	{
13
		$this->apiMethod = $apiMethod;
14
		parent::__construct($message, $code, $e);
15
	}
16
17
	public function __toString()
18
	{
19
	   return __CLASS__ . ": [{$this->apiMethod}]: {$this->message}\n";
20
   }
21
22
}
23