TypeHintReaderException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 27
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A withoutTypeHint() 0 3 1
A notExistsClass() 0 3 1
A invalidPropertyName() 0 3 1
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