Passed
Push — develop ( 5ae9a6...b4818b )
by Septianata
05:51
created

Attribute   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 15
ccs 3
cts 4
cp 0.75
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getGoogleMapUrlAttribute() 0 7 2
1
<?php
2
3
namespace App\Models\Concerns\Branch;
4
5
/**
6
 * @property string $name
7
 * @property string $address
8
 * @property float $address_latitude
9
 * @property float $address_longitude
10
 * @property string $google_map_url
11
 *
12
 * @see \App\Models\Branch
13
 */
14
trait Attribute
15
{
16
    /**
17
     * Return "google_map_url" attribute value.
18
     *
19
     * @param  mixed  $value
20
     * @return string
21
     */
22 2
    public function getGoogleMapUrlAttribute($value): string
23
    {
24 2
        if (!is_null($value)) {
25 2
            return $value;
26
        }
27
28
        return google_map_url($this->address_latitude, $this->address_longitude);
29
    }
30
}
31