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

InvalidSubject::make()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
cc 2
nc 1
nop 1
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