| Conditions | 4 |
| Paths | 6 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php namespace Arcanedev\LaravelHtml\Helpers; |
||
| 23 | 384 | public static function make(array $attributes) |
|
| 24 | { |
||
| 25 | 384 | $html = []; |
|
| 26 | |||
| 27 | 384 | foreach ((array) $attributes as $key => $value) { |
|
| 28 | 348 | $element = static::makeAttributeElement($key, $value); |
|
|
|
|||
| 29 | |||
| 30 | 348 | if ( ! is_null($element)) |
|
| 31 | 346 | $html[] = $element; |
|
| 32 | } |
||
| 33 | |||
| 34 | 384 | return (count($html) > 0) ? ' '.implode(' ', array_filter($html)) : ''; |
|
| 35 | } |
||
| 36 | |||
| 67 |
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
SomeClassto useselfinstead: