From 6c345acc1dc12c225faa82d59d3f8f12fe634607 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 23 May 2015 18:23:40 -0500 Subject: [PATCH] ANSI: PHP5 updates --- phpseclib/File/ANSI.php | 10 +++++----- tests/Unit/File/ANSITest.php | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/phpseclib/File/ANSI.php b/phpseclib/File/ANSI.php index 24e4bfbb..e0cde401 100644 --- a/phpseclib/File/ANSI.php +++ b/phpseclib/File/ANSI.php @@ -172,8 +172,8 @@ class ANSI $attr_cell->background = 'black'; $attr_cell->foreground = 'white'; $attr_cell->reverse = false; - $this->base_attr_cell = clone($attr_cell); - $this->attr_cell = clone($attr_cell); + $this->base_attr_cell = clone $attr_cell; + $this->attr_cell = clone $attr_cell; $this->setHistory(200); $this->setDimensions(80, 24); @@ -314,7 +314,7 @@ class ANSI foreach ($mods as $mod) { switch ($mod) { case 0: // Turn off character attributes - $attr_cell = clone($this->base_attr_cell); + $attr_cell = clone $this->base_attr_cell; break; case 1: // Turn bold mode on $attr_cell->bold = true; @@ -382,7 +382,7 @@ class ANSI case "\x08": // backspace if ($this->x) { $this->x--; - $this->attrs[$this->y][$this->x] = clone($this->base_attr_cell); + $this->attrs[$this->y][$this->x] = clone $this->base_attr_cell; $this->screen[$this->y] = substr_replace( $this->screen[$this->y], $source[$i], @@ -401,7 +401,7 @@ class ANSI $this->ansi.= "\x1B"; break; default: - $this->attrs[$this->y][$this->x] = clone($this->attr_cell); + $this->attrs[$this->y][$this->x] = clone $this->attr_cell; if ($this->x > strlen($this->screen[$this->y])) { $this->screen[$this->y] = str_repeat(' ', $this->x); } diff --git a/tests/Unit/File/ANSITest.php b/tests/Unit/File/ANSITest.php index dbb67af0..373504d1 100644 --- a/tests/Unit/File/ANSITest.php +++ b/tests/Unit/File/ANSITest.php @@ -5,7 +5,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -require_once 'File/ANSI.php'; +use phpseclib\File\ANSI; class Unit_File_ANSITest extends PhpseclibTestCase { @@ -17,7 +17,7 @@ class Unit_File_ANSITest extends PhpseclibTestCase $str.= "\x1B[m"; // reset everything $str.= "bbb"; - $ansi = new File_ANSI(); + $ansi = new ANSI(); $ansi->appendString($str); $expected = '
';