Passed
Pull Request — master (#10)
by Anton
07:57 queued 04:02
created

Foreigns   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A add() 0 6 3
1
<?php
2
3
namespace Modules\Entitizer\Utils\Definition\Group {
4
5
	use Modules\Entitizer\Utils\Definition;
6
7
	class Foreigns extends Definition\Group {
8
9
		# Add foreign
10
11
		public function add(string $name, string $table, string $field, string $delete = null, string $update = null) {
12
13
			if ((false === $this->definition->param($name)) || isset($this->list[$name])) return;
14
15
			$this->list[$name] = new Definition\Item\Foreign($name, $table, $field, $delete, $update);
16
		}
17
	}
18
}
19