| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | 6 | public function accounts() |
|
| 17 | { |
||
| 18 | 6 | $connection = $this->request( |
|
|
|
|||
| 19 | 6 | 'GET', |
|
| 20 | 6 | 'https://app.vssps.visualstudio.com/_apis/ConnectionData', |
|
| 21 | 6 | ['query' => ['api-version' => '5.0-preview'], 'debug' => true] |
|
| 22 | ); |
||
| 23 | |||
| 24 | // Second, retrieve for the accounts for this member |
||
| 25 | 1 | $accounts = $this->request( |
|
| 26 | 1 | 'GET', |
|
| 27 | 1 | 'https://app.vssps.visualstudio.com/_apis/accounts', |
|
| 28 | 1 | ['query' => ['memberId' => $connection['authenticatedUser']['id']]] |
|
| 29 | ); |
||
| 30 | |||
| 31 | return array_map(function ($account) { |
||
| 32 | 1 | return $this->fromDevOpsAccount($account); |
|
| 33 | 1 | }, $accounts); |
|
| 34 | } |
||
| 35 | } |
||
| 36 |
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.