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

RestControllerCreator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 88.89%

Importance

Changes 0
Metric Value
wmc 3
eloc 6
dl 0
loc 14
ccs 8
cts 9
cp 0.8889
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A addViews() 0 1 1
A __construct() 0 4 1
A addVariablesForReplacement() 0 2 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