Passed
Push — master ( f85738...3d85c1 )
by Peter
04:52
created

MessageTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 4
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMessage() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Admin\Http\Controllers\Admin;
6
7
use AbterPhp\Framework\I18n\ITranslator; // @phan-suppress-current-line
8
9
trait MessageTrait
10
{
11
    /**
12
     * @param string $messageType
13
     *
14
     * @return string
15
     */
16
    protected function getMessage(string $messageType)
17
    {
18
        /** @var ITranslator $translator */
19
        $translator = $this->translator;
20
21
        $entityName = $translator->translate(static::ENTITY_TITLE_SINGULAR);
0 ignored issues
show
Bug introduced by
The constant AbterPhp\Admin\Http\Cont...::ENTITY_TITLE_SINGULAR was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
22
23
        return $translator->translate($messageType, $entityName);
24
    }
25
}
26