Issues (13)

Mezon/PdoCrud/ApropriateConnectionTrait.php (1 issue)

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