Test Failed
Branch master (fdda4e)
by ANTHONIUS
03:39
created

UserLoader::createUser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 3
rs 10
1
<?php
2
3
/*
4
 * This file is part of the EOffice project.
5
 *
6
 * (c) Anthonius Munthi <https://itstoni.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace EOffice\User\Fixtures;
15
16
use Doctrine\Bundle\DoctrineBundle\Registry;
17
use EOffice\Contracts\Organization\Model\JabatanInterface;
18
use EOffice\Contracts\User\Model\ProfileInterface;
19
use EOffice\Contracts\User\Model\UserInterface;
20
use EOffice\Organization\Model\Jabatan;
21
use EOffice\User\Model\Profile;
22
use EOffice\User\Model\User;
23
24
class UserLoader
25
{
26
    private Registry $registry;
27
28
    public function __construct(Registry $registry)
29
    {
30
        $this->registry = $registry;
31
    }
32
33
    public function createUser(string $username, string $email, string $password): UserInterface
34
    {
35
        return new User($username, $email, $password);
36
    }
37
38
    public function createProfile(string $nama, UserInterface $user): ProfileInterface
39
    {
40
        return new Profile($nama, $user);
41
    }
42
43
    public function createJabatan(string $nama): JabatanInterface
44
    {
45
        return new Jabatan($nama);
46
    }
47
}
48