瀏覽代碼

small code style improvements, trying to get phpunit with hhvm to work in travis

El RIDO 10 年之前
父節點
當前提交
8e11f0873c
共有 4 個文件被更改,包括 8 次插入7 次删除
  1. 1 0
      composer.json
  2. 1 1
      css/prettify/doxy.css
  3. 4 4
      js/zerobin.js
  4. 2 2
      tst/zerobin.php

+ 1 - 0
composer.json

@@ -1,5 +1,6 @@
 {
     "require-dev": {
+        "phpunit/phpunit": "5.4.*",
         "codacy/coverage": "dev-master"
     }
 }

+ 1 - 1
css/prettify/doxy.css

@@ -1 +1 @@
-pre .str,code .str{color:#fec243}pre .kwd,code .kwd{color:#8470ff}pre .com,code .com{color:#32cd32;font-style:italic}pre .typ,code .typ{color:#6ecbcc}pre .lit,code .lit{color:#d06}pre .pun,code .pun{color:#8b8970}pre .pln,code .pln{color:#f0f0f0}pre .tag,code .tag{color:#9c9cff}pre .htm,code .htm{color:#dda0dd}pre .xsl,code .xsl{color:#d0a0d0}pre .atn,code .atn{color:#46eeee;font-weight:normal}pre .atv,code .atv{color:#eeb4b4}pre .dec,code .dec{color:#3387cc}a{text-decoration:none}pre.prettyprint,code.prettyprint{font-family:'Droid Sans Mono','CPMono_v07 Bold','Droid Sans';font-weight:bold;font-size:9pt;background-color:#0f0f0f;-moz-border-radius:8px;-webkit-border-radius:8px;-o-border-radius:8px;-ms-border-radius:8px;-khtml-border-radius:8px;border-radius:8px}pre.prettyprint{width:95%;margin:1em auto;padding:1em;white-space:pre-wrap}pre.prettyprint a,code.prettyprint a{text-decoration:none}ol.linenums{margin-top:0;margin-bottom:0;color:#8b8970}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}@media print{pre.prettyprint,code.prettyprint{background-color:#fff}pre .str,code .str{color:#088}pre .kwd,code .kwd{color:#006;font-weight:bold}pre .com,code .com{color:#oc3;font-style:italic}pre .typ,code .typ{color:#404;font-weight:bold}pre .lit,code .lit{color:#044}pre .pun,code .pun{color:#440}pre .pln,code .pln{color:#000}pre .tag,code .tag{color:#b66ff7;font-weight:bold}pre .htm,code .htm{color:#606;font-weight:bold}pre .xsl,code .xsl{color:#606;font-weight:bold}pre .atn,code .atn{color:#c71585;font-weight:normal}pre .atv,code .atv{color:#088;font-weight:normal}}
+pre .str,code .str{color:#fec243}pre .kwd,code .kwd{color:#8470ff}pre .com,code .com{color:#32cd32;font-style:italic}pre .typ,code .typ{color:#6ecbcc}pre .lit,code .lit{color:#d06}pre .pun,code .pun{color:#8b8970}pre .pln,code .pln{color:#f0f0f0}pre .tag,code .tag{color:#9c9cff}pre .htm,code .htm{color:#dda0dd}pre .xsl,code .xsl{color:#d0a0d0}pre .atn,code .atn{color:#46eeee;font-weight:normal}pre .atv,code .atv{color:#eeb4b4}pre .dec,code .dec{color:#3387cc}a{text-decoration:none}pre.prettyprint,code.prettyprint{font-family:'Droid Sans Mono','CPMono_v07 Bold','Droid Sans';font-weight:bold;font-size:9pt;background-color:#0f0f0f;-moz-border-radius:8px;-webkit-border-radius:8px;-o-border-radius:8px;-ms-border-radius:8px;-khtml-border-radius:8px;border-radius:8px}pre.prettyprint{width:95%;margin:1em auto;padding:1em;white-space:pre-wrap}pre.prettyprint a,code.prettyprint a{text-decoration:none}ol.linenums{margin-top:0;margin-bottom:0;color:#8b8970}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}@media print{pre.prettyprint,code.prettyprint{background-color:#fff}pre .str,code .str{color:#088}pre .kwd,code .kwd{color:#006;font-weight:bold}pre .com,code .com{color:#0c3;font-style:italic}pre .typ,code .typ{color:#404;font-weight:bold}pre .lit,code .lit{color:#044}pre .pun,code .pun{color:#440}pre .pln,code .pln{color:#000}pre .tag,code .tag{color:#b66ff7;font-weight:bold}pre .htm,code .htm{color:#606;font-weight:bold}pre .xsl,code .xsl{color:#606;font-weight:bold}pre .atn,code .atn{color:#c71585;font-weight:normal}pre .atv,code .atv{color:#088;font-weight:normal}}

+ 4 - 4
js/zerobin.js

@@ -328,10 +328,10 @@ $(function() {
             {
                 messageId = args[0];
             }
-            if (messageId.length == 0) return messageId;
+            if (messageId.length === 0) return messageId;
             if (!this.translations.hasOwnProperty(messageId))
             {
-                if (this.language != 'en') console.debug(
+                if (this.language !== 'en') console.debug(
                     'Missing translation for: ' + messageId
                 );
                 this.translations[messageId] = args[0];
@@ -366,10 +366,10 @@ $(function() {
                 case 'zh':
                     return (n > 1 ? 1 : 0);
                 case 'pl':
-                    return (n == 1 ? 0 : n%10 >= 2 && n %10 <=4 && (n%100 < 10 || n%100 >= 20) ? 1 : 2);
+                    return (n === 1 ? 0 : n%10 >= 2 && n %10 <=4 && (n%100 < 10 || n%100 >= 20) ? 1 : 2);
                 // en, de
                 default:
-                    return (n != 1 ? 1 : 0);
+                    return (n !== 1 ? 1 : 0);
             }
         },
 

+ 2 - 2
tst/zerobin.php

@@ -145,7 +145,7 @@ class zerobinTest extends PHPUnit_Framework_TestCase
         file_put_contents(CONF, '');
         ob_start();
         new zerobin;
-        $content = ob_get_contents();
+        ob_get_contents();
     }
 
     /**
@@ -944,4 +944,4 @@ class zerobinTest extends PHPUnit_Framework_TestCase
         );
         $this->assertFalse($this->_model->exists(helper::getPasteId()), 'paste successfully deleted');
     }
-}
+}