Completed
Branchmaster (d2c4e1)
created

Helper::getCanonical()   A

↳ Parent: Helper

Complexity

Conditions 1
Paths 1

Duplication

Lines 0
Ratio 0 %

Size

Total Lines 5
Code Lines 3

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 0
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 2
1
<?php
2
namespace Redaxscript\Template;
3
4
use Redaxscript\Asset;
5
use Redaxscript\Registry;
6
use Redaxscript\Language;
7
8
/**
9
 * helper class to provide template helpers
10
 *
11
 * @since 3.0.0
12
 *
13
 * @package Redaxscript
14
 * @category Helper
15
 * @author Henry Ruhs
16
 */
17
18
class Helper
19
{
20
	/**
21
	 * get the title
22
	 *
23
	 * @since 3.0.0
24
	 *
25
	 * @return string
26
	 */
27
28
	public static function getTitle()
29
	{
30
		$title = new Helper\Title(Registry::getInstance());
31
		return $title->process();
32
	}
33
34
	/**
35
	 * get the canonical
36
	 *
37
	 * @since 3.0.0
38
	 *
39
	 * @return string
40
	 */
41
42
	public static function getCanonical()
43
	{
44
		$canonical = new Helper\Canonical(Registry::getInstance());
45
		return $canonical->process();
46
	}
47
48
	/**
49
	 * get the description
50
	 *
51
	 * @since 3.0.0
52
	 *
53
	 * @return string
54
	 */
55
56
	public static function getDescription()
57
	{
58
		$description = new Helper\Description(Registry::getInstance());
59
		return $description->process();
60
	}
61
62
	/**
63
	 * get the keywords
64
	 *
65
	 * @since 3.0.0
66
	 *
67
	 * @return string
68
	 */
69
70
	public static function getKeywords()
71
	{
72
		$keywords = new Helper\Keywords(Registry::getInstance());
73
		return $keywords->process();
74
	}
75
76
	/**
77
	 * get the robots
78
	 *
79
	 * @since 3.0.0
80
	 *
81
	 * @return string
82
	 */
83
84
	public static function getRobots()
85
	{
86
		$robots = new Helper\Robots(Registry::getInstance());
87
		return $robots->process();
88
	}
89
90
	/**
91
	 * get the transport
92
	 *
93
	 * @since 3.0.0
94
	 *
95
	 * @return array
96
	 */
97
98
	public static function getTransport()
99
	{
100
		$transport = new Asset\Transport(Registry::getInstance(), Language::getInstance());
101
		return $transport->getArray();
102
	}
103
104
	/**
105
	 * get the subset
106
	 *
107
	 * @since 3.0.0
108
	 *
109
	 * @return string
110
	 */
111
112
	public static function getSubset()
113
	{
114
		$subset = new Helper\Subset(Registry::getInstance());
115
		return $subset->process();
116
	}
117
118
	/**
119
	 * get the direction
120
	 *
121
	 * @since 3.0.0
122
	 *
123
	 * @return string
124
	 */
125
126 2
	public static function getDirection()
127
	{
128 2
		$direction = new Helper\Direction(Registry::getInstance());
129 2
		return $direction->process();
130 2
	}
131 2
132 2
	/**
133 2
	 * get the class
134 2
	 *
135
	 * @since 3.0.0
136
	 *
137
	 * @param string $prefix
138 2
	 *
139 2
	 * @return string
140 2
	 */
141 2
142 2
	public static function getClass($prefix = null)
143 2
	{
144
		$client = new Helper\Client(Registry::getInstance());
145
		$clientArray = $client->process();
146
147
		/* process client */
148
149
		foreach ($clientArray as $key => $value)
150 2
		{
151
			$clientArray[$key] = $prefix . $value;
152
		}
153
		return implode(' ', $clientArray);
154
	}
155
}
156