IssueCategory::getMutations()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Blackmine\Model\Project;
6
7
use Blackmine\Model\FetchableInterface;
8
use Blackmine\Model\NamedIdentity;
9
use Blackmine\Model\User\User;
10
use Blackmine\Mutator\MutableInterface;
11
use Blackmine\Mutator\Mutation\RenameKeyMutation;
12
13
/**
14
 * @method void setProject(Project $project)
15
 * @method void setAssignedTo(User $user)
16
 * @method void setReassignTo(User $user)
17
 *
18
 * @method Project getProject()
19
 * @method User|null getAssignedTo()
20
 * @method User|null getReassignTo()
21
 */
22
class IssueCategory extends NamedIdentity implements FetchableInterface, MutableInterface
23
{
24
    public const ENTITY_NAME = "issue_category";
25
26
    protected static array $payload_mutations = [
27
        "assigned_to" => "assigned_to_id",
28
        "reassign_to" => "reassign_to_id"
29
    ];
30
31
    protected Project $project;
32
    protected ?User $assigned_to;
33
    protected ?User $reassign_to;
34
35
    public function getMutations(): array
36
    {
37
        return [
38
            "assigned_to" => [RenameKeyMutation::class => ["assigned_to_id"]],
39
            "reassign_to" => [RenameKeyMutation::class => ["reassign_to_id"]],
40
        ];
41
    }
42
}
43