UserPasswordTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getUser() 0 3 1
A getPassword() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 *  This file is part of the Micro framework package.
7
 *
8
 *  (c) Stanislau Komar <[email protected]>
9
 *
10
 *  For the full copyright and license information, please view the LICENSE
11
 *  file that was distributed with this source code.
12
 */
13
14
namespace Micro\Plugin\Doctrine\Configuration\Driver;
15
16
trait UserPasswordTrait
17
{
18
    protected static string $CFG_IN_USER = 'ORM_%s_USER';
19
    protected static string $CFG_PASSWORD = 'ORM_%s_PASSWORD';
20
21 5
    public function getUser(): ?string
22
    {
23 5
        return $this->get(self::$CFG_IN_USER);
0 ignored issues
show
Bug introduced by
It seems like get() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

23
        return $this->/** @scrutinizer ignore-call */ get(self::$CFG_IN_USER);
Loading history...
24
    }
25
26 5
    public function getPassword(): ?string
27
    {
28 5
        return $this->get(self::$CFG_PASSWORD);
29
    }
30
}
31