Passed
Push — main ( b77906...b05fa5 )
by Bingo
02:54
created

AbstractChildElementAssumption   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 1
1
<?php
2
3
namespace Xml\Test;
4
5
use Xml\ModelInterface;
6
7
abstract class AbstractChildElementAssumption
8
{
9
    public $namespaceUri;
10
    public $childElementType;
11
    public $minOccurs;
12
    public $maxOccurs;
13
    private $model;
14
15
    public function __construct(
16
        ModelInterface $model,
17
        string $childElementType,
18
        int $minOccurs = null,
19
        int $maxOccurs = null,
20
        string $namespaceUri = null
21
    ) {
22
        $this->model = $model;
23
        $this->childElementType = $this->model->getType($childElementType);
24
        $this->minOccurs = $minOccurs ?? 0;
25
        $this->maxOccurs = $maxOccurs ?? -1;
26
        $this->namespaceUri = $namespaceUri ?? $this->getDefaultNamespace();
27
    }
28
29
    abstract public function getDefaultNamespace(): string;
30
}
31