UserFactorySignUp::build()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 4
1
<?php
2
3
/*
4
 * This file is part of the BenGorUser package.
5
 *
6
 * (c) Beñat Espiña <[email protected]>
7
 * (c) Gorka Laucirica <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace BenGorUser\User\Infrastructure\Domain\Model;
14
15
use BenGorUser\User\Domain\Model\User;
16
use BenGorUser\User\Domain\Model\UserEmail;
17
use BenGorUser\User\Domain\Model\UserFactorySignUp as BaseUserFactorySignUp;
18
use BenGorUser\User\Domain\Model\UserId;
19
use BenGorUser\User\Domain\Model\UserPassword;
20
21
/**
22
 * Implementation of user sign up factory domain class.
23
 *
24
 * @author Beñat Espiña <[email protected]>
25
 * @author Gorka Laucirica <[email protected]>
26
 */
27 View Code Duplication
final class UserFactorySignUp implements BaseUserFactorySignUp
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
28
{
29
    /**
30
     * The entity fully qualified namespace.
31
     *
32
     * @var string
33
     */
34
    private $class;
35
36
    /**
37
     * Constructor.
38
     *
39
     * @param string $aClass The entity fully qualified namespace
40
     */
41
    public function __construct($aClass = User::class)
42
    {
43
        $this->class = $aClass;
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49
    public function build(UserId $anId, UserEmail $anEmail, UserPassword $aPassword, array $roles)
50
    {
51
        return forward_static_call_array([$this->class, 'signUp'], [$anId, $anEmail, $aPassword, $roles]);
52
    }
53
}
54