StoryLink   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 2
b 0
f 0
dl 0
loc 9
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 7 2
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
}