MessageGetter   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 20
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 3 1
A getName() 0 3 1
A getPriority() 0 3 1
A toType() 0 3 1
1
<?php
2
3
namespace Apie\CorePlugin\ObjectAccess\Getters;
4
5
use Apie\ObjectAccessNormalizer\Getters\GetterInterface;
6
use Symfony\Component\PropertyInfo\Type;
7
8
/**
9
 * Maps getMessage from exceptions.
10
 *
11
 * @internal
12
 */
13
class MessageGetter implements GetterInterface
14
{
15
    public function getName(): string
16
    {
17
        return 'message';
18
    }
19
20
    public function getValue($object)
21
    {
22
        return $object->getMessage();
23
    }
24
25
    public function toType(): ?Type
26
    {
27
        return new Type(Type::BUILTIN_TYPE_STRING);
28
    }
29
30
    public function getPriority(): int
31
    {
32
        return 0;
33
    }
34
}
35