CommandValidationException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getErrors() 0 4 1
1
<?php
2
3
namespace Hechoenlaravel\JarvisFoundation\Exceptions;
4
5
use Exception;
6
use Illuminate\Validation\Validator;
7
8
/**
9
 * Class CommandValidationException
10
 * @package Hechoenlaravel\JarvisFoundation\Exceptions
11
 */
12
class CommandValidationException extends Exception
13
{
14
    /**
15
     * @var Validator
16
     */
17
    public $validator;
18
19
    /**
20
     * @param Validator $validator
21
     */
22
    public function __construct(Validator $validator)
23
    {
24
        $this->validator = $validator;
25
    }
26
27
    /**
28
     * Get the errors for the exception
29
     * @return MessageBag Message bad instance
30
     */
31
    public function getErrors()
32
    {
33
        return $this->validator->errors();
34
    }
35
}
36