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

Foreigns::add()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 3
eloc 3
nc 2
nop 5
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