| Total Complexity | 9 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class LaravelGmailClass extends GmailConnection |
||
| 10 | { |
||
| 11 | public function __construct($config, $userId = null) |
||
| 12 | { |
||
| 13 | if (class_basename($config) === 'Application') { |
||
| 14 | $config = $config['config']; |
||
| 15 | } |
||
| 16 | |||
| 17 | parent::__construct($config, $userId); |
||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @return Message |
||
| 22 | * @throws AuthException |
||
| 23 | */ |
||
| 24 | public function message() |
||
| 25 | { |
||
| 26 | if (!$this->getToken()) { |
||
| 27 | throw new AuthException('No credentials found.'); |
||
| 28 | } |
||
| 29 | |||
| 30 | return new Message($this); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Returns the Gmail user email |
||
| 35 | * |
||
| 36 | * @return \Google_Service_Gmail_Profile |
||
| 37 | */ |
||
| 38 | public function user() |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Updates / sets the current userId for the service |
||
| 45 | * |
||
| 46 | * @return \Google_Service_Gmail_Profile |
||
| 47 | */ |
||
| 48 | public function setUserId($userId) |
||
| 49 | { |
||
| 50 | $this->userId = $userId; |
||
| 51 | return $this; |
||
|
|
|||
| 52 | } |
||
| 53 | |||
| 54 | public function redirect() |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Gets the URL to authorize the user |
||
| 61 | * |
||
| 62 | * @return string |
||
| 63 | */ |
||
| 64 | public function getAuthUrl() |
||
| 65 | { |
||
| 66 | return $this->createAuthUrl(); |
||
| 67 | } |
||
| 68 | |||
| 69 | public function logout() |
||
| 73 | } |
||
| 74 | |||
| 75 | } |
||
| 76 |