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

CouldNotDetermineValue::create()   A

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 3
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
}