Passed
Push — master ( 02118d...11fb63 )
by Petr
03:00
created

ADatabase   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 30
ccs 11
cts 11
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getReadSource() 0 3 1
A getWriteSource() 0 3 1
A getAlias() 0 3 1
1
<?php
2
3
namespace kalanis\kw_mapper\Mappers\Database;
4
5
6
use kalanis\kw_mapper\MapperException;
7
use kalanis\kw_mapper\Mappers\AMapper;
8
use kalanis\kw_mapper\Storage;
9
10
11
/**
12
 * Class ADatabase
13
 * @package kalanis\kw_mapper\Mappers\Database
14
 */
15
abstract class ADatabase extends AMapper
16
{
17
    use TTable;
18
    use TReadDatabase;
19
    use TWriteDatabase;
20
21
    /**
22
     * @throws MapperException
23
     */
24 12
    public function __construct()
25
    {
26 12
        parent::__construct();
27
28 12
        $this->initTReadDatabase();
29 12
        $this->initTWriteDatabase();
30 12
    }
31
32 36
    public function getAlias(): string
33
    {
34 36
        return $this->getTable();
35
    }
36
37 12
    protected function getReadSource(): string
38
    {
39 12
        return $this->getSource();
40
    }
41
42 12
    protected function getWriteSource(): string
43
    {
44 12
        return $this->getSource();
45
    }
46
}
47