Przeglądaj źródła

chore: apply StyleCI recommendation

El RIDO 1 tydzień temu
rodzic
commit
68d7f14839
4 zmienionych plików z 23 dodań i 23 usunięć
  1. 14 14
      lib/Configuration.php
  2. 2 2
      lib/FormatV2.php
  3. 2 2
      lib/Request.php
  4. 5 5
      tst/ControllerTest.php

+ 14 - 14
lib/Configuration.php

@@ -35,21 +35,21 @@ class Configuration
      */
     private static $_defaults = [
         'main' => [
-            'name'                     => 'PrivateBin',
-            'basepath'                 => '',
-            'discussion'               => true,
-            'opendiscussion'           => false,
-            'discussiondatedisplay'    => true,
+            'name'                                  => 'PrivateBin',
+            'basepath'                              => '',
+            'discussion'                            => true,
+            'opendiscussion'                        => false,
+            'discussiondatedisplay'                 => true,
             'discussionrequireauthenticatedids'     => false,
-            'password'                 => true,
-            'fileupload'               => false,
-            'burnafterreadingselected' => false,
-            'defaultformatter'         => 'plaintext',
-            'syntaxhighlightingtheme'  => '',
-            'sizelimit'                => 10485760,
-            'templateselection'        => false,
-            'template'                 => 'bootstrap5',
-            'availabletemplates'       => [
+            'password'                              => true,
+            'fileupload'                            => false,
+            'burnafterreadingselected'              => false,
+            'defaultformatter'                      => 'plaintext',
+            'syntaxhighlightingtheme'               => '',
+            'sizelimit'                             => 10485760,
+            'templateselection'                     => false,
+            'template'                              => 'bootstrap5',
+            'availabletemplates'                    => [
                 'bootstrap5',
             ],
             'info'                     => 'More information on the <a href=\'https://privatebin.info/\'>project page</a>.',

+ 2 - 2
lib/FormatV2.php

@@ -79,8 +79,8 @@ class FormatV2
             )) {
                 return false;
             }
-        // For pastes: adata must have exactly 4 entries,
-        // and meta must contain only the 'expire' key.
+            // For pastes: adata must have exactly 4 entries,
+            // and meta must contain only the 'expire' key.
         } elseif ($adataLength !== 4 ||
             !is_array($message['meta']) ||
             count($message['meta']) !== 1 ||

+ 2 - 2
lib/Request.php

@@ -12,8 +12,8 @@
 namespace PrivateBin;
 
 use JsonException;
-use PrivateBin\Model\Paste;
 use PrivateBin\Exception\TranslatedException;
+use PrivateBin\Model\Paste;
 
 /**
  * Request
@@ -216,7 +216,7 @@ class Request
         if ($this->_bodyLength > $sizelimit) {
             throw new TranslatedException([
                 'Document is limited to %s of encrypted data.',
-                Filter::formatHumanReadableSize($sizelimit)
+                Filter::formatHumanReadableSize($sizelimit),
             ]);
         }
         $data = [

+ 5 - 5
tst/ControllerTest.php

@@ -278,19 +278,19 @@ class ControllerTest extends TestCase
      */
     public function testCreateOverSize()
     {
-        $options                      = parse_ini_file(CONF, true);
+        $options = parse_ini_file(CONF, true);
         $options['main']['sizelimit'] = 1000;
-        $options['traffic']['limit']  = 0;
+        $options['traffic']['limit'] = 0;
         Helper::createIniFile(CONF, $options);
         $paste = Helper::getPastePost();
         // add some extra authenticated data, could be a hypothetical future cryptographic hash, exceeding the sizelimit
         $paste['adata'][] = str_repeat('0', $options['main']['sizelimit']);
-        $file  = Helper::createTempFile();
+        $file = Helper::createTempFile();
         file_put_contents($file, json_encode($paste));
         Request::setInputStream($file);
         $_SERVER['HTTP_X_REQUESTED_WITH'] = 'JSONHttpRequest';
-        $_SERVER['REQUEST_METHOD']        = 'POST';
-        $_SERVER['REMOTE_ADDR']           = '::1';
+        $_SERVER['REQUEST_METHOD'] = 'POST';
+        $_SERVER['REMOTE_ADDR'] = '::1';
         ob_start();
         new Controller;
         $content = ob_get_contents();