1
0
Эх сурвалжийг харах

removing some unused code detected by codacy

El RIDO 10 жил өмнө
parent
commit
5980f8b603

+ 0 - 10
lib/zerobin.php

@@ -55,14 +55,6 @@ class zerobin
      */
     private $_doesExpire = false;
 
-    /**
-     * formatter
-     *
-     * @access private
-     * @var    string
-     */
-    private $_formatter = 'plaintext';
-
     /**
      * error message
      *
@@ -219,8 +211,6 @@ class zerobin
      */
     private function _create()
     {
-        $error = false;
-
         // Ensure last paste from visitors IP address was more than configured amount of seconds ago.
         trafficlimiter::setConfiguration($this->_conf);
         if (!trafficlimiter::canPass()) return $this->_return_message(

+ 1 - 1
tst/configuration.php

@@ -90,7 +90,7 @@ class configurationTest extends PHPUnit_Framework_TestCase
     public function testHandleBlankConfigFile()
     {
         file_put_contents(CONF, '');
-        $conf = new configuration;
+        new configuration;
     }
 
     public function testHandleMinimalConfigFile()

+ 1 - 1
tst/model.php

@@ -175,7 +175,7 @@ class modelTest extends PHPUnit_Framework_TestCase
     public function testInvalidComment()
     {
         $paste = $this->_model->getPaste();
-        $comment = $paste->getComment(helper::getPasteId());
+        $paste->getComment(helper::getPasteId());
     }
 
     public function testExpiration()

+ 0 - 2
tst/request.php

@@ -1,8 +1,6 @@
 <?php
 class requestTest extends PHPUnit_Framework_TestCase
 {
-    private $_request;
-
     public function setUp()
     {
         /* Setup Routine */

+ 1 - 1
tst/serversalt.php

@@ -43,7 +43,7 @@ class serversaltTest extends PHPUnit_Framework_TestCase
             function mcrypt_create_iv($int, $flag)
             {
                 $randomSalt = '';
-                for($i = 0; $i < 256; ++$i) {
+                for($i = 0; $i < $int; ++$i) {
                     $randomSalt .= base_convert(mt_rand(), 10, 16);
                 }
                 // hex2bin requires an even length, pad if necessary

+ 0 - 2
tst/vizhash16x16.php

@@ -1,8 +1,6 @@
 <?php
 class vizhash16x16Test extends PHPUnit_Framework_TestCase
 {
-    private $_dataDirCreated;
-
     private $_file;
 
     private $_path;

+ 0 - 2
tst/zerobin.php

@@ -124,9 +124,7 @@ class zerobinTest extends PHPUnit_Framework_TestCase
             $file = PATH . $dir . DIRECTORY_SEPARATOR . '.htaccess';
             @unlink($file);
         }
-        ob_start();
         new zerobin;
-        $content = ob_get_contents();
         foreach ($dirs as $dir) {
             $file = PATH . $dir . DIRECTORY_SEPARATOR . '.htaccess';
             $this->assertFileExists(