| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 18 | protected function convertRepo($data) |
||
| 19 | { |
||
| 20 | return new GithubRepoSource( |
||
| 21 | new GithubRepoId($data['id']), |
||
| 22 | $this->getUser($data['owner']), |
||
|
|
|||
| 23 | $data['owner']['login'], |
||
| 24 | $data['name'], |
||
| 25 | $data['full_name'], |
||
| 26 | $data['html_url'], |
||
| 27 | $data['description'], |
||
| 28 | $data['fork'], |
||
| 29 | $data['default_branch'], |
||
| 30 | $data['private'], |
||
| 31 | $data['git_url'], |
||
| 32 | $data['ssh_url'], |
||
| 33 | new DateTime($data['created_at']), |
||
| 34 | new DateTime($data['updated_at']), |
||
| 35 | new DateTime($data['pushed_at']) |
||
| 36 | ); |
||
| 37 | } |
||
| 38 | } |
||
| 39 |
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.