Passed
Branch master (6e6484)
by Petr
06:04
created

YourMembershipException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 3
crap 1
1
<?php
2
3
4
namespace P2A\YourMembership\Core;
5
6
7
/**
8
 *
9
 */
10
class YourMembershipException extends \Exception
11
{
12
	private $apiMethod;
13
14 2
	public function __construct(string $message, int $code = 0, string $apiMethod)
15
	{
16 2
		$this->apiMethod = $apiMethod;
17 2
		parent::__construct($message, $code, null);
18 2
	}
19
20 1
	public function __toString()
21
	{
22 1
	   return __CLASS__ . ": [{$this->apiMethod}]: {$this->message}\n";
23
   }
24
25
}
26