Passed
Push — dev-master ( 4da17d...6bccf2 )
by Petr
02:26
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 1
	public function __construct(string $message, int $code = 0, string $apiMethod) 
15
	{
16 1
		$this->apiMethod = $apiMethod;
17 1
		parent::__construct($message, $code, null);
18 1
	}
19
20
	public function __toString() {
21
	   return __CLASS__ . ": [{$this->apiMethod}]: {$this->message}\n";
22
   }
23
24
}
25