@@ -19,8 +19,7 @@ |
||
19 | 19 | * |
20 | 20 | * @author tony |
21 | 21 | */ |
22 | -class MyRequestHandler implements RequestHandlerInterface |
|
23 | -{ |
|
22 | +class MyRequestHandler implements RequestHandlerInterface { |
|
24 | 23 | |
25 | 24 | public function handle(ServerRequestInterface $request): ResponseInterface |
26 | 25 | { |
@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | $name = $param->post('name', 'Tony'); |
30 | 30 | $resp = new Response(200); |
31 | - $resp->getBody()->write("Hello ${name}"); |
|
31 | + $resp->getBody()->write("hello ${name}"); |
|
32 | 32 | |
33 | 33 | return $resp->withHeader('Framework', 'Platine PHP'); |
34 | 34 | } |
@@ -40,8 +40,7 @@ |
||
40 | 40 | * OutputAlreadySentException |
41 | 41 | * @package Platine\Http\Framework\Emitter\Exception |
42 | 42 | */ |
43 | -class OutputAlreadySentException extends RuntimeException |
|
44 | -{ |
|
43 | +class OutputAlreadySentException extends RuntimeException { |
|
45 | 44 | /** |
46 | 45 | * Create new instance |
47 | 46 | * @return self |
@@ -40,8 +40,7 @@ |
||
40 | 40 | * HeadersAlreadySentException |
41 | 41 | * @package Platine\Framework\Http\Emitter\Exception |
42 | 42 | */ |
43 | -class HeadersAlreadySentException extends RuntimeException |
|
44 | -{ |
|
43 | +class HeadersAlreadySentException extends RuntimeException { |
|
45 | 44 | /** |
46 | 45 | * Create new instance |
47 | 46 | * @return self |
@@ -40,8 +40,7 @@ |
||
40 | 40 | * HttpSpecialException |
41 | 41 | * @package Platine\Framework\Http\Exception |
42 | 42 | */ |
43 | -abstract class HttpSpecialException extends HttpException |
|
44 | -{ |
|
43 | +abstract class HttpSpecialException extends HttpException { |
|
45 | 44 | /** |
46 | 45 | * Create new instance |
47 | 46 | * @param ServerRequestInterface $request |
@@ -41,8 +41,7 @@ |
||
41 | 41 | * HttpException |
42 | 42 | * @package Platine\Framework\Http\Exception |
43 | 43 | */ |
44 | -class HttpException extends Exception |
|
45 | -{ |
|
44 | +class HttpException extends Exception { |
|
46 | 45 | /** |
47 | 46 | * The instance of server request that throw this exception |
48 | 47 | * @var ServerRequestInterface |
@@ -55,8 +55,7 @@ discard block |
||
55 | 55 | * class RequestData |
56 | 56 | * @package Platine\Framework\Http |
57 | 57 | */ |
58 | -class RequestData |
|
59 | -{ |
|
58 | +class RequestData { |
|
60 | 59 | |
61 | 60 | /** |
62 | 61 | * The request body or post data |
@@ -86,8 +85,7 @@ discard block |
||
86 | 85 | * Create new instance |
87 | 86 | * @param ServerRequestInterface $request |
88 | 87 | */ |
89 | - public function __construct(ServerRequestInterface $request) |
|
90 | - { |
|
88 | + public function __construct(ServerRequestInterface $request) { |
|
91 | 89 | $this->posts = (array) $request->getParsedBody(); |
92 | 90 | $this->gets = $request->getQueryParams(); |
93 | 91 | $this->servers = $request->getServerParams(); |
@@ -101,8 +99,7 @@ discard block |
||
101 | 99 | * |
102 | 100 | * @return mixed |
103 | 101 | */ |
104 | - public function get(string $key, $default = null) |
|
105 | - { |
|
102 | + public function get(string $key, $default = null) { |
|
106 | 103 | return Arr::get($this->gets, $key, $default); |
107 | 104 | } |
108 | 105 | |
@@ -113,8 +110,7 @@ discard block |
||
113 | 110 | * |
114 | 111 | * @return mixed |
115 | 112 | */ |
116 | - public function post(string $key, $default = null) |
|
117 | - { |
|
113 | + public function post(string $key, $default = null) { |
|
118 | 114 | return Arr::get($this->posts, $key, $default); |
119 | 115 | } |
120 | 116 | |
@@ -125,8 +121,7 @@ discard block |
||
125 | 121 | * |
126 | 122 | * @return mixed |
127 | 123 | */ |
128 | - public function server(string $key, $default = null) |
|
129 | - { |
|
124 | + public function server(string $key, $default = null) { |
|
130 | 125 | return Arr::get($this->servers, $key, $default); |
131 | 126 | } |
132 | 127 | |
@@ -137,8 +132,7 @@ discard block |
||
137 | 132 | * |
138 | 133 | * @return mixed |
139 | 134 | */ |
140 | - public function cookie(string $key, $default = null) |
|
141 | - { |
|
135 | + public function cookie(string $key, $default = null) { |
|
142 | 136 | return Arr::get($this->cookies, $key, $default); |
143 | 137 | } |
144 | 138 | } |
@@ -53,8 +53,7 @@ |
||
53 | 53 | * class MyServiceProvider |
54 | 54 | * @package Platine\Framework |
55 | 55 | */ |
56 | -class MyServiceProvider extends ServiceProvider |
|
57 | -{ |
|
56 | +class MyServiceProvider extends ServiceProvider { |
|
58 | 57 | |
59 | 58 | /** |
60 | 59 | * {@inheritdoc} |
@@ -55,8 +55,7 @@ |
||
55 | 55 | * class RoutingServiceProvider |
56 | 56 | * @package Platine\Framework\Service\Provider |
57 | 57 | */ |
58 | -class RoutingServiceProvider extends ServiceProvider |
|
59 | -{ |
|
58 | +class RoutingServiceProvider extends ServiceProvider { |
|
60 | 59 | |
61 | 60 | /** |
62 | 61 | * {@inheritdoc} |
@@ -81,7 +81,7 @@ |
||
81 | 81 | $this->app->bind(ResolverInterface::class, ConstructorResolver::class); |
82 | 82 | $this->app->bind(CallableResolverInterface::class, CallableResolver::class); |
83 | 83 | $this->app->bind(RequestHandlerInterface::class, $this->app); |
84 | - $this->app->bind(EmitterInterface::class, function (ContainerInterface $app) { |
|
84 | + $this->app->bind(EmitterInterface::class, function(ContainerInterface $app) { |
|
85 | 85 | return new ResponseEmitter( |
86 | 86 | $app->get(Config::class)->get('app.response_length', null) |
87 | 87 | ); |
@@ -64,8 +64,7 @@ |
||
64 | 64 | * class BaseServiceProvider |
65 | 65 | * @package Platine\Framework\Service\Provider |
66 | 66 | */ |
67 | -class BaseServiceProvider extends ServiceProvider |
|
68 | -{ |
|
67 | +class BaseServiceProvider extends ServiceProvider { |
|
69 | 68 | |
70 | 69 | /** |
71 | 70 | * {@inheritdoc} |