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

YourMembershipApiException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 16
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __toString() 0 4 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
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