Completed
Push — master ( 2fb143...d99a08 )
by Thomas
09:36
created

AbstractModelActionGenerator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 28
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A generate() 0 10 1
A addMethods() 0 2 1
A ensureUseStatements() 0 4 1
1
<?php
2
namespace keeko\tools\generator\action;
3
4
use gossi\codegen\model\AbstractPhpStruct;
5
use gossi\codegen\model\PhpTrait;
6
use keeko\framework\schema\ActionSchema;
7
use gossi\codegen\model\PhpClass;
8
9
class AbstractModelActionGenerator extends AbstractActionGenerator {
10
	
11
	/**
12
	 * Generates an action trait with the given name as classname
13
	 * 
14
	 * @param string $name
0 ignored issues
show
Bug introduced by
There is no parameter named $name. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
15
	 * @param ActionSchema $action
16
	 * @return PhpTrait
17
	 */
18
	public function generate(ActionSchema $action) {
19
		$class = PhpClass::create($action->getClass())
20
			->setDescription('Action Class for ' . $action->getName())
21
			->setLongDescription('This code is automatically created. Modifications will probably be overwritten.');
22
	
23
		$this->ensureBasicSetup($class);
24
		$this->addMethods($class, $action);
25
26
		return $class;
27
	}
28
29
	protected function addMethods(PhpClass $struct, ActionSchema $action) {
30
	}
31
	
32
	protected function ensureUseStatements(AbstractPhpStruct $struct) {
33
		parent::ensureUseStatements($struct);
34
		
35
	}
36
}