Topic::generate()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
ccs 0
cts 5
cp 0
crap 6
1
<?php
2
3
/**
4
 * Semantic representation of topic URLs
5
 *
6
 * @package   ElkArte Forum
7
 * @copyright ElkArte Forum contributors
8
 * @license   BSD http://opensource.org/licenses/BSD-3-Clause (see accompanying LICENSE.txt file)
9
 *
10
 * @version 2.0 dev
11
 *
12
 */
13
14
namespace ElkArte\UrlGenerator\Queryless;
15
16
class Topic extends Standard
17
{
18
	/**
19
	 * {@inheritDoc}
20
	 */
21
	protected $_types = ['topic'];
22
23
	/**
24
	 * {@inheritDoc}
25
	 */
26
	public function generate($params)
27
	{
28
		$url = 'topic,' . $params['topic'] . (empty($params['start']) ? '.0' : '.' . $params['start']) . '.html';
29
		unset($params['subject'], $params['topic'], $params['start']);
30
31
		return $url . $this->_separator . $this->generateQuery($params);
32
	}
33
}
34