From 5230f8f8a86fc1ae5d90f8c74ae65c93e197502b Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Thu, 22 Jan 2015 09:14:12 +0100 Subject: Apply namespaces to class inheritances (pt1) --- framework/IO/ITextWriter.php | 34 ++++++++++++++++++++++++++++++++++ framework/IO/TTarFileExtractor.php | 2 +- framework/IO/TTextWriter.php | 2 +- 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 framework/IO/ITextWriter.php (limited to 'framework/IO') diff --git a/framework/IO/ITextWriter.php b/framework/IO/ITextWriter.php new file mode 100644 index 00000000..d22e5cfe --- /dev/null +++ b/framework/IO/ITextWriter.php @@ -0,0 +1,34 @@ + + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005-2014 PradoSoft + * @license http://www.pradosoft.com/license/ + * @package Prado\IO + */ + +namespace Prado\IO; + +/** + * ITextWriter interface. + * + * This interface must be implemented by writers. + * + * @author Qiang Xue + * @package Prado\IO + * @since 3.0 + */ +interface ITextWriter +{ + /** + * Writes a string. + * @param string string to be written + */ + public function write($str); + /** + * Flushes the content that has been written. + */ + public function flush(); +} \ No newline at end of file diff --git a/framework/IO/TTarFileExtractor.php b/framework/IO/TTarFileExtractor.php index e8eee004..672ea59b 100644 --- a/framework/IO/TTarFileExtractor.php +++ b/framework/IO/TTarFileExtractor.php @@ -126,7 +126,7 @@ class TTarFileExtractor protected function _error($p_message) { - throw new Exception($p_message); + throw new \Exception($p_message); } private function _isArchive($p_filename=null) diff --git a/framework/IO/TTextWriter.php b/framework/IO/TTextWriter.php index d9033b81..c47bc410 100644 --- a/framework/IO/TTextWriter.php +++ b/framework/IO/TTextWriter.php @@ -22,7 +22,7 @@ namespace Prado\IO; * @package Prado\IO * @since 3.0 */ -class TTextWriter extends TComponent implements ITextWriter +class TTextWriter extends \Prado\TComponent implements \Prado\IO\ITextWriter { private $_str=''; -- cgit v1.2.3