Passed
Branch 4.9 (cb955a)
by Mikhail
01:30
created

SimpleXMLElementDecorator::__isset()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 2
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace generators;
4
5
abstract class SimpleXMLElementDecorator
6
{
7
    /**
8
     * @var SimpleXMLElement
9
     */
10
    protected $simpleXMLElement;
11
12
    public function __construct(\SimpleXMLElement $simpleXMLElement)
13
    {
14
        $this->simpleXMLElement = $simpleXMLElement;
0 ignored issues
show
Documentation Bug introduced by
It seems like $simpleXMLElement of type SimpleXMLElement is incompatible with the declared type generators\SimpleXMLElement of property $simpleXMLElement.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
15
    }
16
17
    public function __call($method, $arguments)
18
    {
19
        return call_user_func_array(array($this->simpleXMLElement, $method), $arguments);
20
    }
21
22
    public function __set($name, $value) {
23
        $this->simpleXMLElement->$name = $value;
24
    }
25
26
    public function __get($name) {
27
        return $this->simpleXMLElement->$name;
28
    }
29
30
    public function __isset($name) {
31
        return isset($this->simpleXMLElement->$name);
32
    }
33
34
    public function __unset($name) {
35
        unset($this->simpleXMLElement->$name);
36
    }
37
}
38