CredentialWriter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 26
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A updateCredential() 0 4 1
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
}