CredentialWriter::updateCredential()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace Xervice\User\Business\Model\Writer;
5
6
7
use DataProvider\UserCredentialDataProvider;
8
use Xervice\User\Persistence\UserDataReader;
9
use Xervice\User\UserQueryContainerInterface;
0 ignored issues
show
Bug introduced by
The type Xervice\User\UserQueryContainerInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
11
class CredentialWriter implements CredentialWriterInterface
12
{
13
    /**
14
     * @var \Xervice\User\Persistence\UserDataReader
15
     */
16
    private $userDataReader;
17
18
    /**
19
     * CredentialWriter constructor.
20
     *
21
     * @param \Xervice\User\Persistence\UserDataReader $userDataReader
22
     */
23 1
    public function __construct(UserDataReader $userDataReader)
24
    {
25 1
        $this->userDataReader = $userDataReader;
26 1
    }
27
28
    /**
29
     * @param \DataProvider\UserCredentialDataProvider $userCredentialDataProvider
30
     *
31
     * @throws \Propel\Runtime\Exception\PropelException
32
     */
33 1
    public function updateCredential(UserCredentialDataProvider $userCredentialDataProvider): void
34
    {
35 1
        $credential = $this->userDataReader->getUserCredentialsEntity($userCredentialDataProvider);
36 1
        $credential->save();
37 1
    }
38
39
40
}