Completed
Push — master ( 159932...f1c264 )
by Thomas
08:09
created

SkeletonActionGenerator::generate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 16
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 16
rs 9.4285
cc 2
eloc 7
nc 2
nop 1
1
<?php
2
namespace keeko\tools\generator\action;
3
4
use gossi\codegen\model\PhpClass;
5
use keeko\framework\schema\ActionSchema;
6
7
class SkeletonActionGenerator extends AbstractActionGenerator {
8
9
	/**
10
	 * Add default blank methods
11
	 * 
12
	 * @param PhpClass $class
0 ignored issues
show
Bug introduced by
There is no parameter named $class. 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...
13
	 */
14
	public function generate(ActionSchema $action) {
15
		$class = $this->generateClass($action);
16
		$class = $this->loadClass($class);
17
		
18
		$this->ensureBasicSetup($class);
19
		
20
		// method: configureParams(OptionsResolver $resolver)
1 ignored issue
show
Unused Code Comprehensibility introduced by
53% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
21
// 		$this->addConfigureParamsMethod($class, '');
22
23
		// method: run(Request $request) : Response
24
		if (!$class->hasMethod('run')) {
25
			$class->setMethod($this->generateRunMethod($this->twig->render('skeleton-run.twig')));
26
		}
27
28
		return $class;
29
	}
30
}