Completed
Push — trunk ( 1f2f20...9c1015 )
by SuperNova.WS
04:43
created

DbFieldDescription   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 29
rs 10
c 1
b 0
f 0
ccs 0
cts 11
cp 0
wmc 10
lcom 1
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
C fromMySqlDescription() 0 13 10
1
<?php
2
/**
3
 * Created by Gorlum 04.10.2017 8:55
4
 */
5
6
namespace DBAL;
7
8
/**
9
 * Class DbFieldDescription
10
 * @package DBAL
11
 *
12
 * Objects of this class contains MySql field description
13
 */
14
class DbFieldDescription {
15
  public $Field;
16
  public $Type;
17
  public $Collation;
18
  public $Null;
19
  public $Key;
20
  public $Default;
21
  public $Extra;
22
  public $Privileges;
23
  public $Comment;
24
25
  /**
26
   * @param array $mySqlDescription
27
   */
28
  public function fromMySqlDescription($mySqlDescription) {
29
    $this->Field = isset($mySqlDescription['Field']) ? $mySqlDescription['Field'] : null;
30
    $this->Type = isset($mySqlDescription['Type']) ? $mySqlDescription['Type'] : null;
31
    $this->Collation = isset($mySqlDescription['Collation']) ? $mySqlDescription['Collation'] : null;
32
    $this->Null = isset($mySqlDescription['Null']) ? $mySqlDescription['Null'] : null;
33
    $this->Key = isset($mySqlDescription['Key']) ? $mySqlDescription['Key'] : null;
34
    $this->Default = isset($mySqlDescription['Default']) ? $mySqlDescription['Default'] : null;
35
    $this->Extra = isset($mySqlDescription['Extra']) ? $mySqlDescription['Extra'] : null;
36
    $this->Privileges = isset($mySqlDescription['Privileges']) ? $mySqlDescription['Privileges'] : null;
37
    $this->Comment = isset($mySqlDescription['Comment']) ? $mySqlDescription['Comment'] : null;
38
39
    return $this;
40
  }
41
42
}
43