Site::getUrl()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 1
b 0
f 1
1
<?php
2
3
namespace Leonidas\Library\System\Model\Site;
4
5
use Leonidas\Contracts\System\Model\Site\SiteInterface;
6
use Leonidas\Library\System\Model\Abstracts\GetAccessGrantedTrait;
7
use Leonidas\Library\System\Model\GetAccessProvider;
8
9
class Site implements SiteInterface
10
{
11
    use GetAccessGrantedTrait;
12
13
    protected string $title;
14
15
    protected string $description;
16
17
    protected string $icon;
18
19
    protected string $url;
20
21
    protected string $adminUrl;
22
23
    protected string $charset;
24
25
    protected string $locale;
26
27
    protected string $languageAttributes;
28
29
    protected string $rssUrl;
30
31
    protected string $rss2Url;
32
33
    protected string $atomUrl;
34
35
    protected string $rdfUrl;
36
37
    protected string $pingbackUrl;
38
39
    public function __construct()
40
    {
41
        $this->getAccessProvider = new GetAccessProvider($this);
42
    }
43
44
    public function getTitle(): string
45
    {
46
        return $this->title ??= get_bloginfo('name');
0 ignored issues
show
Bug introduced by
The function get_bloginfo was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

46
        return $this->title ??= /** @scrutinizer ignore-call */ get_bloginfo('name');
Loading history...
47
    }
48
49
    public function getDescription(): string
50
    {
51
        return $this->description ??= get_bloginfo('description');
0 ignored issues
show
Bug introduced by
The function get_bloginfo was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

51
        return $this->description ??= /** @scrutinizer ignore-call */ get_bloginfo('description');
Loading history...
52
    }
53
54
    public function getIcon(int $size = 512): string
55
    {
56
        return $this->icon ??= get_site_icon_url($size);
0 ignored issues
show
Bug introduced by
The function get_site_icon_url was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

56
        return $this->icon ??= /** @scrutinizer ignore-call */ get_site_icon_url($size);
Loading history...
57
    }
58
59
    public function getUrl(): string
60
    {
61
        return $this->url ??= get_home_url();
0 ignored issues
show
Bug introduced by
The function get_home_url was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

61
        return $this->url ??= /** @scrutinizer ignore-call */ get_home_url();
Loading history...
62
    }
63
64
    public function getAdminUrl(): string
65
    {
66
        return $this->adminUrl ??= get_admin_url();
0 ignored issues
show
Bug introduced by
The function get_admin_url was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

66
        return $this->adminUrl ??= /** @scrutinizer ignore-call */ get_admin_url();
Loading history...
67
    }
68
69
    public function getCharset(): string
70
    {
71
        return $this->charset ??= get_bloginfo('charset');
0 ignored issues
show
Bug introduced by
The function get_bloginfo was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

71
        return $this->charset ??= /** @scrutinizer ignore-call */ get_bloginfo('charset');
Loading history...
72
    }
73
74
    public function getLocale(): string
75
    {
76
        return $this->locale ??= get_locale();
0 ignored issues
show
Bug introduced by
The function get_locale was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

76
        return $this->locale ??= /** @scrutinizer ignore-call */ get_locale();
Loading history...
77
    }
78
79
    public function getLanguageAttributes(): string
80
    {
81
        return $this->languageAttributes ??= get_language_attributes();
0 ignored issues
show
Bug introduced by
The function get_language_attributes was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

81
        return $this->languageAttributes ??= /** @scrutinizer ignore-call */ get_language_attributes();
Loading history...
82
    }
83
84
    public function getRssUrl(): string
85
    {
86
        return $this->rssUrl ??= get_feed_link('rss');
0 ignored issues
show
Bug introduced by
The function get_feed_link was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

86
        return $this->rssUrl ??= /** @scrutinizer ignore-call */ get_feed_link('rss');
Loading history...
87
    }
88
89
    public function getRss2Url(): string
90
    {
91
        return $this->rss2Url ??= get_feed_link('rss2');
0 ignored issues
show
Bug introduced by
The function get_feed_link was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

91
        return $this->rss2Url ??= /** @scrutinizer ignore-call */ get_feed_link('rss2');
Loading history...
92
    }
93
94
    public function getAtomUrl(): string
95
    {
96
        return $this->atomUrl ??= get_feed_link('atom');
0 ignored issues
show
Bug introduced by
The function get_feed_link was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

96
        return $this->atomUrl ??= /** @scrutinizer ignore-call */ get_feed_link('atom');
Loading history...
97
    }
98
99
    public function getRdfUrl(): string
100
    {
101
        return $this->rdfUrl ??= get_feed_link('rdf');
0 ignored issues
show
Bug introduced by
The function get_feed_link was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

101
        return $this->rdfUrl ??= /** @scrutinizer ignore-call */ get_feed_link('rdf');
Loading history...
102
    }
103
104
    public function getPingbackUrl(): string
105
    {
106
        return $this->pingbackUrl ??= get_bloginfo('pingback_url');
0 ignored issues
show
Bug introduced by
The function get_bloginfo was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

106
        return $this->pingbackUrl ??= /** @scrutinizer ignore-call */ get_bloginfo('pingback_url');
Loading history...
107
    }
108
}
109