Completed
Pull Request — master (#443)
by Ilya
15:00
created

InvalidSubject   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

1 Method

Rating   Name   Duplication   Size   Complexity  
A make() 0 11 2
1
<?php
2
3
namespace Spatie\QueryBuilder\Exceptions;
4
5
use InvalidArgumentException;
6
7
class InvalidSubject extends InvalidArgumentException
8
{
9
    public static function make($subject)
10
    {
11
        return new static(
12
            sprintf(
13
                'Subject %s is invalid.',
14
                is_object($subject)
15
                    ? sprintf('class `%s`', get_class($subject))
16
                    : sprintf('type `%s`', gettype($subject))
17
            )
18
        );
19
    }
20
}
21