Test Setup Failed
Push — master ( 84252e...d1a772 )
by
unknown
02:53
created

ExternalSection::setExternalUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Charcoal\Cms\Section;
4
5
// From 'charcoal-cms'
6
use Charcoal\Cms\AbstractSection;
7
8
/**
9
 * External section may appear in menus and breadcrumbs, but only
10
 *
11
 * Unlike all other section types, they do not provide any metadata information.
12
 */
13
class ExternalSection extends AbstractSection
0 ignored issues
show
Bug introduced by
There is at least one abstract method in this class. Maybe declare it as abstract, or implement the remaining methods: hasProperty, p, properties, property
Loading history...
14
{
15
    /**
16
     * @var Translation|string|null
17
     */
18
    private $externalUrl;
19
20
    /**
21
     * @param  mixed $url The external URL (localized).
22
     * @return self
23
     */
24
    public function setExternalUrl($url)
25
    {
26
        $this->externalUrl = $this->translator()->translation($url);
27
28
        return $this;
29
    }
30
31
    /**
32
     * @return Translation|string|null
33
     */
34
    public function externalUrl()
35
    {
36
        return $this->externalUrl;
0 ignored issues
show
Bug Compatibility introduced by
The expression $this->externalUrl; of type Charcoal\Cms\Section\Translation|string|null adds the type Charcoal\Cms\Section\Translation to the return on line 36 which is incompatible with the return type declared by the interface Charcoal\Cms\SectionInterface::externalUrl of type string.
Loading history...
37
    }
38
}
39