EntryValidationException::getErrors()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Hechoenlaravel\JarvisFoundation\Exceptions;
4
5
use Exception;
6
use Illuminate\Validation\Validator;
7
8
class EntryValidationException extends Exception
9
{
10
    /**
11
     * @var Validator
12
     */
13
    public $validator;
14
15
    /**
16
     * @param Validator $validator
17
     */
18
    public function __construct(Validator $validator)
19
    {
20
        $this->validator = $validator;
21
    }
22
23
    /**
24
     * Get the errors for the exception
25
     * @return MessageBag Message bad instance
26
     */
27
    public function getErrors()
28
    {
29
        return $this->validator->errors();
30
    }
31
}
32