Completed
Push — master ( cc4b15...0903fb )
by ARCANEDEV
19:01 queued 04:02
created

MetaPresenter::getLabelStatus()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 9
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 1
crap 2
1
<?php namespace Arcanesoft\Seo\Models\Presenters;
2
3
use Arcanesoft\Seo\Helpers\SeoChecker;
4
use Illuminate\Support\Arr;
5
6
/**
7
 * Class     MetaPresenter
8
 *
9
 * @package  Arcanesoft\Seo\Models\Presenters
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
trait MetaPresenter
13
{
14
    /* -----------------------------------------------------------------
15
     |  Accessors
16
     | -----------------------------------------------------------------
17
     */
18
19
    /**
20
     * Get the `title_status` attribute.
21
     *
22
     * @return string
23
     */
24
    public function getTitleStatusAttribute()
25
    {
26
        return SeoChecker::label(
27
            SeoChecker::checkTitle($this->title)
0 ignored issues
show
Bug introduced by
The property title 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...
28
        );
29
    }
30
31
    /**
32
     * Get the `description_status` attribute.
33
     *
34
     * @return string
35
     */
36
    public function getDescriptionStatusAttribute()
37
    {
38
        return SeoChecker::label(
39
            SeoChecker::checkDescription($this->description)
0 ignored issues
show
Bug introduced by
The property description 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...
40
        );
41
    }
42
}
43