Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 4 | ||
Bugs | 0 | Features | 2 |
1 | <?php |
||
36 | protected function getValueFromParam($param) |
||
37 | { |
||
38 | if (preg_match(static::$regEx['match'], $param)) { |
||
1 ignored issue
–
show
|
|||
39 | $arg = preg_filter(static::$regEx['filter'], '', $param); |
||
1 ignored issue
–
show
|
|||
40 | if (preg_match(static::$regEx['config'], $arg)) { |
||
1 ignored issue
–
show
|
|||
41 | return $this->getValueFromConfig($arg); |
||
42 | } elseif (preg_match(static::$regEx['array'], $arg)) { |
||
1 ignored issue
–
show
|
|||
43 | return $this->getValueFromArray($arg); |
||
44 | }else { |
||
45 | return Fixtures::get($arg); |
||
46 | } |
||
47 | } else { |
||
48 | return $param; |
||
49 | } |
||
50 | } |
||
51 | |||
126 |
Let’s assume you have a class which uses late-static binding:
The code above will run fine in your PHP runtime. However, if you now create a sub-class and call the
getSomeVariable()
on that sub-class, you will receive a runtime error:In the case above, it makes sense to update
SomeClass
to useself
instead: