From 8e11f0873c39ee7d6c5683b48bf8233d08c2c579 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Tue, 5 Jul 2016 17:23:25 +0200 Subject: [PATCH] small code style improvements, trying to get phpunit with hhvm to work in travis --- composer.json | 1 + css/prettify/doxy.css | 2 +- js/zerobin.js | 8 ++++---- tst/zerobin.php | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 9f8a3bc..88b58b3 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,6 @@ { "require-dev": { + "phpunit/phpunit": "5.4.*", "codacy/coverage": "dev-master" } } diff --git a/css/prettify/doxy.css b/css/prettify/doxy.css index 6bb7235..db25293 100644 --- a/css/prettify/doxy.css +++ b/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}} \ No newline at end of file +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}} diff --git a/js/zerobin.js b/js/zerobin.js index 0642253..23c7688 100644 --- a/js/zerobin.js +++ b/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); } }, diff --git a/tst/zerobin.php b/tst/zerobin.php index d35d12b..01f49f2 100644 --- a/tst/zerobin.php +++ b/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'); } -} \ No newline at end of file +}