MessageGetter::getValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
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