TypeHintReaderException::withoutTypeHint()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Thr;
4
5
/**
6
 * Class TypeHintReaderException
7
 * @package Thr
8
 */
9
final class TypeHintReaderException extends \Exception
10
{
11
    /**
12
     * @param $propertyName
13
     * @return TypeHintReaderException
14
     */
15 3
    public static function withoutTypeHint(string $propertyName): self
16
    {
17 3
        return new self(sprintf("The parameter %s haven't type hint", $propertyName));
18
    }
19
20
    /**
21
     * @param string $propertyName
22
     * @return TypeHintReaderException
23
     */
24 3
    public static function invalidPropertyName(string $propertyName): self
25
    {
26 3
        return new self(sprintf("The parameter %s not exists", $propertyName));
27
    }
28
29
    /**
30
     * @param string $class
31
     * @return TypeHintReaderException
32
     */
33 3
    public static function notExistsClass(string $class): self
34
    {
35 3
        return new self(sprintf("The class %s not exists", $class));
36
    }
37
}
38