Passed
Branch main (b6a268)
by Iain
04:11
created

DummyTeamRepository   A

Complexity

Total Complexity 13

Size/Duplication

Total Lines 74
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 74
rs 10
wmc 13

20 Methods

Rating   Name   Duplication   Size   Complexity  
A findById() 0 2 1
A hp$0 ➔ getList() 0 3 1
undelete() 0 2 ?
getById() 0 2 ?
A hp$0 ➔ getName() 0 2 1
A hp$0 ➔ getTeamSize() 0 3 1
getList() 0 3 ?
delete() 0 2 ?
A hp$0 ➔ getMembers() 0 3 1
A hp$0 ➔ setCreatedAt() 0 3 1
A hp$0 ➔ undelete() 0 2 1
A hp$0 ➔ getByMember() 0 40 1
A hp$0 ➔ hasMember() 0 3 1
A save() 0 2 1
A hp$0 ➔ getId() 0 3 1
A hp$0 ➔ getById() 0 2 1
A hp$0 ➔ addMember() 0 3 1
getByMember() 0 40 ?
A hp$0 ➔ setName() 0 2 1
A hp$0 ➔ delete() 0 2 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * Copyright Humbly Arrogant Ltd 2020-2022.
7
 *
8
 * Use of this software is governed by the Business Source License included in the LICENSE file and at https://getparthenon.com/docs/next/license.
9
 *
10
 * Change Date: TBD ( 3 years after 2.0.0 release )
11
 *
12
 * On the date above, in accordance with the Business Source License, use of this software will be governed by the open source license specified in the LICENSE file.
13
 */
14
15
namespace Parthenon\User\Repository;
16
17
use Parthenon\Athena\ResultSet;
18
use Parthenon\User\Entity\MemberInterface;
19
use Parthenon\User\Entity\TeamInterface;
20
21
class DummyTeamRepository implements TeamRepositoryInterface
22
{
23
    public function findById($id)
24
    {
25
        // TODO: Implement findById() method.
26
    }
27
28
    public function save($entity)
29
    {
30
        // TODO: Implement save() method.
31
    }
32
33
    public function getByMember(MemberInterface $member): TeamInterface
34
    {
35
        return new class() implements TeamInterface {
36
            public function getId()
37
            {
38
                return null;
39
            }
40
41
            public function addMember(MemberInterface $member): TeamInterface
42
            {
43
                return $this;
44
            }
45
46
            public function hasMember(MemberInterface $member): bool
47
            {
48
                return false;
49
            }
50
51
            public function getMembers(): array
52
            {
53
                return [];
54
            }
55
56
            public function getTeamSize(): int
57
            {
58
                return 0;
59
            }
60
61
            public function setCreatedAt(\DateTime $createdAt): TeamInterface
62
            {
63
                return $this;
64
            }
65
66
            public function setName(?string $name)
67
            {
68
                // TODO: Implement setName() method.
69
            }
70
71
            public function getName(): ?string
72
            {
73
                // TODO: Implement getName() method.
74
            }
75
        };
76
    }
77
78
    public function getList(array $filters = [], string $sortKey = 'id', string $sortType = 'ASC', int $limit = self::LIMIT, $lastId = null): ResultSet
79
    {
80
        return new ResultSet([], $sortKey, $sortType, $limit);
81
    }
82
83
    public function getById($id, $includeDeleted = false)
84
    {
85
        // TODO: Implement getById() method.
86
    }
87
88
    public function delete($entity)
89
    {
90
        // TODO: Implement delete() method.
91
    }
92
93
    public function undelete($entity)
94
    {
95
        // TODO: Implement undelete() method.
96
    }
97
}
98