| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | protected function defaultRender($prepend = '', $append = '') |
||
| 11 | { |
||
| 12 | if ($this->error()) { |
||
|
|
|||
| 13 | $this->addClass('has-error'); |
||
| 14 | } |
||
| 15 | |||
| 16 | return <<<EOT |
||
| 17 | {$this->openHtml()} |
||
| 18 | {$this->label} |
||
| 19 | |||
| 20 | <div> |
||
| 21 | {$prepend} |
||
| 22 | {$this->html()} |
||
| 23 | {$append} |
||
| 24 | </div> |
||
| 25 | {$this->closeHtml()} |
||
| 26 | EOT; |
||
| 27 | } |
||
| 28 | } |
||
| 29 |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idableprovides a methodequalsIdthat in turn relies on the methodgetId(). If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()as an abstract method to the trait will make sure it is available.