@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Created by PhpStorm. |
|
4 | - * User: xuan |
|
5 | - * Date: 10/23/15 |
|
6 | - * Time: 10:39 AM. |
|
7 | - */ |
|
3 | + * Created by PhpStorm. |
|
4 | + * User: xuan |
|
5 | + * Date: 10/23/15 |
|
6 | + * Time: 10:39 AM. |
|
7 | + */ |
|
8 | 8 | namespace PHPHub\Repositories\Criteria; |
9 | 9 | |
10 | 10 | use Input; |
@@ -43,7 +43,7 @@ |
||
43 | 43 | { |
44 | 44 | $route = $this->router->getCurrentRoute(); |
45 | 45 | |
46 | - if (! $this->auth->check(false)) { |
|
46 | + if (!$this->auth->check(false)) { |
|
47 | 47 | $this->auth->authenticate($route->getAuthProviders()); |
48 | 48 | } |
49 | 49 |
@@ -3,21 +3,21 @@ discard block |
||
3 | 3 | /* |
4 | 4 | * 申请 access_token 或者刷新 access_token. |
5 | 5 | */ |
6 | -$router->post('oauth/access_token', function () { |
|
6 | +$router->post('oauth/access_token', function() { |
|
7 | 7 | return Response::json(Authorizer::issueAccessToken()); |
8 | 8 | }); |
9 | 9 | |
10 | 10 | /* |
11 | 11 | * 此分组下路由 需要通过 login-token 方式认证的 access token |
12 | 12 | */ |
13 | -$router->group(['middleware' => 'oauth2:user'], function ($router) { |
|
13 | +$router->group(['middleware' => 'oauth2:user'], function($router) { |
|
14 | 14 | |
15 | 15 | // 发布内容单独设置频率限制 |
16 | 16 | $router->group([ |
17 | 17 | 'middleware' => 'api.throttle', |
18 | 18 | 'limit' => config('api.rate_limits.publish.limits'), |
19 | 19 | 'expires' => config('api.rate_limits.publish.expires'), |
20 | - ], function ($router) { |
|
20 | + ], function($router) { |
|
21 | 21 | $router->post('topics', 'TopicsController@store'); |
22 | 22 | $router->post('replies', 'RepliesController@store'); |
23 | 23 | }); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | 'middleware' => 'api.throttle', |
27 | 27 | 'limit' => config('api.rate_limits.access.limits'), |
28 | 28 | 'expires' => config('api.rate_limits.access.expires'), |
29 | - ], function ($router) { |
|
29 | + ], function($router) { |
|
30 | 30 | // Users |
31 | 31 | $router->get('me', 'UsersController@me'); |
32 | 32 | $router->put('users/{id}', 'UsersController@update'); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | 'middleware' => ['oauth2', 'api.throttle'], |
58 | 58 | 'limit' => config('api.rate_limits.access.limits'), |
59 | 59 | 'expires' => config('api.rate_limits.access.expires'), |
60 | -], function ($router) { |
|
60 | +], function($router) { |
|
61 | 61 | $router->get('topics/{id}', 'TopicsController@show'); |
62 | 62 | //Topics |
63 | 63 | $router->get('topics', 'TopicsController@index'); |
@@ -38,7 +38,7 @@ |
||
38 | 38 | */ |
39 | 39 | public function platform($platform) |
40 | 40 | { |
41 | - if (! in_array($platform, ['ios', 'android', 'winphone', 'all'])) { |
|
41 | + if (!in_array($platform, ['ios', 'android', 'winphone', 'all'])) { |
|
42 | 42 | throw new \InvalidArgumentException('Invalid device type: '.$platform); |
43 | 43 | } |
44 | 44 |
@@ -51,12 +51,12 @@ |
||
51 | 51 | */ |
52 | 52 | protected function push($user_ids, $msg, $extras = null) |
53 | 53 | { |
54 | - if (! $this->jpush) { |
|
54 | + if (!$this->jpush) { |
|
55 | 55 | $this->jpush = new Jpush(); |
56 | 56 | } |
57 | 57 | |
58 | 58 | $user_ids = (array) $user_ids; |
59 | - $user_ids = array_map(function ($user_id) { |
|
59 | + $user_ids = array_map(function($user_id) { |
|
60 | 60 | return 'userid_'.$user_id; |
61 | 61 | }, $user_ids); |
62 | 62 |