From de021710e1c0dae732e61ecb42a9ac60440f55ee Mon Sep 17 00:00:00 2001 From: "godzilla80@gmx.net" <> Date: Thu, 19 Mar 2009 21:20:47 +0000 Subject: replace is_null() function calls with native native language constuct --- framework/I18N/TDateFormat.php | 4 ++-- framework/I18N/TGlobalization.php | 4 ++-- framework/I18N/TI18NControl.php | 6 +++--- framework/I18N/TNumberFormat.php | 2 +- framework/I18N/TTranslate.php | 4 ++-- framework/I18N/core/MessageSource_MySQL.php | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) (limited to 'framework/I18N') diff --git a/framework/I18N/TDateFormat.php b/framework/I18N/TDateFormat.php index 914131bd..2a4ef8bc 100644 --- a/framework/I18N/TDateFormat.php +++ b/framework/I18N/TDateFormat.php @@ -119,7 +119,7 @@ class TDateFormat extends TI18NControl implements IDataRenderer //no presets found, use the string as the pattern //and let the DateFormat handle it. - if(is_null($pattern)) + if($pattern===null) $pattern = $string; if (!is_array($pattern) && strlen($pattern) == 0) $pattern = null; @@ -226,7 +226,7 @@ class TDateFormat extends TI18NControl implements IDataRenderer $app = $this->getApplication()->getGlobalization(); //initialized the default class wide formatter - if(is_null(self::$formatter)) + if(self::$formatter===null) self::$formatter = new DateFormat($app->getCulture()); $culture = $this->getCulture(); diff --git a/framework/I18N/TGlobalization.php b/framework/I18N/TGlobalization.php index 1d158ce9..fd16f7bd 100644 --- a/framework/I18N/TGlobalization.php +++ b/framework/I18N/TGlobalization.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2008 PradoSoft + * @copyright Copyright © 2005-2008 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.I18N @@ -225,7 +225,7 @@ class TGlobalization extends TModule */ public function getCultureVariants($culture=null) { - if(is_null($culture)) $culture = $this->getCulture(); + if($culture===null) $culture = $this->getCulture(); $variants = explode('_', $culture); $result = array(); for(; count($variants) > 0; array_pop($variants)) diff --git a/framework/I18N/TI18NControl.php b/framework/I18N/TI18NControl.php index ac3246fe..c04477e0 100644 --- a/framework/I18N/TI18NControl.php +++ b/framework/I18N/TI18NControl.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2008 PradoSoft + * @copyright Copyright © 2005-2008 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.I18N @@ -49,11 +49,11 @@ class TI18NControl extends TControl //fall back to globalization charset if(empty($charset)) - $charset = is_null($app) ? '' : $app->getCharset(); + $charset = ($app===null) ? '' : $app->getCharset(); //fall back to default charset if(empty($charset)) - $charset = (is_null($app)) ? 'UTF-8' : $app->getDefaultCharset(); + $charset = ($app===null) ? 'UTF-8' : $app->getDefaultCharset(); return $charset; } diff --git a/framework/I18N/TNumberFormat.php b/framework/I18N/TNumberFormat.php index 62b43243..1f33e6e4 100644 --- a/framework/I18N/TNumberFormat.php +++ b/framework/I18N/TNumberFormat.php @@ -220,7 +220,7 @@ class TNumberFormat extends TI18NControl implements IDataRenderer $app = $this->getApplication()->getGlobalization(); //initialized the default class wide formatter - if(is_null(self::$formatter)) + if(self::$formatter===null) self::$formatter = new NumberFormat($app->getCulture()); $pattern = strlen($this->getPattern()) > 0 diff --git a/framework/I18N/TTranslate.php b/framework/I18N/TTranslate.php index 2f1e0633..a444aeba 100644 --- a/framework/I18N/TTranslate.php +++ b/framework/I18N/TTranslate.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2008 PradoSoft + * @copyright Copyright © 2005-2008 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.I18N @@ -236,7 +236,7 @@ class TTranslate extends TI18NControl $app = $this->getApplication()->getGlobalization(); //no translation handler provided - if(is_null($config = $app->getTranslationConfiguration())) + if(($config = $app->getTranslationConfiguration())===null) return strtr($text, $subs); $catalogue = $this->getCatalogue(); diff --git a/framework/I18N/core/MessageSource_MySQL.php b/framework/I18N/core/MessageSource_MySQL.php index 317d53e2..080b89bc 100644 --- a/framework/I18N/core/MessageSource_MySQL.php +++ b/framework/I18N/core/MessageSource_MySQL.php @@ -87,7 +87,7 @@ class MessageSource_MySQL extends MessageSource { /*static $conn; - if(!is_null($conn)) + if($conn!==null) return $conn; */ $dsninfo = $this->dns; -- cgit v1.2.3