Passed
Pull Request — master (#6)
by Arina
13:16
created

MessageAttributeBuilder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 7 2
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