@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Model constructor. |
28 | - * @param medoo $medoo |
|
28 | + * @param Medoo $medoo |
|
29 | 29 | */ |
30 | 30 | public function __construct(Medoo $medoo) |
31 | 31 | { |
@@ -13,7 +13,6 @@ |
||
13 | 13 | use FastD\ServiceProvider\SwooleServiceProvider; |
14 | 14 | use FastD\Servitization\Server\HTTPServer; |
15 | 15 | use Symfony\Component\Console\Input\InputInterface; |
16 | -use swoole_http_response; |
|
17 | 16 | use swoole_server; |
18 | 17 | |
19 | 18 | /** |
@@ -42,7 +42,7 @@ |
||
42 | 42 | * @param $fd |
43 | 43 | * @param $data |
44 | 44 | * @param $from_id |
45 | - * @return mixed |
|
45 | + * @return integer |
|
46 | 46 | */ |
47 | 47 | public function doWork(swoole_server $server, $fd, $data, $from_id) |
48 | 48 | { |
@@ -42,7 +42,7 @@ |
||
42 | 42 | /** |
43 | 43 | * @param swoole_server $server |
44 | 44 | * @param swoole_websocket_frame $frame |
45 | - * @return mixed |
|
45 | + * @return integer |
|
46 | 46 | */ |
47 | 47 | public function doMessage(swoole_server $server, swoole_websocket_frame $frame) |
48 | 48 | { |
@@ -16,7 +16,6 @@ |
||
16 | 16 | use FastD\Swoole\Server\WebSocket; |
17 | 17 | use swoole_server; |
18 | 18 | use swoole_websocket_frame; |
19 | -use swoole_websocket_server; |
|
20 | 19 | |
21 | 20 | /** |
22 | 21 | * Class WebSocketServer |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | /** |
25 | 25 | * @return Application |
26 | 26 | */ |
27 | -function app () { |
|
27 | +function app() { |
|
28 | 28 | return Application::$app; |
29 | 29 | } |
30 | 30 | |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * @param $callback |
34 | 34 | * @return RouteCollection |
35 | 35 | */ |
36 | -function route ($prefix = null, callable $callback = null) { |
|
36 | +function route($prefix = null, callable $callback = null) { |
|
37 | 37 | if (null === $prefix) { |
38 | 38 | return app()->get('router'); |
39 | 39 | } |
@@ -44,14 +44,14 @@ discard block |
||
44 | 44 | /** |
45 | 45 | * @return Config |
46 | 46 | */ |
47 | -function config () { |
|
47 | +function config() { |
|
48 | 48 | return app()->get('config'); |
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
52 | 52 | * @return ServerRequestInterface |
53 | 53 | */ |
54 | -function request () { |
|
54 | +function request() { |
|
55 | 55 | return app()->get('request'); |
56 | 56 | } |
57 | 57 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * @param array $headers |
62 | 62 | * @return JsonResponse |
63 | 63 | */ |
64 | -function json (array $content = [], $statusCode = Response::HTTP_OK, array $headers = []) { |
|
64 | +function json(array $content = [], $statusCode = Response::HTTP_OK, array $headers = []) { |
|
65 | 65 | $headers['X-Version'] = Application::VERSION; |
66 | 66 | return new JsonResponse($content, $statusCode, $headers); |
67 | 67 | } |
@@ -70,14 +70,14 @@ discard block |
||
70 | 70 | * @param $url |
71 | 71 | * @return RedirectResponse |
72 | 72 | */ |
73 | -function redirect ($url) { |
|
73 | +function redirect($url) { |
|
74 | 74 | return new RedirectResponse($url); |
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
78 | 78 | * @return Logger |
79 | 79 | */ |
80 | -function logger () { |
|
80 | +function logger() { |
|
81 | 81 | return app()->get('logger'); |
82 | 82 | } |
83 | 83 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @param $key |
86 | 86 | * @return AbstractAdapter |
87 | 87 | */ |
88 | -function cache ($key = 'default') { |
|
88 | +function cache($key = 'default') { |
|
89 | 89 | return app()->get('cache')->getCache($key); |
90 | 90 | } |
91 | 91 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @param $key |
94 | 94 | * @return Medoo |
95 | 95 | */ |
96 | -function database ($key = 'default') { |
|
96 | +function database($key = 'default') { |
|
97 | 97 | return app()->get('database')->getConnection($key); |
98 | 98 | } |
99 | 99 | |
@@ -109,6 +109,6 @@ discard block |
||
109 | 109 | /** |
110 | 110 | * @return \swoole_server |
111 | 111 | */ |
112 | -function server () { |
|
112 | +function server() { |
|
113 | 113 | return app()->get('server'); |
114 | 114 | } |
@@ -65,7 +65,7 @@ |
||
65 | 65 | $info = $server->stats(); |
66 | 66 | $status = ''; |
67 | 67 | foreach ($info as $key => $value) { |
68 | - $status .= "[" .date('Y-m-d H:i:s'). "]: " . $key . ': ' . $value . PHP_EOL; |
|
68 | + $status .= "[" . date('Y-m-d H:i:s') . "]: " . $key . ': ' . $value . PHP_EOL; |
|
69 | 69 | } |
70 | 70 | $server->send($fd, $status); |
71 | 71 | break; |
@@ -52,7 +52,7 @@ |
||
52 | 52 | $m[] = $value; |
53 | 53 | } |
54 | 54 | } |
55 | - } else if(is_object($middleware)) { |
|
55 | + } else if (is_object($middleware)) { |
|
56 | 56 | $m[] = get_class($middleware); |
57 | 57 | } |
58 | 58 | $rows[] = [ |