Test Failed
Pull Request — master (#59)
by
unknown
14:18
created

YumlModelsCreator::fieldIsEmail()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 5
c 1
b 1
f 0
dl 0
loc 9
ccs 4
cts 4
cp 1
rs 10
cc 2
nc 2
nop 1
crap 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A YumlModelsCreator::getForeignKeys() 0 2 1
1
<?php
2
namespace Ubiquity\orm\creator\yuml;
3
4
use Ubiquity\orm\creator\ModelsCreator;
5
6
7
class YumlModelsCreator extends ModelsCreator{
8
	/**
9
	 * @var YumlParser
10
	 */
11
	private $yumlParser;
12
13 1
	protected function init($config){
14 1
		parent::init($config);
15 1
	}
16
17 1
	public function initYuml($yumlString) {
18 1
		$this->yumlParser=new YumlParser($yumlString);
19 1
	}
20
21
22 1
	protected function getTablesName(){
23 1
		return $this->yumlParser->getTableNames();
24
	}
25
26 1
	protected function getFieldsInfos($tableName) {
27 1
		$fieldsInfos=array();
28 1
		$fields = $this->yumlParser->getFields($tableName);
29 1
		foreach ($fields as $field) {
30 1
			$fieldsInfos[$field['name']] = ["Type"=>$field['type'],"Nullable"=>(isset($field["null"]) && $field["null"])];
31
		}
32 1
		return $fieldsInfos;
33
	}
34
35 1
	protected function getPrimaryKeys($tableName){
36 1
		return $this->yumlParser->getPrimaryKeys($tableName);
37
	}
38
39 1
	protected function getForeignKeys($tableName,$pkName){
40 1
		return $this->yumlParser->getForeignKeys($tableName);
41
	}
42
}
43