Completed
Push — master ( 02e9e6...9b3fc3 )
by ARCANEDEV
09:52
created

FooterPresenter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 2
cbo 1
dl 0
loc 29
rs 10
c 0
b 0
f 0
ccs 0
cts 11
cp 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getLocaleNameAttribute() 0 4 1
A getContentAttribute() 0 7 1
1
<?php namespace Arcanesoft\Seo\Models\Presenters;
2
3
use Arcanesoft\Seo\Entities\Locales;
4
5
/**
6
 * Class     FooterPresenter
7
 *
8
 * @package  Arcanesoft\Seo\Models\Presenters
9
 * @author   ARCANEDEV <[email protected]>
10
 *
11
 * @property  string  locale
12
 * @property  string  locale_name
13
 * @property  string  content
14
 *
15
 * @property  \Arcanesoft\Seo\Models\Page  page
16
 */
17
trait FooterPresenter
18
{
19
    /* -----------------------------------------------------------------
20
     |  Accessors
21
     | -----------------------------------------------------------------
22
     */
23
    /**
24
     * Get the `locale_name` attribute.
25
     *
26
     * @return string|null
27
     */
28
    public function getLocaleNameAttribute()
29
    {
30
        return Locales::get($this->locale);
31
    }
32
33
    /**
34
     * Get the `content` attribute.
35
     *
36
     * @return string
37
     */
38
    public function getContentAttribute()
39
    {
40
        return $this->page->renderContent([
41
            'footer_name'         => $this->name,
0 ignored issues
show
Bug introduced by
The property name does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
42
            'footer_localization' => $this->localization,
0 ignored issues
show
Bug introduced by
The property localization does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
43
        ]);
44
    }
45
}
46