Passed
Push — dev-master ( 6bccf2...881343 )
by Petr
02:20
created

YourMembershipException::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
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
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 1
	   return __CLASS__ . ": [{$this->apiMethod}]: {$this->message}\n";
22
   }
23
24
}
25