Conditions | 2 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php namespace Arcanedev\LaravelHtml\Helpers; |
||
25 | 40 | public static function make($name, $value = null, array $attributes = [], $escaped = true) |
|
26 | { |
||
27 | 40 | $value = static::format($name, $value); |
|
|
|||
28 | |||
29 | 40 | return implode('', [ |
|
30 | 40 | '<label for="' . $name . '"' . Attributes::make($attributes) . '>', |
|
31 | 40 | $escaped ? e($value) : $value, |
|
32 | 10 | '</label>' |
|
33 | 30 | ]); |
|
34 | } |
||
35 | |||
53 |
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: