BadMethodCallException   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 33
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A classArgumentIsMandatory() 0 6 1
A setParentNotSupported() 0 7 1
A queryCountNotSupported() 0 7 1
A comparisonNotSupported() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Psi\Component\ObjectAgent\Exception;
6
7
class BadMethodCallException extends \BadMethodCallException
8
{
9
    public static function classArgumentIsMandatory(string $implementation)
10
    {
11
        throw new self(sprintf(
12
            'The class argument is mandatory for the %s agent', $implementation
13
        ));
14
    }
15
16
    public static function setParentNotSupported(string $implementation)
17
    {
18
        throw new self(sprintf(
19
            'setParent is not supported by the %s agent',
20
            $implementation
21
        ));
22
    }
23
24
    public static function queryCountNotSupported(string $implementation)
25
    {
26
        throw new self(sprintf(
27
            'queryCount is not supported by the %s agent',
28
            $implementation
29
        ));
30
    }
31
32
    public static function comparisonNotSupported(string $comparison)
33
    {
34
        throw new self(sprintf(
35
            'Comparison "%s" is not supported.',
36
             $comparison
37
        ));
38
    }
39
}
40