MetaPresenter::getTitleStatusAttribute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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