getApropriateConnection()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
namespace Mezon\PdoCrud;
3
4
use Mezon\Conf\Conf;
5
6
/**
7
 * Class ConnectionTrait
8
 *
9
 * @package Mezon
10
 * @subpackage PdoCrud
11
 * @author Dodonov A.A.
12
 * @version v.1.0 (2020/02/19)
13
 * @copyright Copyright (c) 2020, aeon.org
14
 */
15
16
/**
17
 * Trait for getting appropriate connection
18
 */
19
trait ApropriateConnectionTrait
20
{
21
    use ConnectionTrait;
22
23
    /**
24
     * Method returns appropriate connections
25
     *
26
     * @return PdoCrud connection
27
     */
28
    public function getApropriateConnection(): PdoCrud
29
    {
30
        return $this->getConnection([
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getConnect...efault-db-connection')) could return the type true which is incompatible with the type-hinted return Mezon\PdoCrud\PdoCrud. Consider adding an additional type-check to rule them out.
Loading history...
31
            'default-db-connection'
32
        ]);
33
    }
34
}
35