ValidatorRulesNotSuppliedException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 1
eloc 8
nc 1
nop 2
1
<?php
2
3
namespace R\Hive\Concrete\Exceptions;
4
5
use R\Hive\Contracts\Data\ValidatorInterface;
6
7
class ValidatorRulesNotSuppliedException extends DomainException
8
{
9
    public $rules;
10
    public $name;
11
12
    public function __construct(ValidatorInterface $validator, $rules)
13
    {
14
        $this->name = get_class($validator);
15
        $this->rules = $rules;
16
17
        $message = sprintf(
18
            'Validator [%s] has no supplied %s rules.',
19
            $this->name,
20
            $this->rules
21
        );
22
        parent::__construct($message);
23
    }
24
}
25