StoryLink::__toString()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 3
c 2
b 0
f 0
dl 0
loc 7
rs 10
cc 2
nc 2
nop 0
1
<?php
2
3
4
namespace Riclep\Storyblok\Fields;
5
6
7
/**
8
 * @property-read string $anchor
9
 * @property-read string $cached_url
10
 */
11
class StoryLink extends Asset
12
{
13
	public function __toString(): string
14
	{
15
		if ($this->anchor) {
16
			return $this->cached_url . '#' . $this->anchor;
17
		}
18
19
		return $this->cached_url;
20
	}
21
}