| @@ -23,7 +23,6 @@ | ||
| 23 | 23 | /** | 
| 24 | 24 | * Create an instance of the EntWeChat for the given authorizer. | 
| 25 | 25 | * | 
| 26 | - * @param string $corpId Authorizer CorpId | |
| 27 | 26 | * @param string $permanentCode Authorizer permanent-code | 
| 28 | 27 | * | 
| 29 | 28 | * @return \EntWeChat\Foundation\Application | 
| @@ -31,8 +31,8 @@ | ||
| 31 | 31 | public function createAuthorizerApplication($authorizerCorpId, $permanentCode) | 
| 32 | 32 |      { | 
| 33 | 33 |          $this->fetch('authorization') | 
| 34 | - ->setAuthorizerCorpId($authorizerCorpId) | |
| 35 | - ->setAuthorizerPermanentCode($permanentCode); | |
| 34 | + ->setAuthorizerCorpId($authorizerCorpId) | |
| 35 | + ->setAuthorizerPermanentCode($permanentCode); | |
| 36 | 36 | |
| 37 | 37 |          $application = $this->fetch('app'); | 
| 38 | 38 |          $application['access_token'] = $this->fetch('authorizer_access_token'); | 
| @@ -22,7 +22,7 @@ discard block | ||
| 22 | 22 | * @param int|null $order | 
| 23 | 23 | * @param int|null $partyId | 
| 24 | 24 | * | 
| 25 | - * @return int | |
| 25 | + * @return \EntWeChat\Support\Collection | |
| 26 | 26 | */ | 
| 27 | 27 | public function create($name, $parentId, $order = null, $partyId = null) | 
| 28 | 28 |      { | 
| @@ -39,7 +39,7 @@ discard block | ||
| 39 | 39 | /** | 
| 40 | 40 | * List all Departments. | 
| 41 | 41 | * | 
| 42 | - * @return array | |
| 42 | + * @return \EntWeChat\Support\Collection | |
| 43 | 43 | */ | 
| 44 | 44 | public function lists($partyId = null) | 
| 45 | 45 |      { | 
| @@ -54,9 +54,8 @@ discard block | ||
| 54 | 54 | * Update a Department. | 
| 55 | 55 | * | 
| 56 | 56 | * @param int $partyId | 
| 57 | - * @param array $name | |
| 58 | 57 | * | 
| 59 | - * @return bool | |
| 58 | + * @return \EntWeChat\Support\Collection | |
| 60 | 59 | */ | 
| 61 | 60 | public function update($partyId, array $partyInfo = []) | 
| 62 | 61 |      { | 
| @@ -68,9 +67,8 @@ discard block | ||
| 68 | 67 | /** | 
| 69 | 68 | * Delete Department. | 
| 70 | 69 | * | 
| 71 | - * @param int $groupId | |
| 72 | 70 | * | 
| 73 | - * @return bool | |
| 71 | + * @return \EntWeChat\Support\Collection | |
| 74 | 72 | */ | 
| 75 | 73 | public function delete($partyId) | 
| 76 | 74 |      { | 
| @@ -63,10 +63,10 @@ | ||
| 63 | 63 | protected function refreshToken() | 
| 64 | 64 |      { | 
| 65 | 65 | $token = $this->authorization->getApi() | 
| 66 | - ->getAuthorizerToken( | |
| 67 | - $this->authorization->getAuthorizerCorpId(), | |
| 68 | - $this->authorization->getAuthorizerPermanentCode() | |
| 69 | - ); | |
| 66 | + ->getAuthorizerToken( | |
| 67 | + $this->authorization->getAuthorizerCorpId(), | |
| 68 | + $this->authorization->getAuthorizerPermanentCode() | |
| 69 | + ); | |
| 70 | 70 | |
| 71 | 71 | $this->authorization->setAuthorizerAccessToken($token['access_token'], $token['expires_in'] - 1500); | 
| 72 | 72 | |
| @@ -22,11 +22,11 @@ | ||
| 22 | 22 | */ | 
| 23 | 23 | public function register(Container $pimple) | 
| 24 | 24 |      { | 
| 25 | -        $pimple['oauth'] = function ($pimple) { | |
| 25 | +        $pimple['oauth'] = function($pimple) { | |
| 26 | 26 | return new App($pimple['access_token']); | 
| 27 | 27 | }; | 
| 28 | 28 | |
| 29 | -        $pimple['auth'] = function ($pimple) { | |
| 29 | +        $pimple['auth'] = function($pimple) { | |
| 30 | 30 | return new Web($pimple['access_token']); | 
| 31 | 31 | }; | 
| 32 | 32 | } | 
| @@ -29,14 +29,14 @@ discard block | ||
| 29 | 29 | */ | 
| 30 | 30 | public function register(Container $pimple) | 
| 31 | 31 |      { | 
| 32 | -        $pimple['suite.ticket'] = function ($pimple) { | |
| 32 | +        $pimple['suite.ticket'] = function($pimple) { | |
| 33 | 33 | return new Ticket( | 
| 34 | 34 | $pimple['config']['suite']['suite_id'], | 
| 35 | 35 | $pimple['cache'] | 
| 36 | 36 | ); | 
| 37 | 37 | }; | 
| 38 | 38 | |
| 39 | -        $pimple['suite.access_token'] = function ($pimple) { | |
| 39 | +        $pimple['suite.access_token'] = function($pimple) { | |
| 40 | 40 | $accessToken = new AccessToken( | 
| 41 | 41 | $pimple['config']['suite']['suite_id'], | 
| 42 | 42 | $pimple['config']['suite']['secret'], | 
| @@ -47,7 +47,7 @@ discard block | ||
| 47 | 47 | return $accessToken; | 
| 48 | 48 | }; | 
| 49 | 49 | |
| 50 | -        $pimple['suite.encryptor'] = function ($pimple) { | |
| 50 | +        $pimple['suite.encryptor'] = function($pimple) { | |
| 51 | 51 | return new Encryptor( | 
| 52 | 52 | $pimple['config']['suite']['suite_id'], | 
| 53 | 53 | $pimple['config']['suite']['token'], | 
| @@ -55,11 +55,11 @@ discard block | ||
| 55 | 55 | ); | 
| 56 | 56 | }; | 
| 57 | 57 | |
| 58 | -        $pimple['suite'] = function ($pimple) { | |
| 58 | +        $pimple['suite'] = function($pimple) { | |
| 59 | 59 | return new Suite($pimple); | 
| 60 | 60 | }; | 
| 61 | 61 | |
| 62 | -        $pimple['suite.server'] = function ($pimple) { | |
| 62 | +        $pimple['suite.server'] = function($pimple) { | |
| 63 | 63 | $server = new Guard($pimple['config']['suite']['token']); | 
| 64 | 64 | $server->debug($pimple['config']['debug']); | 
| 65 | 65 | $server->setEncryptor($pimple['suite.encryptor']); | 
| @@ -73,21 +73,21 @@ discard block | ||
| 73 | 73 | return $server; | 
| 74 | 74 | }; | 
| 75 | 75 | |
| 76 | -        $pimple['suite.pre_auth'] = $pimple['suite.pre_authorization'] = function ($pimple) { | |
| 76 | +        $pimple['suite.pre_auth'] = $pimple['suite.pre_authorization'] = function($pimple) { | |
| 77 | 77 | return new PreAuthorization( | 
| 78 | 78 | $pimple['suite.access_token'], | 
| 79 | 79 | $pimple['request'] | 
| 80 | 80 | ); | 
| 81 | 81 | }; | 
| 82 | 82 | |
| 83 | -        $pimple['suite.api'] = function ($pimple) { | |
| 83 | +        $pimple['suite.api'] = function($pimple) { | |
| 84 | 84 | return new BaseApi( | 
| 85 | 85 | $pimple['suite.access_token'], | 
| 86 | 86 | $pimple['request'] | 
| 87 | 87 | ); | 
| 88 | 88 | }; | 
| 89 | 89 | |
| 90 | -        $pimple['suite.authorization'] = function ($pimple) { | |
| 90 | +        $pimple['suite.authorization'] = function($pimple) { | |
| 91 | 91 | return new Authorization( | 
| 92 | 92 | $pimple['suite.api'], | 
| 93 | 93 | $pimple['config']['suite']['corp_id'], | 
| @@ -95,7 +95,7 @@ discard block | ||
| 95 | 95 | ); | 
| 96 | 96 | }; | 
| 97 | 97 | |
| 98 | -        $pimple['suite.authorizer_access_token'] = function ($pimple) { | |
| 98 | +        $pimple['suite.authorizer_access_token'] = function($pimple) { | |
| 99 | 99 | return new AuthorizerAccessToken( | 
| 100 | 100 | $pimple['config']['suite']['corp_id'], | 
| 101 | 101 | $pimple['suite.authorization'] | 
| @@ -103,25 +103,25 @@ discard block | ||
| 103 | 103 | }; | 
| 104 | 104 | |
| 105 | 105 | // Authorization events handlers. | 
| 106 | -        $pimple['suite.handlers.suite_ticket'] = function ($pimple) { | |
| 106 | +        $pimple['suite.handlers.suite_ticket'] = function($pimple) { | |
| 107 | 107 | return new EventHandlers\SuiteTicket($pimple['suite.ticket']); | 
| 108 | 108 | }; | 
| 109 | -        $pimple['suite.handlers.create_auth'] = function () { | |
| 109 | +        $pimple['suite.handlers.create_auth'] = function() { | |
| 110 | 110 | return new EventHandlers\CreateAuth(); | 
| 111 | 111 | }; | 
| 112 | -        $pimple['suite.handlers.change_auth'] = function () { | |
| 112 | +        $pimple['suite.handlers.change_auth'] = function() { | |
| 113 | 113 | return new EventHandlers\ChangeAuth(); | 
| 114 | 114 | }; | 
| 115 | -        $pimple['suite.handlers.cancel_auth'] = function () { | |
| 115 | +        $pimple['suite.handlers.cancel_auth'] = function() { | |
| 116 | 116 | return new EventHandlers\CancelAuth(); | 
| 117 | 117 | }; | 
| 118 | 118 | |
| 119 | -        $pimple['suite.app'] = function ($pimple) { | |
| 119 | +        $pimple['suite.app'] = function($pimple) { | |
| 120 | 120 | return new Application($pimple['config']->toArray()); | 
| 121 | 121 | }; | 
| 122 | 122 | |
| 123 | 123 | // OAuth for Suite. | 
| 124 | -        $pimple['suite.oauth'] = function ($pimple) { | |
| 124 | +        $pimple['suite.oauth'] = function($pimple) { | |
| 125 | 125 | return new App($pimple['suite.authorizer_access_token']->getToken()); | 
| 126 | 126 | }; | 
| 127 | 127 | } |