Passed
Branch master (3ca537)
by Daniel
02:55
created

RestException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 2
b 0
f 0
nc 1
nop 2
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace InShore\Bookwhen\Exceptions;
6
7
/**
8
 * InshoreBookwhenRestException Class
9
 * 
10
 * @package inshore\bookwhen
11
 */
12
class RestException extends InshoreBookwhenException
13
{
14
    private $e;
15
    
16
    private $logger;
17
    
18
    public function __construct($e, $logger) 
19
    {
20
        $this->e = $e;
21
        $this->logger = $logger;
22
    }
23
    
24
    /**
25
     *
26
     * @return string
27
     */
28
    public function errorMessage() 
29
    {
30
        $this->logger->error($this->e->getMessage());
31
        $this->logger->debug(var_export($this->e->getMessage(), true));
32
        return $this->e->getMessage();
33
    }
34
}
35
36
//EOF!
37