Completed
Push — master ( 707e60...bec0f5 )
by Jean-Christophe
01:22
created

Table::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace micro\orm\reverse;
4
5
use micro\orm\OrmUtils;
6
7
class Table {
8
	private $model;
9
10
	public function __construct($model){
11
		$this->model=$model;
12
	}
13
14
	public function generateSQL(){
15
		$metas=OrmUtils::getModelMetadata($this->model);
0 ignored issues
show
Unused Code introduced by
$metas is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
16
		$table=OrmUtils::getTableName($this->model);
0 ignored issues
show
Unused Code introduced by
$table is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
17
		$fieldnames=OrmUtils::getAnnotationInfo($this->model, "#fieldNames");
0 ignored issues
show
Unused Code introduced by
$fieldnames is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
18
		$primaryKeys=OrmUtils::getKeyFields($this->model);
0 ignored issues
show
Unused Code introduced by
$primaryKeys is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
19
		$serializables=OrmUtils::getSerializableFields($this->model);
20
		\var_dump($serializables);
0 ignored issues
show
Security Debugging Code introduced by
\var_dump($serializables); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
21
		\var_dump(OrmUtils::getFieldNames($this->model));
22
	}
23
}