| Total Complexity | 12 |
| Total Lines | 108 |
| Duplicated Lines | 0 % |
| Coverage | 88.24% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class GroupRef extends Group implements InterfaceSetMinMax |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var Group |
||
| 13 | */ |
||
| 14 | protected $wrapped; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var int |
||
| 18 | */ |
||
| 19 | protected $min = 1; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var int |
||
| 23 | */ |
||
| 24 | protected $max = 1; |
||
| 25 | |||
| 26 | 135 | public function __construct(Group $group) |
|
| 27 | { |
||
| 28 | 135 | parent::__construct($group->getSchema(), ''); |
|
| 29 | 135 | $this->wrapped = $group; |
|
| 30 | 135 | } |
|
| 31 | |||
| 32 | /** |
||
| 33 | * @return int |
||
| 34 | */ |
||
| 35 | public function getMin() |
||
| 36 | { |
||
| 37 | return $this->min; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param int $min |
||
| 42 | * |
||
| 43 | * @return $this |
||
| 44 | */ |
||
| 45 | 135 | public function setMin($min) |
|
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @return int |
||
| 54 | */ |
||
| 55 | 3 | public function getMax() |
|
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @param int $max |
||
| 62 | * |
||
| 63 | * @return $this |
||
| 64 | */ |
||
| 65 | 135 | public function setMax($max) |
|
| 66 | { |
||
| 67 | 135 | $this->max = $max; |
|
| 68 | |||
| 69 | 135 | return $this; |
|
| 70 | } |
||
| 71 | |||
| 72 | /** |
||
| 73 | * @return string |
||
| 74 | */ |
||
| 75 | 3 | public function getName() |
|
| 76 | { |
||
| 77 | 3 | return $this->wrapped->getName(); |
|
| 78 | } |
||
| 79 | |||
| 80 | /** |
||
| 81 | * @return ElementItem[] |
||
| 82 | */ |
||
| 83 | 3 | public function getElements() |
|
| 98 | } |
||
| 99 | |||
| 100 | public function addElement(ElementItem $element) |
||
| 101 | { |
||
| 102 | throw new BadMethodCallException("Can't add an element for a ref group"); |
||
| 103 | } |
||
| 104 | |||
| 105 | /** |
||
| 106 | * @return GroupRef |
||
| 107 | */ |
||
| 108 | 135 | public static function loadGroupRef(Group $referenced, DOMElement $node) |
|
| 117 | } |
||
| 118 | } |
||
| 119 |