Test Failed
Pull Request — master (#6)
by Arina
06:20
created

MessageAttributeBuilder::build()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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