CascadeSoftDeleteException::invalidRelationships()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Iatstuti\Database\Support;
4
5
use Exception;
6
use Illuminate\Support\Str;
7
8
class CascadeSoftDeleteException extends Exception
9
{
10
    public static function softDeleteNotImplemented($class)
11
    {
12
        return new static(sprintf('%s does not implement Illuminate\Database\Eloquent\SoftDeletes', $class));
13
    }
14
15
16
    public static function invalidRelationships($relationships)
17
    {
18
        return new static(sprintf(
19
            '%s [%s] must exist and return an object of type Illuminate\Database\Eloquent\Relations\Relation',
20
            Str::plural('Relationship', count($relationships)),
21
            join(', ', $relationships)
22
        ));
23
    }
24
}
25