Passed
Push — master ( a357e7...195a07 )
by Anton
04:22 queued 01:11
created

SEO   A

Complexity

Total Complexity 13

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 13
lcom 1
cbo 0
dl 0
loc 65
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 4 1
A title() 0 6 2
A description() 0 6 2
A keywords() 0 6 2
A robotsIndex() 0 6 2
A robotsFollow() 0 6 2
A canonical() 0 6 2
1
<?php
2
3
namespace Utils {
4
5
	abstract class SEO {
6
7
		private static $data = [];
8
9
		# Init SEO data
10
11
		public static function init() {
12
13
			self::$data = [];
14
		}
15
16
		# Get/set title
17
18
		public static function title(string $value = null) {
19
20
			if (null === $value) return (self::$data['title'] ?? '');
21
22
			self::$data['title'] = $value;
23
		}
24
25
		# Get/set description
26
27
		public static function description(string $value = null) {
28
29
			if (null === $value) return (self::$data['description'] ?? '');
30
31
			self::$data['description'] = $value;
32
		}
33
34
		# Get/set keywords
35
36
		public static function keywords(string $value = null) {
37
38
			if (null === $value) return (self::$data['keywords'] ?? '');
39
40
			self::$data['keywords'] = $value;
41
		}
42
43
		# Get/set robots index
44
45
		public static function robotsIndex(bool $value = null) {
46
47
			if (null === $value) return (self::$data['robots_index'] ?? false);
48
49
			self::$data['robots_index'] = $value;
50
		}
51
52
		# Get/set robots follow
53
54
		public static function robotsFollow(bool $value = null) {
55
56
			if (null === $value) return (self::$data['robots_follow'] ?? false);
57
58
			self::$data['robots_follow'] = $value;
59
		}
60
61
		# Get/set canonical
62
63
		public static function canonical(string $value = null) {
64
65
			if (null === $value) return (self::$data['canonical'] ?? '');
66
67
			self::$data['canonical'] = $value;
68
		}
69
	}
70
}
71