ValidationException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 60%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 6
c 2
b 0
f 0
dl 0
loc 24
ccs 3
cts 5
cp 0.6
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A errorMessage() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace InShore\Bookwhen\Exceptions;
6
7
use InShore\Bookwhen\Exceptions\InshoreBookwhenException;
8
9
/**
10
 * InshoreBookwhenConfigurationException Class
11
 *
12
 * @package inshore\Bookwhen
13
 */
14
class ValidationException extends InshoreBookwhenException
15
{
16
    private $key;
17
18
    private $value;
19
20
    /**
21
     *
22
     * @param string $key
23
     * @param array|boolean|object|int|string $value
24
     */
25 2
    public function __construct($key, $value)
26
    {
27 2
        $this->key = $key;
28 2
        $this->value = $value;
29
    }
30
31
    /**
32
     *
33
     * @return string
34
     */
35
    public function errorMessage()
36
    {
37
        return 'Validation Error!<br/>The value "' . $this->value . '" is invalid for ' . $this->key . '.<br/>Please refer to the package documentation <a href=https://github.com/inshore/bookwhen>https://github.com/inshore/bookwhen</a> or <a href=https://api.bookwhen.com/v2>https://api.bookwhen.com/v2</a>';
38
    }
39
}
40
41
//EOF!
42