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

RestControllerCreator::create()   A

Complexity

Conditions 5
Paths 9

Size

Total Lines 29
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 22
CRAP Score 5.002

Importance

Changes 0
Metric Value
eloc 23
dl 0
loc 29
ccs 22
cts 23
cp 0.9565
rs 9.2408
c 0
b 0
f 0
cc 5
nc 9
nop 2
crap 5.002
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