Browse Source

apply StyleCI recommendation

El RIDO 1 tuần trước cách đây
mục cha
commit
c501d36b04
3 tập tin đã thay đổi với 6 bổ sung6 xóa
  1. 1 1
      lib/Request.php
  2. 4 4
      tst/FormatV2Test.php
  3. 1 1
      tst/RequestTest.php

+ 1 - 1
lib/Request.php

@@ -116,7 +116,7 @@ class Request
                     // a valid JSON scalar (number, bool or string) decodes
                     // without error, but is not a usable set of parameters
                     if (!is_array($this->_params)) {
-                        $this->_params = array();
+                        $this->_params = [];
                     }
                 } catch (JsonException $e) {
                     // ignore error, $this->_params will remain empty

+ 4 - 4
tst/FormatV2Test.php

@@ -82,11 +82,11 @@ class FormatV2Test extends TestCase
         $this->assertFalse(FormatV2::isValid($paste), 'non-numeric version');
 
         $paste          = Helper::getPastePost();
-        $paste['v']     = array();
+        $paste['v']     = [];
         $this->assertFalse(FormatV2::isValid($paste), 'array version');
 
         $paste          = Helper::getPastePost();
-        $paste['ct']    = array('not', 'a', 'string');
+        $paste['ct']    = ['not', 'a', 'string'];
         $this->assertFalse(FormatV2::isValid($paste), 'non-string ciphertext');
 
         $paste          = Helper::getPastePost();
@@ -98,11 +98,11 @@ class FormatV2Test extends TestCase
         $this->assertFalse(FormatV2::isValid($paste), 'non-array cipher parameters');
 
         $paste             = Helper::getPastePost();
-        $paste['adata'][0] = array();
+        $paste['adata'][0] = [];
         $this->assertFalse(FormatV2::isValid($paste), 'empty cipher parameters');
 
         $paste                = Helper::getPastePost();
-        $paste['adata'][0][0] = array();
+        $paste['adata'][0][0] = [];
         $this->assertFalse(FormatV2::isValid($paste), 'non-string iv');
 
         $comment           = Helper::getCommentPost();

+ 1 - 1
tst/RequestTest.php

@@ -163,7 +163,7 @@ class RequestTest extends TestCase
         // a valid JSON scalar body (number, boolean or quoted string) must not
         // be treated as a set of parameters, so that it is rejected cleanly
         // instead of triggering a type error further down
-        foreach (array('1', '0.0', 'true', 'false', '"example"') as $scalar) {
+        foreach (['1', '0.0', 'true', 'false', '"example"'] as $scalar) {
             $this->reset();
             $_SERVER['REQUEST_METHOD']        = 'POST';
             $_SERVER['HTTP_X_REQUESTED_WITH'] = 'JSONHttpRequest';