| Conditions | 1 |
| Paths | 1 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 9 |
| Ratio | 100 % |
| Tests | 6 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 39 | 1 | View Code Duplication | public function reply($commentId, $content) |
| 40 | { |
||
| 41 | 1 | $params = array_merge($this->mediaPress(), [ |
|
|
|
|||
| 42 | 1 | 'user_comment_id' => $commentId, |
|
| 43 | 1 | 'content' => $content, |
|
| 44 | 1 | ]); |
|
| 45 | |||
| 46 | 1 | return $this->parseJSON('post', [self::API_REPLY_COMMENT, $params]); |
|
| 47 | } |
||
| 48 | |||
| 65 |
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.