1212
1313use Bluz \Common \Exception \ComponentException ;
1414use Bluz \Http \RequestMethod ;
15- use Bluz \Request \RequestFactory ;
1615use Psr \Http \Message \UriInterface ;
1716use Zend \Diactoros \ServerRequest as Instance ;
1817
@@ -50,12 +49,12 @@ final class Request
5049 /**
5150 * @var array|null Accepted type
5251 */
53- static private $ accept ;
52+ private static $ accept ;
5453
5554 /**
5655 * @var array|null Accepted languages
5756 */
58- static private $ language ;
57+ private static $ language ;
5958
6059 /**
6160 * Init instance
@@ -75,7 +74,7 @@ private static function initInstance()
7574 * @param string $key
7675 * @param string $default Default value to use if key not found
7776 *
78- * @return string Returns null if key does not exist
77+ * @return string|array|null Returns null if key does not exist
7978 */
8079 public static function getQuery ($ key = null , $ default = null )
8180 {
@@ -90,7 +89,7 @@ public static function getQuery($key = null, $default = null)
9089 * @param string $key
9190 * @param string $default Default value to use if key not found
9291 *
93- * @return string Returns null if key does not exist
92+ * @return string|array|null Returns null if key does not exist
9493 */
9594 public static function getPost ($ key = null , $ default = null )
9695 {
@@ -169,7 +168,7 @@ public static function getHeader($header, $default = null)
169168 * @param string $key
170169 * @param null $default
171170 *
172- * @return string|null
171+ * @return string|array| null
173172 * @link http://msdn.microsoft.com/en-us/library/system.web.httprequest.item.aspx
174173 */
175174 public static function getParam ($ key , $ default = null )
@@ -185,11 +184,11 @@ public static function getParam($key, $default = null)
185184 *
186185 * @return array
187186 */
188- public static function getParams ()
187+ public static function getParams (): array
189188 {
190189 $ body = (array )self ::getInstance ()->getParsedBody ();
191190 $ query = (array )self ::getInstance ()->getQueryParams ();
192- return array_merge ($ body , $ query );
191+ return array_merge ([], $ body , $ query );
193192 }
194193
195194 /**
@@ -303,7 +302,7 @@ private static function parseAcceptHeader($header): array
303302 // the default quality is 1.
304303 $ q = 1 ;
305304 // check if there is a different quality
306- if (strpos ($ a , ';q= ' ) or strpos ($ a , '; q= ' )) {
305+ if (strpos ($ a , ';q= ' ) || strpos ($ a , '; q= ' )) {
307306 // divide "mime/type;q=X" into two parts: "mime/type" i "X"
308307 [$ a , $ q ] = preg_split ('/;([ ]?)q=/ ' , $ a );
309308 }
0 commit comments