Passed
Branch scrutinizer (9ce12d)
by Daniel
11:09
created

RestException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 21
rs 10
c 3
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A errorMessage() 0 5 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace InShore\Bookwhen\Exceptions;
6
7
8
/**
9
 * InshoreBookwhenRestException Class
10
 * 
11
 * @package inshore\bookwhen
12
 */
13
class RestException extends InshoreBookwhenException
14
{
15
    private $e;
16
    
17
    private $logger;
18
    
19
    public function __construct($e, $logger) 
20
    {
21
        $this->e = $e;
22
        $this->logger = $logger;
23
    }
24
    
25
    /**
26
     *
27
     * @return string
28
     */
29
    public function errorMessage() 
30
    {
31
        $this->logger->error($this->e->getMessage());
32
        $this->logger->debug(var_export($this->e->getMessage(), true));
33
        return $this->e->getMessage();
34
    }
35
}
36
37
//EOF!
38