Completed
Push — master ( da62ab...2e0a22 )
by Thomas
09:51
created

ToOneRelationshipReadActionGenerator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A generate() 0 17 1
1
<?php
2
namespace keeko\tools\generator\action;
3
4
use gossi\codegen\model\PhpClass;
5
use keeko\tools\generator\AbstractActionGenerator;
6
use Propel\Generator\Model\ForeignKey;
7
use Propel\Generator\Model\Table;
8
9
class ToOneRelationshipReadActionGenerator extends AbstractActionGenerator {
10
11
	/**
12
	 * Add default blank methods
13
	 * 
14
	 * @param PhpClass $class
15
	 */
16
	public function generate(PhpClass $class, Table $model, Table $foreign, ForeignKey $fk) {
2 ignored issues
show
Unused Code introduced by
The parameter $foreign is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $fk is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
17
		// add use statements
18
		$this->ensureBasicSetup($class);
19
		
20
		// method: configureParams(OptionsResolver $resolver)
0 ignored issues
show
Unused Code Comprehensibility introduced by
45% 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, $this->twig->render('relationship-configureParams.twig'));
22
23
		// method: run(Request $request) : Response
0 ignored issues
show
Unused Code Comprehensibility introduced by
39% 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...
24
		$class->addUseStatement('Symfony\\Component\\HttpFoundation\\Request');
25
		$class->addUseStatement('Symfony\\Component\\HttpFoundation\\Response');
26
		$class->setMethod($this->generateRunMethod($this->twig->render('to-one-read-run.twig', [
27
			'model' => $model->getCamelCaseName(),
28
			'class' => $model->getPhpName()
29
		])));
30
31
		return $class;
32
	}
33
}