| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function revoke($vendorEmail, $vendorName) |
||
| 32 | { |
||
| 33 | // return false if no vendor user mapping found |
||
| 34 | $mappedUser = $this->storageRepository->getUser($vendorEmail, $vendorName); |
||
| 35 | if (is_null($mappedUser)) { |
||
| 36 | return false; |
||
| 37 | } |
||
| 38 | |||
| 39 | $isRevoked = $this->thirdPartyConnection->revokeAccess( |
||
| 40 | new CommonAccessToken($mappedUser->vendorToken(), $mappedUser->vendorName(), $mappedUser->vendorEmail()) |
||
| 41 | ); |
||
| 42 | |||
| 43 | if (!$isRevoked) { |
||
| 44 | return false; |
||
| 45 | } |
||
| 46 | |||
| 47 | return $this->storageRepository->remove($vendorEmail, $vendorName); |
||
| 48 | } |
||
| 50 |