Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 6
CRAP
0.00% covered (danger)
0.00%
0 / 1
SQLiteField
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 6
72
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 name
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 tableName
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 defaultValue
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
12
 isNullable
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 type
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace Wikimedia\Rdbms;
4
5class SQLiteField implements Field {
6    private $info, $tableName;
7
8    public function __construct( $info, $tableName ) {
9        $this->info = $info;
10        $this->tableName = $tableName;
11    }
12
13    public function name() {
14        return $this->info->name;
15    }
16
17    public function tableName() {
18        return $this->tableName;
19    }
20
21    public function defaultValue() {
22        if ( is_string( $this->info->dflt_value ) ) {
23            // Typically quoted
24            if ( preg_match( '/^\'(.*)\'$/', $this->info->dflt_value, $matches ) ) {
25                return str_replace( "''", "'", $matches[1] );
26            }
27        }
28
29        return $this->info->dflt_value;
30    }
31
32    /**
33     * @return bool
34     */
35    public function isNullable() {
36        return !$this->info->notnull;
37    }
38
39    public function type() {
40        return $this->info->type;
41    }
42}