Completed
Push — cache-closure ( 7d9053...380edd )
by Dmitry
35:54
created

ColumnSchemaBuilder   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 28
ccs 0
cts 18
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A buildUnsignedString() 0 4 2
A __toString() 0 14 3
1
<?php
2
/**
3
 * @link http://www.yiiframework.com/
4
 * @copyright Copyright (c) 2008 Yii Software LLC
5
 * @license http://www.yiiframework.com/license/
6
 */
7
8
namespace yii\db\oci;
9
10
use yii\db\ColumnSchemaBuilder as AbstractColumnSchemaBuilder;
11
12
/**
13
 * ColumnSchemaBuilder is the schema builder for Oracle databases.
14
 *
15
 * @author Vasenin Matvey <[email protected]>
16
 * @author Chris Harris <[email protected]>
17
 * @since 2.0.6
18
 */
19
class ColumnSchemaBuilder extends AbstractColumnSchemaBuilder
20
{
21
    /**
22
     * @inheritdoc
23
     */
24
    protected function buildUnsignedString()
25
    {
26
        return $this->isUnsigned ? ' UNSIGNED' : '';
27
    }
28
29
    /**
30
     * @inheritdoc
31
     */
32
    public function __toString()
33
    {
34
        switch ($this->getTypeCategory()) {
35
            case self::CATEGORY_PK:
36
                $format = '{type}{length}{check}{append}';
37
                break;
38
            case self::CATEGORY_NUMERIC:
39
                $format = '{type}{length}{unsigned}{default}{notnull}{check}{append}';
40
                break;
41
            default:
42
                $format = '{type}{length}{default}{notnull}{check}{append}';
43
        }
44
        return $this->buildCompleteString($format);
45
    }
46
}
47