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

MessageTrait::getMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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