Completed
Push — master ( e4f2cb...b54fb2 )
by Freek
01:46
created

CouldNotDetermineValue   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 4 1
A noModelInstanceFound() 0 6 1
1
<?php
2
3
namespace Spatie\MailableTest\Exceptions;
4
5
use Exception;
6
use Illuminate\Database\Eloquent\Model;
7
8
class CouldNotDetermineValue extends Exception
9
{
10
    public static function create($argumentType, $argumentName, Exception $exception)
11
    {
12
        return new static("Could not determine a value of type `{$argumentType}` for argument with name `{$argumentName}`", null, $exception);
13
    }
14
15
    public static function noModelInstanceFound(Model $model)
16
    {
17
        $className = get_class($model);
18
19
        return new static("Could not get a model for class `$className`");
20
    }
21
}