DomElementExt   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 25
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUserData() 0 3 1
A getUserData() 0 6 2
1
<?php
2
3
namespace Xml\Impl\Instance;
4
5
class DomElementExt extends \DOMElement
6
{
7
    private $userData = [];
8
9
    /**
10
     * @param mixed $key
11
     * @param mixed $data
12
     * @param mixed $handler
13
     */
14
    public function setUserData($key, $data, $handler): void
15
    {
16
        $this->userData[$key] = $data;
17
    }
18
19
    /**
20
     * @param mixed $key
21
     *
22
     * @return mixed
23
     */
24
    public function getUserData($key)
25
    {
26
        if (array_key_exists($key, $this->userData)) {
27
            return $this->userData[$key];
28
        }
29
        return null;
30
    }
31
}
32