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

ColumnSchemaBuilder::buildAfterString()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
crap 6
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