@@ -30,96 +30,96 @@ |
||
30 | 30 | */ |
31 | 31 | class Status |
32 | 32 | { |
33 | - /** |
|
34 | - * The HTTP status code. |
|
35 | - * |
|
36 | - * @var int $status |
|
37 | - */ |
|
38 | - protected $status = 200; |
|
33 | + /** |
|
34 | + * The HTTP status code. |
|
35 | + * |
|
36 | + * @var int $status |
|
37 | + */ |
|
38 | + protected $status = 200; |
|
39 | 39 | |
40 | - /** |
|
41 | - * An array of status codes and messages. |
|
42 | - * |
|
43 | - * @var array $statusCode |
|
44 | - */ |
|
45 | - public $statusCodes = [ |
|
46 | - // 1xx: Informational |
|
47 | - 100 => 'Continue', |
|
48 | - 101 => 'Switching Protocols', |
|
49 | - 102 => 'Processing', |
|
40 | + /** |
|
41 | + * An array of status codes and messages. |
|
42 | + * |
|
43 | + * @var array $statusCode |
|
44 | + */ |
|
45 | + public $statusCodes = [ |
|
46 | + // 1xx: Informational |
|
47 | + 100 => 'Continue', |
|
48 | + 101 => 'Switching Protocols', |
|
49 | + 102 => 'Processing', |
|
50 | 50 | |
51 | - // 2xx: Success |
|
52 | - 200 => 'OK', |
|
53 | - 201 => 'Created', |
|
54 | - 202 => 'Accepted', |
|
55 | - 203 => 'Non-Authoritative Information', |
|
56 | - 204 => 'No Content', |
|
57 | - 205 => 'Reset Content', |
|
58 | - 206 => 'Partial Content', |
|
59 | - 207 => 'Multi-Status', |
|
60 | - 208 => 'Already Reported', |
|
61 | - 226 => 'IM Used', |
|
51 | + // 2xx: Success |
|
52 | + 200 => 'OK', |
|
53 | + 201 => 'Created', |
|
54 | + 202 => 'Accepted', |
|
55 | + 203 => 'Non-Authoritative Information', |
|
56 | + 204 => 'No Content', |
|
57 | + 205 => 'Reset Content', |
|
58 | + 206 => 'Partial Content', |
|
59 | + 207 => 'Multi-Status', |
|
60 | + 208 => 'Already Reported', |
|
61 | + 226 => 'IM Used', |
|
62 | 62 | |
63 | - // 3xx: Redirection |
|
64 | - 300 => 'Multiple Choices', |
|
65 | - 301 => 'Moved Permanently', |
|
66 | - 302 => 'Found', |
|
67 | - 303 => 'See Other', |
|
68 | - 304 => 'Not Modified', |
|
69 | - 305 => 'Use Proxy', |
|
70 | - 307 => 'Temporary Redirect', |
|
71 | - 308 => 'Permanent Redirect', |
|
63 | + // 3xx: Redirection |
|
64 | + 300 => 'Multiple Choices', |
|
65 | + 301 => 'Moved Permanently', |
|
66 | + 302 => 'Found', |
|
67 | + 303 => 'See Other', |
|
68 | + 304 => 'Not Modified', |
|
69 | + 305 => 'Use Proxy', |
|
70 | + 307 => 'Temporary Redirect', |
|
71 | + 308 => 'Permanent Redirect', |
|
72 | 72 | |
73 | - // 4xx: Client error |
|
74 | - 400 => 'Bad Request', |
|
75 | - 401 => 'Unauthorized', |
|
76 | - 402 => 'Payment Required', |
|
77 | - 403 => 'Forbidden', |
|
78 | - 404 => 'Not Found', |
|
79 | - 405 => 'Method Not Allowed', |
|
80 | - 406 => 'Not Acceptable', |
|
81 | - 407 => 'Proxy Authentication Required', |
|
82 | - 408 => 'Request Timeout', |
|
83 | - 409 => 'Conflict', |
|
84 | - 410 => 'Gone', |
|
85 | - 411 => 'Length Required', |
|
86 | - 412 => 'Precondition Failed', |
|
87 | - 413 => 'Request Entity Too Large', |
|
88 | - 414 => 'Request-URI Too Long', |
|
89 | - 415 => 'Unsupported Media Type', |
|
90 | - 416 => 'Requested Range Not Satisfiable', |
|
91 | - 417 => 'Expectation Failed', |
|
92 | - 418 => 'I\'m a Teapot', |
|
93 | - // 419 (Authentication Timeout) is a non-standard status code with unknown origin |
|
94 | - 421 => 'Misdirected Request', |
|
95 | - 422 => 'Unprocessable Entity', |
|
96 | - 423 => 'Locked', |
|
97 | - 424 => 'Failed Dependency', |
|
98 | - 426 => 'Upgrade Required', |
|
99 | - 428 => 'Precondition Required', |
|
100 | - 429 => 'Too Many Requests', |
|
101 | - 431 => 'Request Header Fields Too Large', |
|
102 | - 451 => 'Unavailable For Legal Reasons', |
|
73 | + // 4xx: Client error |
|
74 | + 400 => 'Bad Request', |
|
75 | + 401 => 'Unauthorized', |
|
76 | + 402 => 'Payment Required', |
|
77 | + 403 => 'Forbidden', |
|
78 | + 404 => 'Not Found', |
|
79 | + 405 => 'Method Not Allowed', |
|
80 | + 406 => 'Not Acceptable', |
|
81 | + 407 => 'Proxy Authentication Required', |
|
82 | + 408 => 'Request Timeout', |
|
83 | + 409 => 'Conflict', |
|
84 | + 410 => 'Gone', |
|
85 | + 411 => 'Length Required', |
|
86 | + 412 => 'Precondition Failed', |
|
87 | + 413 => 'Request Entity Too Large', |
|
88 | + 414 => 'Request-URI Too Long', |
|
89 | + 415 => 'Unsupported Media Type', |
|
90 | + 416 => 'Requested Range Not Satisfiable', |
|
91 | + 417 => 'Expectation Failed', |
|
92 | + 418 => 'I\'m a Teapot', |
|
93 | + // 419 (Authentication Timeout) is a non-standard status code with unknown origin |
|
94 | + 421 => 'Misdirected Request', |
|
95 | + 422 => 'Unprocessable Entity', |
|
96 | + 423 => 'Locked', |
|
97 | + 424 => 'Failed Dependency', |
|
98 | + 426 => 'Upgrade Required', |
|
99 | + 428 => 'Precondition Required', |
|
100 | + 429 => 'Too Many Requests', |
|
101 | + 431 => 'Request Header Fields Too Large', |
|
102 | + 451 => 'Unavailable For Legal Reasons', |
|
103 | 103 | |
104 | - // 5xx: Server error |
|
105 | - 500 => 'Internal Server Error', |
|
106 | - 501 => 'Not Implemented', |
|
107 | - 502 => 'Bad Gateway', |
|
108 | - 503 => 'Service Unavailable', |
|
109 | - 504 => 'Gateway Timeout', |
|
110 | - 505 => 'HTTP Version Not Supported', |
|
111 | - 506 => 'Variant Also Negotiates', |
|
112 | - 507 => 'Insufficient Storage', |
|
113 | - 508 => 'Loop Detected', |
|
114 | - 509 => 'Bandwidth Limit Exceeded', |
|
115 | - 510 => 'Not Extended', |
|
116 | - 511 => 'Network Authentication Required' |
|
117 | - ]; |
|
104 | + // 5xx: Server error |
|
105 | + 500 => 'Internal Server Error', |
|
106 | + 501 => 'Not Implemented', |
|
107 | + 502 => 'Bad Gateway', |
|
108 | + 503 => 'Service Unavailable', |
|
109 | + 504 => 'Gateway Timeout', |
|
110 | + 505 => 'HTTP Version Not Supported', |
|
111 | + 506 => 'Variant Also Negotiates', |
|
112 | + 507 => 'Insufficient Storage', |
|
113 | + 508 => 'Loop Detected', |
|
114 | + 509 => 'Bandwidth Limit Exceeded', |
|
115 | + 510 => 'Not Extended', |
|
116 | + 511 => 'Network Authentication Required' |
|
117 | + ]; |
|
118 | 118 | |
119 | - /** |
|
120 | - * Gets string of status code. |
|
121 | - * |
|
122 | - * @var string $statusText |
|
123 | - */ |
|
124 | - protected $statusText; |
|
119 | + /** |
|
120 | + * Gets string of status code. |
|
121 | + * |
|
122 | + * @var string $statusText |
|
123 | + */ |
|
124 | + protected $statusText; |
|
125 | 125 | } |
126 | 126 | \ No newline at end of file |
@@ -140,7 +140,7 @@ |
||
140 | 140 | * |
141 | 141 | * @return mixed |
142 | 142 | */ |
143 | - public function get($key, $default = null, $option = true) |
|
143 | + public function get($key, $default = null, $option = true) |
|
144 | 144 | { |
145 | 145 | $key = str_replace('_', '-', strtolower($key)); |
146 | 146 |
@@ -33,236 +33,236 @@ |
||
33 | 33 | */ |
34 | 34 | class Headers implements IteratorAggregate, Countable |
35 | 35 | { |
36 | - /** |
|
37 | - * An array of HTTP headers. |
|
38 | - * |
|
39 | - * @var array $herders |
|
40 | - */ |
|
41 | - protected $headers = []; |
|
36 | + /** |
|
37 | + * An array of HTTP headers. |
|
38 | + * |
|
39 | + * @var array $herders |
|
40 | + */ |
|
41 | + protected $headers = []; |
|
42 | 42 | |
43 | - /** |
|
44 | - * Specifies the directives for the caching mechanisms in both |
|
45 | - * the requests and the responses. |
|
46 | - * |
|
47 | - * @var array $cacheControl |
|
48 | - */ |
|
49 | - protected $cacheControl = []; |
|
43 | + /** |
|
44 | + * Specifies the directives for the caching mechanisms in both |
|
45 | + * the requests and the responses. |
|
46 | + * |
|
47 | + * @var array $cacheControl |
|
48 | + */ |
|
49 | + protected $cacheControl = []; |
|
50 | 50 | |
51 | - /** |
|
52 | - * Constructor. The Headers class instance. |
|
53 | - * |
|
54 | - * @param array $headers |
|
55 | - * |
|
56 | - * @return void |
|
57 | - */ |
|
58 | - public function __construct(array $headers = []) |
|
59 | - { |
|
60 | - foreach ($headers as $key => $values) { |
|
61 | - $this->set($key, $values); |
|
62 | - } |
|
63 | - } |
|
51 | + /** |
|
52 | + * Constructor. The Headers class instance. |
|
53 | + * |
|
54 | + * @param array $headers |
|
55 | + * |
|
56 | + * @return void |
|
57 | + */ |
|
58 | + public function __construct(array $headers = []) |
|
59 | + { |
|
60 | + foreach ($headers as $key => $values) { |
|
61 | + $this->set($key, $values); |
|
62 | + } |
|
63 | + } |
|
64 | 64 | |
65 | - /** |
|
66 | - * Returns all the headers. |
|
67 | - * |
|
68 | - * @return array |
|
69 | - */ |
|
70 | - public function all() |
|
71 | - { |
|
72 | - return $this->headers; |
|
73 | - } |
|
65 | + /** |
|
66 | + * Returns all the headers. |
|
67 | + * |
|
68 | + * @return array |
|
69 | + */ |
|
70 | + public function all() |
|
71 | + { |
|
72 | + return $this->headers; |
|
73 | + } |
|
74 | 74 | |
75 | - /** |
|
76 | - * Returns the parameter keys. |
|
77 | - * |
|
78 | - * @return array An array of parameter keys |
|
79 | - */ |
|
80 | - public function keys() |
|
81 | - { |
|
82 | - return array_keys($this->all()); |
|
83 | - } |
|
75 | + /** |
|
76 | + * Returns the parameter keys. |
|
77 | + * |
|
78 | + * @return array An array of parameter keys |
|
79 | + */ |
|
80 | + public function keys() |
|
81 | + { |
|
82 | + return array_keys($this->all()); |
|
83 | + } |
|
84 | 84 | |
85 | - /** |
|
86 | - * Replaces the current HTTP headers by a new set. |
|
87 | - * |
|
88 | - * @param array $headers |
|
89 | - * |
|
90 | - * @return void |
|
91 | - */ |
|
92 | - public function replace(array $headers = []) |
|
93 | - { |
|
94 | - $this->headers = []; |
|
95 | - $this->add($headers); |
|
96 | - } |
|
85 | + /** |
|
86 | + * Replaces the current HTTP headers by a new set. |
|
87 | + * |
|
88 | + * @param array $headers |
|
89 | + * |
|
90 | + * @return void |
|
91 | + */ |
|
92 | + public function replace(array $headers = []) |
|
93 | + { |
|
94 | + $this->headers = []; |
|
95 | + $this->add($headers); |
|
96 | + } |
|
97 | 97 | |
98 | - /** |
|
99 | - * Adds multiple header to the queue. |
|
100 | - * |
|
101 | - * @param array $headers The header name |
|
102 | - * |
|
103 | - * @return mixed |
|
104 | - */ |
|
105 | - public function add(array $headers) |
|
106 | - { |
|
107 | - foreach ($headers as $key => $values) { |
|
108 | - $this->set($key, $values); |
|
109 | - } |
|
98 | + /** |
|
99 | + * Adds multiple header to the queue. |
|
100 | + * |
|
101 | + * @param array $headers The header name |
|
102 | + * |
|
103 | + * @return mixed |
|
104 | + */ |
|
105 | + public function add(array $headers) |
|
106 | + { |
|
107 | + foreach ($headers as $key => $values) { |
|
108 | + $this->set($key, $values); |
|
109 | + } |
|
110 | 110 | |
111 | - return $this; |
|
112 | - } |
|
111 | + return $this; |
|
112 | + } |
|
113 | 113 | |
114 | - /** |
|
115 | - * Returns the headers, with original capitalizations. |
|
116 | - * |
|
117 | - * @return array An array of headers |
|
118 | - */ |
|
119 | - public function allPreserveCase() |
|
120 | - { |
|
121 | - $headers = []; |
|
114 | + /** |
|
115 | + * Returns the headers, with original capitalizations. |
|
116 | + * |
|
117 | + * @return array An array of headers |
|
118 | + */ |
|
119 | + public function allPreserveCase() |
|
120 | + { |
|
121 | + $headers = []; |
|
122 | 122 | |
123 | - foreach ($this->all() as $name => $value) { |
|
124 | - $headers[$name] = $value; |
|
125 | - } |
|
123 | + foreach ($this->all() as $name => $value) { |
|
124 | + $headers[$name] = $value; |
|
125 | + } |
|
126 | 126 | |
127 | - return $headers; |
|
128 | - } |
|
127 | + return $headers; |
|
128 | + } |
|
129 | 129 | |
130 | - /** |
|
131 | - * Gets a header value by name. |
|
132 | - * |
|
133 | - * @param string $key The header name, or null for all headers |
|
134 | - * @param string|null $default The default value |
|
135 | - * @param bool $option Whether to return the option value or all header values |
|
136 | - * |
|
137 | - * @return mixed |
|
138 | - */ |
|
139 | - public function get($key, $default = null, $option = true) |
|
140 | - { |
|
141 | - $key = str_replace('_', '-', strtolower($key)); |
|
130 | + /** |
|
131 | + * Gets a header value by name. |
|
132 | + * |
|
133 | + * @param string $key The header name, or null for all headers |
|
134 | + * @param string|null $default The default value |
|
135 | + * @param bool $option Whether to return the option value or all header values |
|
136 | + * |
|
137 | + * @return mixed |
|
138 | + */ |
|
139 | + public function get($key, $default = null, $option = true) |
|
140 | + { |
|
141 | + $key = str_replace('_', '-', strtolower($key)); |
|
142 | 142 | |
143 | - $headers = $this->all(); |
|
143 | + $headers = $this->all(); |
|
144 | 144 | |
145 | - if ( ! array_key_exists($key, $headers)) { |
|
146 | - if (null === $default) { |
|
147 | - return $option ? null : []; |
|
148 | - } |
|
145 | + if ( ! array_key_exists($key, $headers)) { |
|
146 | + if (null === $default) { |
|
147 | + return $option ? null : []; |
|
148 | + } |
|
149 | 149 | |
150 | - return $option ? $default : [$default]; |
|
151 | - } |
|
150 | + return $option ? $default : [$default]; |
|
151 | + } |
|
152 | 152 | |
153 | - if ($option) { |
|
154 | - return count($headers[$key]) ? $headers[$key][0] : $default; |
|
155 | - } |
|
153 | + if ($option) { |
|
154 | + return count($headers[$key]) ? $headers[$key][0] : $default; |
|
155 | + } |
|
156 | 156 | |
157 | - return $headers[$key]; |
|
158 | - } |
|
157 | + return $headers[$key]; |
|
158 | + } |
|
159 | 159 | |
160 | - /** |
|
161 | - * Sets a header by name. |
|
162 | - * |
|
163 | - * @param string $key The header name |
|
164 | - * @param string $values The value or an array of values |
|
165 | - * @param bool $replace If you want to replace the value exists by the header, |
|
166 | - * it is not overwritten / overwritten when it is false |
|
167 | - * |
|
168 | - * @return $this |
|
169 | - */ |
|
170 | - public function set($key, $values, $replace = true) |
|
171 | - { |
|
172 | - $key = str_replace('_', '-', strtolower($key)); |
|
160 | + /** |
|
161 | + * Sets a header by name. |
|
162 | + * |
|
163 | + * @param string $key The header name |
|
164 | + * @param string $values The value or an array of values |
|
165 | + * @param bool $replace If you want to replace the value exists by the header, |
|
166 | + * it is not overwritten / overwritten when it is false |
|
167 | + * |
|
168 | + * @return $this |
|
169 | + */ |
|
170 | + public function set($key, $values, $replace = true) |
|
171 | + { |
|
172 | + $key = str_replace('_', '-', strtolower($key)); |
|
173 | 173 | |
174 | - if (is_array($values)) { |
|
175 | - $values = array_values($values); |
|
174 | + if (is_array($values)) { |
|
175 | + $values = array_values($values); |
|
176 | 176 | |
177 | - if (true === $replace || ! isset($this->headers[$key])) { |
|
178 | - $this->headers[$key] = $values; |
|
179 | - } else { |
|
180 | - $this->headers[$key] = array_merge($this->headers[$key], $values); |
|
181 | - } |
|
182 | - } else { |
|
183 | - if (true === $replace || ! isset($this->headers[$key])) { |
|
184 | - $this->headers[$key] = [$values]; |
|
185 | - } else { |
|
186 | - $this->headers[$key][] = $values; |
|
187 | - } |
|
188 | - } |
|
177 | + if (true === $replace || ! isset($this->headers[$key])) { |
|
178 | + $this->headers[$key] = $values; |
|
179 | + } else { |
|
180 | + $this->headers[$key] = array_merge($this->headers[$key], $values); |
|
181 | + } |
|
182 | + } else { |
|
183 | + if (true === $replace || ! isset($this->headers[$key])) { |
|
184 | + $this->headers[$key] = [$values]; |
|
185 | + } else { |
|
186 | + $this->headers[$key][] = $values; |
|
187 | + } |
|
188 | + } |
|
189 | 189 | |
190 | - return $this; |
|
191 | - } |
|
190 | + return $this; |
|
191 | + } |
|
192 | 192 | |
193 | - /** |
|
194 | - * Returns true if the HTTP header is defined. |
|
195 | - * |
|
196 | - * @param string $key The HTTP header |
|
197 | - * |
|
198 | - * @return bool true if the parameter exists, false otherwise |
|
199 | - */ |
|
200 | - public function has($key) |
|
201 | - { |
|
202 | - return array_key_exists(str_replace('_', '-', strtolower($key)), $this->all()); |
|
203 | - } |
|
193 | + /** |
|
194 | + * Returns true if the HTTP header is defined. |
|
195 | + * |
|
196 | + * @param string $key The HTTP header |
|
197 | + * |
|
198 | + * @return bool true if the parameter exists, false otherwise |
|
199 | + */ |
|
200 | + public function has($key) |
|
201 | + { |
|
202 | + return array_key_exists(str_replace('_', '-', strtolower($key)), $this->all()); |
|
203 | + } |
|
204 | 204 | |
205 | - /** |
|
206 | - * Removes a header. |
|
207 | - * |
|
208 | - * @param string $name The header name |
|
209 | - * |
|
210 | - * @return mixed |
|
211 | - */ |
|
212 | - public function remove($key) |
|
213 | - { |
|
214 | - $key = str_replace('_', '-', strtolower($key)); |
|
205 | + /** |
|
206 | + * Removes a header. |
|
207 | + * |
|
208 | + * @param string $name The header name |
|
209 | + * |
|
210 | + * @return mixed |
|
211 | + */ |
|
212 | + public function remove($key) |
|
213 | + { |
|
214 | + $key = str_replace('_', '-', strtolower($key)); |
|
215 | 215 | |
216 | - unset($this->headers[$key]); |
|
216 | + unset($this->headers[$key]); |
|
217 | 217 | |
218 | - if ('cache-control' === $key) { |
|
219 | - $this->cacheControl = []; |
|
220 | - } |
|
221 | - } |
|
218 | + if ('cache-control' === $key) { |
|
219 | + $this->cacheControl = []; |
|
220 | + } |
|
221 | + } |
|
222 | 222 | |
223 | - /** |
|
224 | - * Returns an iterator for headers. |
|
225 | - * |
|
226 | - * @return \ArrayIterator An \ArrayIterator instance |
|
227 | - */ |
|
228 | - public function getIterator() |
|
229 | - { |
|
230 | - return new ArrayIterator($this->headers); |
|
231 | - } |
|
223 | + /** |
|
224 | + * Returns an iterator for headers. |
|
225 | + * |
|
226 | + * @return \ArrayIterator An \ArrayIterator instance |
|
227 | + */ |
|
228 | + public function getIterator() |
|
229 | + { |
|
230 | + return new ArrayIterator($this->headers); |
|
231 | + } |
|
232 | 232 | |
233 | - /** |
|
234 | - * Returns the number of headers. |
|
235 | - * |
|
236 | - * @return int The number of headers |
|
237 | - */ |
|
238 | - public function count() |
|
239 | - { |
|
240 | - return count($this->headers); |
|
241 | - } |
|
233 | + /** |
|
234 | + * Returns the number of headers. |
|
235 | + * |
|
236 | + * @return int The number of headers |
|
237 | + */ |
|
238 | + public function count() |
|
239 | + { |
|
240 | + return count($this->headers); |
|
241 | + } |
|
242 | 242 | |
243 | - /** |
|
244 | - * Returns the headers as a string. |
|
245 | - * |
|
246 | - * @return string The headers |
|
247 | - */ |
|
248 | - public function __toString() |
|
249 | - { |
|
250 | - if ( ! $headers = $this->all()) { |
|
251 | - return ''; |
|
252 | - } |
|
243 | + /** |
|
244 | + * Returns the headers as a string. |
|
245 | + * |
|
246 | + * @return string The headers |
|
247 | + */ |
|
248 | + public function __toString() |
|
249 | + { |
|
250 | + if ( ! $headers = $this->all()) { |
|
251 | + return ''; |
|
252 | + } |
|
253 | 253 | |
254 | - ksort($headers); |
|
255 | - $max = max(array_map('strlen', array_keys($headers))) + 1; |
|
256 | - $content = ''; |
|
254 | + ksort($headers); |
|
255 | + $max = max(array_map('strlen', array_keys($headers))) + 1; |
|
256 | + $content = ''; |
|
257 | 257 | |
258 | - foreach ($headers as $name => $values) { |
|
259 | - $name = ucwords($name, '-'); |
|
258 | + foreach ($headers as $name => $values) { |
|
259 | + $name = ucwords($name, '-'); |
|
260 | 260 | |
261 | - foreach ($values as $value) { |
|
262 | - $content .= sprintf("%-{$max}s %s\r\n", $name.':', $value); |
|
263 | - } |
|
264 | - } |
|
261 | + foreach ($values as $value) { |
|
262 | + $content .= sprintf("%-{$max}s %s\r\n", $name.':', $value); |
|
263 | + } |
|
264 | + } |
|
265 | 265 | |
266 | - return $content; |
|
267 | - } |
|
266 | + return $content; |
|
267 | + } |
|
268 | 268 | } |
269 | 269 | \ No newline at end of file |
@@ -62,11 +62,11 @@ |
||
62 | 62 | */ |
63 | 63 | protected $locale; |
64 | 64 | |
65 | - /** |
|
66 | - * Boolean value whether the intl libraries exist on the system. |
|
67 | - * |
|
68 | - * @var bool $intlSupport |
|
69 | - */ |
|
65 | + /** |
|
66 | + * Boolean value whether the intl libraries exist on the system. |
|
67 | + * |
|
68 | + * @var bool $intlSupport |
|
69 | + */ |
|
70 | 70 | protected $intlSupport = false; |
71 | 71 | |
72 | 72 | /** |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | protected function registerSessionManager() |
52 | 52 | { |
53 | - $this->app->singleton('session', function () { |
|
53 | + $this->app->singleton('session', function() { |
|
54 | 54 | return (new SessionManager($this->app))->driver(); |
55 | 55 | }); |
56 | 56 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | protected function registerSessionDriver() |
64 | 64 | { |
65 | - $this->app->singleton('session.store', function ($app) { |
|
65 | + $this->app->singleton('session.store', function($app) { |
|
66 | 66 | return $app->make('session')->driver(); |
67 | 67 | }); |
68 | 68 | } |
@@ -356,7 +356,7 @@ |
||
356 | 356 | */ |
357 | 357 | public function regenerate($destroy = false) |
358 | 358 | { |
359 | - return take($this->migrate($destroy), function () { |
|
359 | + return take($this->migrate($destroy), function() { |
|
360 | 360 | $this->regenerateToken(); |
361 | 361 | }); |
362 | 362 | } |
@@ -170,7 +170,7 @@ |
||
170 | 170 | } |
171 | 171 | } |
172 | 172 | |
173 | - throw new ViewException(__('view.notFound', ['file' => $name])); |
|
173 | + throw new ViewException(__('view.notFound', ['file' => $name])); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | /** |
@@ -182,7 +182,7 @@ |
||
182 | 182 | */ |
183 | 183 | protected function getFindViewFiles($name) |
184 | 184 | { |
185 | - return array_map(function ($extension) use ($name) { |
|
185 | + return array_map(function($extension) use ($name) { |
|
186 | 186 | return str_replace('.', DIRECTORY_SEPARATOR, $name).'.'.$extension; |
187 | 187 | }, $this->getExtensions()); |
188 | 188 | } |
@@ -97,7 +97,7 @@ |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | return $this->files->lastModified($path) >= |
100 | - $this->files->lastModified($compiled); |
|
100 | + $this->files->lastModified($compiled); |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 |
@@ -30,16 +30,16 @@ |
||
30 | 30 | */ |
31 | 31 | trait ManagesIncludes |
32 | 32 | { |
33 | - /** |
|
34 | - * Include another view in a view. |
|
35 | - * |
|
36 | - * @param string $file |
|
37 | - * @param array $data |
|
38 | - * |
|
39 | - * @return string |
|
40 | - */ |
|
41 | - public function include($file, $data = []) |
|
42 | - { |
|
43 | - return $this->make($file, $data)->render(); |
|
44 | - } |
|
33 | + /** |
|
34 | + * Include another view in a view. |
|
35 | + * |
|
36 | + * @param string $file |
|
37 | + * @param array $data |
|
38 | + * |
|
39 | + * @return string |
|
40 | + */ |
|
41 | + public function include($file, $data = []) |
|
42 | + { |
|
43 | + return $this->make($file, $data)->render(); |
|
44 | + } |
|
45 | 45 | } |
46 | 46 | \ No newline at end of file |
@@ -30,45 +30,45 @@ |
||
30 | 30 | */ |
31 | 31 | trait Extensions |
32 | 32 | { |
33 | - /** |
|
34 | - * The file extension. |
|
35 | - * |
|
36 | - * @var array $extension |
|
37 | - */ |
|
38 | - protected $extension = [ |
|
39 | - 'plaze.php', |
|
40 | - 'php', |
|
41 | - 'html', |
|
42 | - ]; |
|
33 | + /** |
|
34 | + * The file extension. |
|
35 | + * |
|
36 | + * @var array $extension |
|
37 | + */ |
|
38 | + protected $extension = [ |
|
39 | + 'plaze.php', |
|
40 | + 'php', |
|
41 | + 'html', |
|
42 | + ]; |
|
43 | 43 | |
44 | - /** |
|
45 | - * The type to engine bindings. |
|
46 | - * |
|
47 | - * @var array $extensions |
|
48 | - */ |
|
49 | - protected $extensions = [ |
|
50 | - 'plaze.php' => 'plaze', |
|
51 | - 'php' => 'php', |
|
52 | - 'html' => 'file', |
|
53 | - ]; |
|
44 | + /** |
|
45 | + * The type to engine bindings. |
|
46 | + * |
|
47 | + * @var array $extensions |
|
48 | + */ |
|
49 | + protected $extensions = [ |
|
50 | + 'plaze.php' => 'plaze', |
|
51 | + 'php' => 'php', |
|
52 | + 'html' => 'file', |
|
53 | + ]; |
|
54 | 54 | |
55 | - /** |
|
56 | - * Get the template file extension. |
|
57 | - * |
|
58 | - * @return array |
|
59 | - */ |
|
60 | - public function getExtensions() |
|
61 | - { |
|
62 | - return $this->extension; |
|
63 | - } |
|
55 | + /** |
|
56 | + * Get the template file extension. |
|
57 | + * |
|
58 | + * @return array |
|
59 | + */ |
|
60 | + public function getExtensions() |
|
61 | + { |
|
62 | + return $this->extension; |
|
63 | + } |
|
64 | 64 | |
65 | - /** |
|
66 | - * Get type to engine bindings. |
|
67 | - * |
|
68 | - * @return array |
|
69 | - */ |
|
70 | - public function getKeysToExtensions() |
|
71 | - { |
|
72 | - return array_keys($this->extensions); |
|
73 | - } |
|
65 | + /** |
|
66 | + * Get type to engine bindings. |
|
67 | + * |
|
68 | + * @return array |
|
69 | + */ |
|
70 | + public function getKeysToExtensions() |
|
71 | + { |
|
72 | + return array_keys($this->extensions); |
|
73 | + } |
|
74 | 74 | } |
75 | 75 | \ No newline at end of file |