ValidationException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

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 3
cts 3
cp 1
crap 1
rs 10
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