This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
6
7
use Implementation;
8
9
/**
10
* @param string $name
11
* @return bool
12
*/
13
5
public function __isset(string $name) {
14
switch ($name) {
15
5
case 'firstElementChild' :
16
2
return $this->getFirstElementChild() !== NULL;
17
3
case 'lastElementChild' :
18
2
return $this->getLastElementChild() !== NULL;
19
}
20
1
return isset($this->$name);
21
}
22
23
/**
24
* @param string $name
25
* @return \FluentDOM\DOM\Element|NULL
26
*/
27
9
public function __get(string $name) {
28
switch ($name) {
29
9
case 'firstElementChild' :
30
4
return $this->getFirstElementChild();
31
5
case 'lastElementChild' :
32
4
return $this->getLastElementChild();
33
}
34
1
return $this->$name;
35
}
36
37
/**
38
* @param string $name
39
* @param $value
40
*/
41
3
public function __set(string $name, $value) {
42
3
$this->blockReadOnlyProperties($name);
43
1
$this->$name = $value;
44
1
}
45
46
/**
47
* @param string $name
48
*/
49
1
public function __unset(string $name) {
50
1
$this->blockReadOnlyProperties($name);
51
1
unset($this->$name);
52
1
}
53
54
/**
55
* @param string $name
56
* @throws \BadMethodCallException
57
*/
58
4
protected function blockReadOnlyProperties(string $name) {
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.