FooterPresenter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
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 30
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 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
    /**
25
     * Get the `locale_name` attribute.
26
     *
27
     * @return string|null
28
     */
29
    public function getLocaleNameAttribute()
30
    {
31
        return Locales::get($this->locale);
32
    }
33
34
    /**
35
     * Get the `content` attribute.
36
     *
37
     * @return string
38
     */
39
    public function getContentAttribute()
40
    {
41
        return $this->page->renderContent([
42
            '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...
43
            '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...
44
        ]);
45
    }
46
}
47