BadModifierException::mustBeStatic()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 2
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace TheCodingMachine\Funky;
5
6
use \ReflectionMethod;
7
8
class BadModifierException extends \Exception
9
{
10
11
    public static function mustBePublic(ReflectionMethod $reflectionMethod, string $annotation): self
12
    {
13
        return new self(sprintf(
14
            'Method %s::%s annotated with annotation %s must be public.',
15
            $reflectionMethod->getDeclaringClass()->getName(),
16
            $reflectionMethod->getName(),
17
            $annotation
18
        ));
19
    }
20
21
    public static function mustBeStatic(ReflectionMethod $reflectionMethod, string $annotation): self
22
    {
23
        return new self(sprintf(
24
            'Method %s::%s annotated with annotation %s must be static.',
25
            $reflectionMethod->getDeclaringClass()->getName(),
26
            $reflectionMethod->getName(),
27
            $annotation
28
        ));
29
    }
30
}
31