Passed
Push — master ( a6b5c0...1b00af )
by Jean-Christophe
05:56
created

RestControllerCreator::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 4
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
crap 1
1
<?php
2
3
namespace Ubiquity\scaffolding\creators;
4
5
/**
6
 * Creates a Rest controller associated with a resource
7
 * Ubiquity\scaffolding\creators$RestControllerCreator
8
 * This class is part of Ubiquity
9
 *
10
 * @author jcheron <[email protected]>
11
 * @version 1.0.2
12
 *
13
 */
14
class RestControllerCreator extends RestApiControllerCreator {
15
	private $resource;
16
17 1
	public function __construct($restControllerName, $resource, $routePath = '') {
18 1
		parent::__construct ( $restControllerName, $routePath );
19 1
		$this->resource = $resource;
20 1
		$this->templateName = 'restController.tpl';
21 1
	}
22
23 1
	protected function addVariablesForReplacement(&$variables) {
24 1
		$variables ["%resource%"] = $this->resource;
25 1
	}
26
27
	protected function addViews(&$uses, &$messages, &$classContent) {
28
	}
29
}
30
31