Completed
Branch dev (20d83f)
by Arina
01:20
created

MessageAttributeBuilder::build()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
namespace ArinaSystems\JsonResponse\Builders;
4
5
use Illuminate\Support\Facades\Lang;
6
7
class MessageAttributeBuilder extends Builder
8
{
9
    /**
10
     * Build a value of the attribute.
11
     *
12
     * @param  string   $message
13
     * @return string
14
     */
15
    public function build($message)
16
    {
17
        if ($this->options->get('message_translations') === true) {
18
            return (string) Lang::get($message);
19
        }
20
21
        return (string) $message;
22
    }
23
}
24