Test Failed
Push — main ( f68dd4...f46f5c )
by Bingo
14:33
created

RequestImpl   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 75
Duplicated Lines 0 %

Importance

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

17 Methods

Rating   Name   Duplication   Size   Complexity  
getRecipientPersonalData() 0 3 ?
A hp$0 ➔ getCompetentOrganization() 0 3 1
registerType() 0 31 ?
A hp$0 ➔ __construct() 0 3 1
A hp$0 ➔ getRecipientPersonalData() 0 3 1
getMethodGettingResults() 0 3 ?
getService() 0 3 ?
__construct() 0 3 ?
A hp$0 ➔ newInstance() 0 3 1
A hp$0 ➔ getGoal() 0 3 1
getCompetentOrganization() 0 3 ?
getGoal() 0 3 ?
A hp$0 ➔ getService() 0 3 1
A hp$0 ➔ registerType() 0 31 1
getData() 0 3 ?
A hp$0 ➔ getMethodGettingResults() 0 3 1
A hp$0 ➔ getData() 0 3 1
1
<?php
2
3
namespace Jabe\Model\Knd\ConstructionSupervision\Impl\Instance\Request;
4
5
use Jabe\Model\Xml\ModelBuilder;
6
use Jabe\Model\Xml\Impl\Instance\ModelElementInstanceImpl;
7
use Jabe\Model\Xml\Impl\Instance\ModelTypeInstanceContext;
8
use Jabe\Model\Xml\Type\ModelTypeInstanceProviderInterface;
9
use Jabe\Model\Knd\ConstructionSupervision\Impl\RequestModelConstants;
10
use Jabe\Model\Knd\ConstructionSupervision\Instance\Request\{
11
    CompetentOrganizationInterface,
12
    DataInterface,
13
    DelegateInfoInterface,
14
    GoalInterface,
15
    MethodGettingResultsInterface,
16
    RecipientPersonalDataInterface,
17
    RequestInterface,
18
    ServiceInterface
19
};
20
21
class RequestImpl extends ModelElementInstanceImpl implements RequestInterface
22
{
23
    private $competentOrganization;
24
    private $data;
25
    private $goal;
26
    private $methodGettingResults;
27
    private $recipientPersonalData;
28
    private $service;
29
30
    public static function registerType(ModelBuilder $modelBuilder): void
31
    {
32
        $typeBuilder = $modelBuilder->defineType(
33
            RequestInterface::class,
34
            RequestModelConstants::ELEMENT_NAME_REQUEST
35
        )
36
        ->namespaceUri(RequestModelConstants::MODEL_NAMESPACE)
37
        ->instanceProvider(
38
            new class implements ModelTypeInstanceProviderInterface
39
            {
40
                public function newInstance(ModelTypeInstanceContext $instanceContext): RequestInterface
41
                {
42
                    return new RequestImpl($instanceContext);
43
                }
44
            }
45
        );
46
47
        self::$competentOrganization = $sequenceBuilder->element(CompetentOrganizationInterface::class)
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $sequenceBuilder seems to be never defined.
Loading history...
48
        ->build();
49
        self::$data = $sequenceBuilder->element(DataInterface::class)
50
        ->build();
51
        self::$goal = $sequenceBuilder->element(GoalInterface::class)
52
        ->build();
53
        self::$methodGettingResults = $sequenceBuilder->element(MethodGettingResultsInterface::class)
54
        ->build();
55
        self::$recipientPersonalData = $sequenceBuilder->element(RecipientPersonalDataInterface::class)
56
        ->build();
57
        self::$service = $sequenceBuilder->element(ServiceInterface::class)
58
        ->build();
59
60
        $typeBuilder->build();
61
    }
62
63
    public function __construct(ModelTypeInstanceContext $instanceContext)
64
    {
65
        parent::__construct($instanceContext);
66
    }
67
68
    public function getCompetentOrganization(): CompetentOrganizationInterface
69
    {
70
        return self::$competentOrganization->getChild($this);
71
    }
72
73
    public function getData(): DataInterface
74
    {
75
        return self::$data->getChild($this);
76
    }
77
78
    public function getGoal(): GoalInterface
79
    {
80
        return self::$goal->getChild($this);
81
    }
82
83
    public function getMethodGettingResults(): MethodGettingResultsInterface
84
    {
85
        return self::$methodGettingResults->getChild($this);
86
    }
87
88
    public function getRecipientPersonalData(): RecipientPersonalDataInterface
89
    {
90
        return self::$recipientPersonalData->getChild($this);
91
    }
92
93
    public function getService(): ServiceInterface
94
    {
95
        return self::$service->getChild($this);
96
    }
97
}
98