Completed
Push — master ( 462877...657388 )
by grégoire
01:55
created

DatabaseInspector   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 3
c 2
b 0
f 2
lcom 0
cbo 3
dl 0
loc 42
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getClientType() 0 4 1
A getClientIdentifier() 0 4 1
A getVersion() 0 9 1
1
<?php
2
/*
3
 * This file is part of the Pomm package.
4
 *
5
 * (c) 2014 - 2015 Grégoire HUBERT <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace PommProject\Foundation\Inspector;
11
12
use PommProject\Foundation\Client\Client;
13
14
/**
15
 * DatabaseInspector
16
 *
17
 * Global inspector, it will give informations about the following:
18
 *
19
 * * configuration settings
20
 * * version
21
 *
22
 * @package     Pomm
23
 * @copyright   2015 Grégoire HUBERT
24
 * @author      Grégoire HUBERT
25
 * @license     X11 {@link http://opensource.org/licenses/mit-license.php}
26
 *
27
 * @see Client
28
 */
29
class DatabaseInspector extends Client
30
{
31
32
    use InspectorTrait;
33
34
    /**
35
     * getClientType
36
     *
37
     * @see ClientInterface
38
     */
39
    public function getClientType()
40
    {
41
        return 'inspector';
42
    }
43
44
    /**
45
     * getClientIdentifier
46
     *
47
     * @see ClientInterface
48
     */
49
    public function getClientIdentifier()
50
    {
51
        return 'database';
52
    }
53
54
    /**
55
     * getVersion
56
     *
57
     * Return server version.
58
     *
59
     * @return  string
60
     */
61
    public function getVersion()
62
    {
63
        $row = $this
64
            ->executeSql("show server_version")
65
            ->current()
66
            ;
67
68
        return $row['server_version'];
69
    }
70
}
71