CouldNotDetermineValue::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 3
dl 0
loc 4
rs 10
c 0
b 0
f 0
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): self
11
    {
12
        return new self("Could not determine a value of type `{$argumentType}` for argument with name `{$argumentName}`", null, $exception);
13
    }
14
15
    public static function noModelInstanceFound(Model $model): self
16
    {
17
        $className = get_class($model);
18
19
        return new self("Could not get a model for class `$className`");
20
    }
21
}
22