From 9005bd1c365c9a987bcf254fc1222cc4875d39b9 Mon Sep 17 00:00:00 2001 From: Nikolai Plath Date: Mon, 29 Aug 2011 06:42:10 -0500 Subject: [PATCH] Removing unnecessary empty braces when instancing classes --- libraries/joomla/access/access.php | 2 +- libraries/joomla/access/rules.php | 2 +- libraries/joomla/application/application.php | 6 ++--- libraries/joomla/application/categories.php | 4 +-- libraries/joomla/application/cli.php | 10 +++---- libraries/joomla/application/cli/daemon.php | 6 ++--- .../application/component/controller.php | 2 +- .../joomla/application/component/helper.php | 6 ++--- .../joomla/application/component/model.php | 2 +- .../application/component/modeladmin.php | 2 +- libraries/joomla/application/helper.php | 2 +- libraries/joomla/application/menu.php | 4 +-- .../joomla/application/module/helper.php | 6 ++--- libraries/joomla/application/pathway.php | 2 +- libraries/joomla/cache/cache.php | 4 +-- libraries/joomla/cache/controller.php | 4 +-- .../joomla/cache/controller/callback.php | 2 +- libraries/joomla/cache/controller/output.php | 2 +- libraries/joomla/cache/controller/page.php | 2 +- libraries/joomla/cache/controller/view.php | 2 +- libraries/joomla/cache/storage/apc.php | 2 +- .../joomla/cache/storage/eaccelerator.php | 2 +- libraries/joomla/cache/storage/file.php | 2 +- libraries/joomla/cache/storage/memcache.php | 10 +++---- libraries/joomla/client/http.php | 2 +- libraries/joomla/database/database/mysql.php | 4 +-- .../database/database/mysqlexporter.php | 2 +- libraries/joomla/database/database/mysqli.php | 4 +-- .../database/database/mysqlimporter.php | 2 +- libraries/joomla/database/database/sqlsrv.php | 4 +-- libraries/joomla/database/table/category.php | 4 +-- libraries/joomla/database/table/content.php | 4 +-- libraries/joomla/database/table/extension.php | 4 +-- libraries/joomla/database/table/menu.php | 2 +- libraries/joomla/database/table/module.php | 2 +- libraries/joomla/database/table/update.php | 4 +-- libraries/joomla/database/table/user.php | 2 +- libraries/joomla/database/tablenested.php | 2 +- libraries/joomla/event/dispatcher.php | 2 +- libraries/joomla/filesystem/archive.php | 2 +- libraries/joomla/form/fields/helpsite.php | 2 +- libraries/joomla/form/form.php | 6 ++--- libraries/joomla/form/helper.php | 2 +- .../joomla/installer/adapters/component.php | 2 +- .../joomla/installer/adapters/language.php | 2 +- .../joomla/installer/adapters/library.php | 4 +-- .../joomla/installer/adapters/package.php | 4 +-- .../joomla/installer/adapters/plugin.php | 2 +- .../joomla/installer/adapters/template.php | 2 +- libraries/joomla/installer/helper.php | 2 +- libraries/joomla/installer/installer.php | 2 +- libraries/joomla/language/help.php | 2 +- libraries/joomla/language/language.php | 2 +- libraries/joomla/log/log.php | 6 ++--- .../joomla/log/loggers/formattedtext.php | 4 +-- libraries/joomla/mail/mail.php | 2 +- libraries/joomla/plugin/plugin.php | 2 +- libraries/joomla/registry/format.php | 2 +- libraries/joomla/registry/format/ini.php | 6 ++--- libraries/joomla/registry/format/xml.php | 4 +-- libraries/joomla/registry/registry.php | 26 +++++++++---------- 61 files changed, 110 insertions(+), 110 deletions(-) diff --git a/libraries/joomla/access/access.php b/libraries/joomla/access/access.php index eab8cd9bf6..6f36182a1d 100644 --- a/libraries/joomla/access/access.php +++ b/libraries/joomla/access/access.php @@ -215,7 +215,7 @@ public static function getAssetRules($asset, $recursive = false) } // Instantiate and return the JRules object for the asset rules. - $rules = new JRules(); + $rules = new JRules; $rules->mergeCollection($result); return $rules; diff --git a/libraries/joomla/access/rules.php b/libraries/joomla/access/rules.php index 25b7464353..12a6d8e73a 100644 --- a/libraries/joomla/access/rules.php +++ b/libraries/joomla/access/rules.php @@ -189,7 +189,7 @@ public function allow($action, $identity) function getAllowed($identity) { // Sweep for the allowed actions. - $allowed = new JObject(); + $allowed = new JObject; foreach ($this->data as $name => &$action) { if ($action->allow($identity)) diff --git a/libraries/joomla/application/application.php b/libraries/joomla/application/application.php index e2a2a72980..f5e6a1fdfd 100644 --- a/libraries/joomla/application/application.php +++ b/libraries/joomla/application/application.php @@ -115,7 +115,7 @@ public function __construct($config = array()) // Create the input object if (class_exists('JInput')) { - $this->input = new JInput(); + $this->input = new JInput; } // Set the session default name. @@ -984,7 +984,7 @@ protected function _createConfiguration($file) include_once $file; // Create the JConfig object. - $config = new JConfig(); + $config = new JConfig; // Get the global configuration object. $registry = JFactory::getConfig(); @@ -1115,7 +1115,7 @@ public function checkSession() if ($session->isNew()) { $session->set('registry', new JRegistry('session')); - $session->set('user', new JUser()); + $session->set('user', new JUser); } } } diff --git a/libraries/joomla/application/categories.php b/libraries/joomla/application/categories.php index 4c82fa3ab7..8148c3ac95 100644 --- a/libraries/joomla/application/categories.php +++ b/libraries/joomla/application/categories.php @@ -883,7 +883,7 @@ function getParams() { if (!($this->params instanceof JRegistry)) { - $temp = new JRegistry(); + $temp = new JRegistry; $temp->loadString($this->params); $this->params = $temp; } @@ -902,7 +902,7 @@ function getMetadata() { if (!($this->metadata instanceof JRegistry)) { - $temp = new JRegistry(); + $temp = new JRegistry; $temp->loadString($this->metadata); $this->metadata = $temp; } diff --git a/libraries/joomla/application/cli.php b/libraries/joomla/application/cli.php index 0de5adfae9..8650293322 100644 --- a/libraries/joomla/application/cli.php +++ b/libraries/joomla/application/cli.php @@ -66,11 +66,11 @@ protected function __construct() // Get the command line options if (class_exists('JInput')) { - $this->input = new JInputCli(); + $this->input = new JInputCli; } // Create the registry with a default namespace of config - $this->config = new JRegistry(); + $this->config = new JRegistry; // Load the configuration object. $this->loadConfiguration($this->fetchConfigurationData()); @@ -102,11 +102,11 @@ public static function &getInstance($name = null) { if (class_exists($name) && (is_subclass_of($name, 'JCli'))) { - self::$instance = new $name(); + self::$instance = new $name; } else { - self::$instance = new JCli(); + self::$instance = new JCli; } } @@ -277,7 +277,7 @@ protected function fetchConfigurationData() // Instantiate the configuration object if it exists. if (class_exists('JConfig')) { - $config = new JConfig(); + $config = new JConfig; } } } diff --git a/libraries/joomla/application/cli/daemon.php b/libraries/joomla/application/cli/daemon.php index cb585324ec..cf37effc05 100644 --- a/libraries/joomla/application/cli/daemon.php +++ b/libraries/joomla/application/cli/daemon.php @@ -106,14 +106,14 @@ protected function __construct() if (!defined('SIGHUP')) { JLog::add('The PCNTL extension for PHP is not available.', JLog::ERROR); - throw new ApplicationException(); + throw new ApplicationException; } // Verify that POSIX support for PHP is available. if (!function_exists('posix_getpid')) { JLog::add('The POSIX extension for PHP is not available.', JLog::ERROR); - throw new ApplicationException(); + throw new ApplicationException; } // Call the parent constructor. @@ -559,7 +559,7 @@ protected function fork() { // Error JLog::add('Process could not be forked.', JLog::WARNING); - throw new ApplicationException(); + throw new ApplicationException; } // If the pid is positive then we successfully forked, and can close this application. elseif ($pid) diff --git a/libraries/joomla/application/component/controller.php b/libraries/joomla/application/component/controller.php index 3bcf0fad91..269f5b220e 100644 --- a/libraries/joomla/application/component/controller.php +++ b/libraries/joomla/application/component/controller.php @@ -692,7 +692,7 @@ public function display($cachable = false, $urlparams = false) if (empty($registeredurlparams)) { - $registeredurlparams = new stdClass(); + $registeredurlparams = new stdClass; } foreach ($urlparams as $key => $value) diff --git a/libraries/joomla/application/component/helper.php b/libraries/joomla/application/component/helper.php index c3c0e4498f..2682e4ae70 100644 --- a/libraries/joomla/application/component/helper.php +++ b/libraries/joomla/application/component/helper.php @@ -46,9 +46,9 @@ public static function getComponent($option, $strict = false) } else { - $result = new stdClass(); + $result = new stdClass; $result->enabled = $strict ? false : true; - $result->params = new JRegistry(); + $result->params = new JRegistry; } } else @@ -221,7 +221,7 @@ protected static function _load($option) // Convert the params to an object. if (is_string(self::$_components[$option]->params)) { - $temp = new JRegistry(); + $temp = new JRegistry; $temp->loadString(self::$_components[$option]->params); self::$_components[$option]->params = $temp; } diff --git a/libraries/joomla/application/component/model.php b/libraries/joomla/application/component/model.php index 64c735d5d2..4d29df303f 100644 --- a/libraries/joomla/application/component/model.php +++ b/libraries/joomla/application/component/model.php @@ -245,7 +245,7 @@ public function __construct($config = array()) } else { - $this->state = new JObject(); + $this->state = new JObject; } // Set the model dbo diff --git a/libraries/joomla/application/component/modeladmin.php b/libraries/joomla/application/component/modeladmin.php index 3a61e8d7ad..456e2febd3 100644 --- a/libraries/joomla/application/component/modeladmin.php +++ b/libraries/joomla/application/component/modeladmin.php @@ -697,7 +697,7 @@ public function getItem($pk = null) if (property_exists($item, 'params')) { - $registry = new JRegistry(); + $registry = new JRegistry; $registry->loadString($item->params); $item->params = $registry->toArray(); } diff --git a/libraries/joomla/application/helper.php b/libraries/joomla/application/helper.php index e86fcbc223..fdf73c631c 100644 --- a/libraries/joomla/application/helper.php +++ b/libraries/joomla/application/helper.php @@ -74,7 +74,7 @@ public static function getClientInfo($id = null, $byName = false) // Only create the array if it does not exist if (self::$_clients === null) { - $obj = new stdClass(); + $obj = new stdClass; // Site Client $obj->id = 0; diff --git a/libraries/joomla/application/menu.php b/libraries/joomla/application/menu.php index 7c8b26e71b..f5fc64169e 100644 --- a/libraries/joomla/application/menu.php +++ b/libraries/joomla/application/menu.php @@ -64,7 +64,7 @@ public function __construct($options = array()) } // Decode the item params - $result = new JRegistry(); + $result = new JRegistry; $result->loadString($item->params); $item->params = $result; } @@ -298,7 +298,7 @@ public function getParams($id) } else { - return new JRegistry(); + return new JRegistry; } } diff --git a/libraries/joomla/application/module/helper.php b/libraries/joomla/application/module/helper.php index 8a8f656146..d9ba9e1e2c 100644 --- a/libraries/joomla/application/module/helper.php +++ b/libraries/joomla/application/module/helper.php @@ -54,7 +54,7 @@ public static function &getModule($name, $title = null) // If we didn't find it, and the name is mod_something, create a dummy object if (is_null($result) && substr($name, 0, 4) == 'mod_') { - $result = new stdClass(); + $result = new stdClass; $result->id = 0; $result->title = ''; $result->module = $name; @@ -154,7 +154,7 @@ public static function renderModule($module, $attribs = array()) $app->scope = $module->module; // Get module parameters - $params = new JRegistry(); + $params = new JRegistry; $params->loadString($module->params); // Get module path @@ -465,7 +465,7 @@ public static function moduleCache($module, $moduleparams, $cacheparams) if (is_array($cacheparams->modeparams)) { $uri = JRequest::get(); - $safeuri = new stdClass(); + $safeuri = new stdClass; foreach ($cacheparams->modeparams as $key => $value) { // Use int filter for id/catid to clean out spamy slugs diff --git a/libraries/joomla/application/pathway.php b/libraries/joomla/application/pathway.php index 5df56628c3..ddbb00af28 100644 --- a/libraries/joomla/application/pathway.php +++ b/libraries/joomla/application/pathway.php @@ -209,7 +209,7 @@ public function setItemName($id, $name) */ protected function _makeItem($name, $link) { - $item = new stdClass(); + $item = new stdClass; $item->name = html_entity_decode($name, ENT_COMPAT, 'UTF-8'); $item->link = $link; diff --git a/libraries/joomla/cache/cache.php b/libraries/joomla/cache/cache.php index 9504997c61..1d04d17ebf 100644 --- a/libraries/joomla/cache/cache.php +++ b/libraries/joomla/cache/cache.php @@ -320,7 +320,7 @@ public function gc() */ public function lock($id, $group = null, $locktime = null) { - $returning = new stdClass(); + $returning = new stdClass; $returning->locklooped = false; // Get the default group $group = ($group) ? $group : $this->_options['defaultgroup']; @@ -655,7 +655,7 @@ public static function makeId() $registeredurlparams->tpl = 'CMD'; $registeredurlparams->id = 'INT'; - $safeuriaddon = new stdClass(); + $safeuriaddon = new stdClass; foreach ($registeredurlparams as $key => $value) { diff --git a/libraries/joomla/cache/controller.php b/libraries/joomla/cache/controller.php index a13285045f..45766a81e2 100644 --- a/libraries/joomla/cache/controller.php +++ b/libraries/joomla/cache/controller.php @@ -175,7 +175,7 @@ public function get($id, $group = null) if ($data === false) { - $locktest = new stdClass(); + $locktest = new stdClass; $locktest->locked = null; $locktest->locklooped = null; $locktest = $this->cache->lock($id, $group); @@ -210,7 +210,7 @@ public function get($id, $group = null) */ public function store($data, $id, $group = null) { - $locktest = new stdClass(); + $locktest = new stdClass; $locktest->locked = null; $locktest->locklooped = null; diff --git a/libraries/joomla/cache/controller/callback.php b/libraries/joomla/cache/controller/callback.php index 4efa752288..265c9f430a 100644 --- a/libraries/joomla/cache/controller/callback.php +++ b/libraries/joomla/cache/controller/callback.php @@ -99,7 +99,7 @@ public function get($callback, $args = array(), $id = false, $wrkarounds = false $data = false; $data = $this->cache->get($id); - $locktest = new stdClass(); + $locktest = new stdClass; $locktest->locked = null; $locktest->locklooped = null; diff --git a/libraries/joomla/cache/controller/output.php b/libraries/joomla/cache/controller/output.php index 8d80eecfe7..9027f809e0 100644 --- a/libraries/joomla/cache/controller/output.php +++ b/libraries/joomla/cache/controller/output.php @@ -48,7 +48,7 @@ public function start($id, $group = null) // If we have data in cache use that. $data = $this->cache->get($id, $group); - $this->_locktest = new stdClass(); + $this->_locktest = new stdClass; $this->_locktest->locked = null; $this->_locktest->locklooped = null; diff --git a/libraries/joomla/cache/controller/page.php b/libraries/joomla/cache/controller/page.php index ecd89f2eb9..10bf994226 100644 --- a/libraries/joomla/cache/controller/page.php +++ b/libraries/joomla/cache/controller/page.php @@ -75,7 +75,7 @@ public function get($id = false, $group = 'page', $wrkarounds = true) // We got a cache hit... set the etag header and echo the page data $data = $this->cache->get($id, $group); - $this->_locktest = new stdClass(); + $this->_locktest = new stdClass; $this->_locktest->locked = null; $this->_locktest->locklooped = null; diff --git a/libraries/joomla/cache/controller/view.php b/libraries/joomla/cache/controller/view.php index 3a23266f8e..dacc0f5a60 100644 --- a/libraries/joomla/cache/controller/view.php +++ b/libraries/joomla/cache/controller/view.php @@ -41,7 +41,7 @@ public function get(&$view, $method, $id = false, $wrkarounds = true) $data = false; $data = $this->cache->get($id); - $locktest = new stdClass(); + $locktest = new stdClass; $locktest->locked = null; $locktest->locklooped = null; diff --git a/libraries/joomla/cache/storage/apc.php b/libraries/joomla/cache/storage/apc.php index 808f2ac405..8654fc1513 100644 --- a/libraries/joomla/cache/storage/apc.php +++ b/libraries/joomla/cache/storage/apc.php @@ -192,7 +192,7 @@ public static function test() */ public function lock($id, $group, $locktime) { - $returning = new stdClass(); + $returning = new stdClass; $returning->locklooped = false; $looptime = $locktime * 10; diff --git a/libraries/joomla/cache/storage/eaccelerator.php b/libraries/joomla/cache/storage/eaccelerator.php index 5c44c088ee..26f80e99ea 100644 --- a/libraries/joomla/cache/storage/eaccelerator.php +++ b/libraries/joomla/cache/storage/eaccelerator.php @@ -204,7 +204,7 @@ public static function test() */ public function lock($id, $group, $locktime) { - $returning = new stdClass(); + $returning = new stdClass; $returning->locklooped = false; $looptime = $locktime * 10; diff --git a/libraries/joomla/cache/storage/file.php b/libraries/joomla/cache/storage/file.php index 3203fce051..7332ed21af 100644 --- a/libraries/joomla/cache/storage/file.php +++ b/libraries/joomla/cache/storage/file.php @@ -266,7 +266,7 @@ public static function test() */ public function lock($id, $group, $locktime) { - $returning = new stdClass(); + $returning = new stdClass; $returning->locklooped = false; $looptime = $locktime * 10; diff --git a/libraries/joomla/cache/storage/memcache.php b/libraries/joomla/cache/storage/memcache.php index a0309b7a77..9e82edfea7 100644 --- a/libraries/joomla/cache/storage/memcache.php +++ b/libraries/joomla/cache/storage/memcache.php @@ -80,7 +80,7 @@ protected function getConnection() $server['host'] = $config->get('memcache_server_host', 'localhost'); $server['port'] = $config->get('memcache_server_port', 11211); // Create the memcache connection - self::$_db = new Memcache(); + self::$_db = new Memcache; self::$_db->addServer($server['host'], $server['port'], $this->_persistent); $memcachetest = @self::$_db->connect($server['host'], $server['port']); @@ -193,7 +193,7 @@ public function store($id, $group, $data) $index = array(); } - $tmparr = new stdClass(); + $tmparr = new stdClass; $tmparr->name = $cache_id; $tmparr->size = strlen($data); $index[] = $tmparr; @@ -304,7 +304,7 @@ public static function test() $host = $config->get('memcache_server_host', 'localhost'); $port = $config->get('memcache_server_port', 11211); - $memcache = new Memcache(); + $memcache = new Memcache; $memcachetest = @$memcache->connect($host, $port); if (!$memcachetest) @@ -330,7 +330,7 @@ public static function test() */ public function lock($id, $group, $locktime) { - $returning = new stdClass(); + $returning = new stdClass; $returning->locklooped = false; $looptime = $locktime * 10; @@ -348,7 +348,7 @@ public function lock($id, $group, $locktime) $index = array(); } - $tmparr = new stdClass(); + $tmparr = new stdClass; $tmparr->name = $cache_id; $tmparr->size = 1; $index[] = $tmparr; diff --git a/libraries/joomla/client/http.php b/libraries/joomla/client/http.php index 0c130b03e1..c1a3070b7e 100644 --- a/libraries/joomla/client/http.php +++ b/libraries/joomla/client/http.php @@ -274,7 +274,7 @@ protected function sendRequest($connection, $method, JUri $uri, $data = null, $h protected function getResponseObject() { // Create the response object. - $return = new JHttpResponse(); + $return = new JHttpResponse; // Split the response into headers and body. $response = explode("\r\n\r\n", $this->response, 2); diff --git a/libraries/joomla/database/database/mysql.php b/libraries/joomla/database/database/mysql.php index 34db6f6fb2..778a1709c2 100644 --- a/libraries/joomla/database/database/mysql.php +++ b/libraries/joomla/database/database/mysql.php @@ -246,7 +246,7 @@ public function getExporter() throw new JDatabaseException(JText::_('JLIB_DATABASE_ERROR_MISSING_EXPORTER')); } - $o = new JDatabaseExporterMySQL(); + $o = new JDatabaseExporterMySQL; $o->setDbo($this); return $o; @@ -267,7 +267,7 @@ public function getImporter() throw new JDatabaseException(JText::_('JLIB_DATABASE_ERROR_MISSING_IMPORTER')); } - $o = new JDatabaseImporterMySQL(); + $o = new JDatabaseImporterMySQL; $o->setDbo($this); return $o; diff --git a/libraries/joomla/database/database/mysqlexporter.php b/libraries/joomla/database/database/mysqlexporter.php index b45361dec2..396a69e5b3 100644 --- a/libraries/joomla/database/database/mysqlexporter.php +++ b/libraries/joomla/database/database/mysqlexporter.php @@ -69,7 +69,7 @@ class JDatabaseExporterMySQL */ public function __construct() { - $this->options = new JObject(); + $this->options = new JObject; $this->cache = array('columns' => array(), 'keys' => array()); diff --git a/libraries/joomla/database/database/mysqli.php b/libraries/joomla/database/database/mysqli.php index e5d5b810bc..78f8ed793c 100644 --- a/libraries/joomla/database/database/mysqli.php +++ b/libraries/joomla/database/database/mysqli.php @@ -274,7 +274,7 @@ public function getExporter() throw new JDatabaseException(JText::_('JLIB_DATABASE_ERROR_MISSING_EXPORTER')); } - $o = new JDatabaseExporterMySQLi(); + $o = new JDatabaseExporterMySQLi; $o->setDbo($this); return $o; @@ -296,7 +296,7 @@ public function getImporter() throw new JDatabaseException(JText::_('JLIB_DATABASE_ERROR_MISSING_IMPORTER')); } - $o = new JDatabaseImporterMySQLi(); + $o = new JDatabaseImporterMySQLi; $o->setDbo($this); return $o; diff --git a/libraries/joomla/database/database/mysqlimporter.php b/libraries/joomla/database/database/mysqlimporter.php index 037e6d1914..0aa72ac4fb 100644 --- a/libraries/joomla/database/database/mysqlimporter.php +++ b/libraries/joomla/database/database/mysqlimporter.php @@ -67,7 +67,7 @@ class JDatabaseImporterMySQL */ public function __construct() { - $this->options = new JObject(); + $this->options = new JObject; $this->cache = array('columns' => array(), 'keys' => array()); diff --git a/libraries/joomla/database/database/sqlsrv.php b/libraries/joomla/database/database/sqlsrv.php index b32815a169..9344c3b1ba 100644 --- a/libraries/joomla/database/database/sqlsrv.php +++ b/libraries/joomla/database/database/sqlsrv.php @@ -302,7 +302,7 @@ public function getExporter() throw new JDatabaseException(JText::_('JLIB_DATABASE_ERROR_MISSING_EXPORTER')); } - $o = new JDatabaseExporterSQLAzure(); + $o = new JDatabaseExporterSQLAzure; $o->setDbo($this); return $o; @@ -324,7 +324,7 @@ public function getImporter() throw new JDatabaseException(JText::_('JLIB_DATABASE_ERROR_MISSING_IMPORTER')); } - $o = new JDatabaseImporterSQLAzure(); + $o = new JDatabaseImporterSQLAzure; $o->setDbo($this); return $o; diff --git a/libraries/joomla/database/table/category.php b/libraries/joomla/database/table/category.php index bf2cde14b9..89230337c3 100644 --- a/libraries/joomla/database/table/category.php +++ b/libraries/joomla/database/table/category.php @@ -170,14 +170,14 @@ public function bind($array, $ignore = '') { if (isset($array['params']) && is_array($array['params'])) { - $registry = new JRegistry(); + $registry = new JRegistry; $registry->loadArray($array['params']); $array['params'] = (string) $registry; } if (isset($array['metadata']) && is_array($array['metadata'])) { - $registry = new JRegistry(); + $registry = new JRegistry; $registry->loadArray($array['metadata']); $array['metadata'] = (string) $registry; } diff --git a/libraries/joomla/database/table/content.php b/libraries/joomla/database/table/content.php index 8eb870e3d9..78d1fb2cdc 100644 --- a/libraries/joomla/database/table/content.php +++ b/libraries/joomla/database/table/content.php @@ -138,14 +138,14 @@ public function bind($array, $ignore = '') if (isset($array['attribs']) && is_array($array['attribs'])) { - $registry = new JRegistry(); + $registry = new JRegistry; $registry->loadArray($array['attribs']); $array['attribs'] = (string) $registry; } if (isset($array['metadata']) && is_array($array['metadata'])) { - $registry = new JRegistry(); + $registry = new JRegistry; $registry->loadArray($array['metadata']); $array['metadata'] = (string) $registry; } diff --git a/libraries/joomla/database/table/extension.php b/libraries/joomla/database/table/extension.php index b045f7f1a7..222bd8dea5 100644 --- a/libraries/joomla/database/table/extension.php +++ b/libraries/joomla/database/table/extension.php @@ -68,14 +68,14 @@ function bind($array, $ignore = '') { if (isset($array['params']) && is_array($array['params'])) { - $registry = new JRegistry(); + $registry = new JRegistry; $registry->loadArray($array['params']); $array['params'] = (string) $registry; } if (isset($array['control']) && is_array($array['control'])) { - $registry = new JRegistry(); + $registry = new JRegistry; $registry->loadArray($array['control']); $array['control'] = (string) $registry; } diff --git a/libraries/joomla/database/table/menu.php b/libraries/joomla/database/table/menu.php index b935549bfb..20d8f6605a 100644 --- a/libraries/joomla/database/table/menu.php +++ b/libraries/joomla/database/table/menu.php @@ -72,7 +72,7 @@ public function bind($array, $ignore = '') if (isset($array['params']) && is_array($array['params'])) { - $registry = new JRegistry(); + $registry = new JRegistry; $registry->loadArray($array['params']); $array['params'] = (string) $registry; } diff --git a/libraries/joomla/database/table/module.php b/libraries/joomla/database/table/module.php index b2b038473c..c09466d1d9 100644 --- a/libraries/joomla/database/table/module.php +++ b/libraries/joomla/database/table/module.php @@ -81,7 +81,7 @@ public function bind($array, $ignore = '') { if (isset($array['params']) && is_array($array['params'])) { - $registry = new JRegistry(); + $registry = new JRegistry; $registry->loadArray($array['params']); $array['params'] = (string) $registry; } diff --git a/libraries/joomla/database/table/update.php b/libraries/joomla/database/table/update.php index d5ad0b2b01..1ecf3f3cf6 100644 --- a/libraries/joomla/database/table/update.php +++ b/libraries/joomla/database/table/update.php @@ -70,14 +70,14 @@ public function bind($array, $ignore = '') { if (isset($array['params']) && is_array($array['params'])) { - $registry = new JRegistry(); + $registry = new JRegistry; $registry->loadArray($array['params']); $array['params'] = (string) $registry; } if (isset($array['control']) && is_array($array['control'])) { - $registry = new JRegistry(); + $registry = new JRegistry; $registry->loadArray($array['control']); $array['control'] = (string) $registry; } diff --git a/libraries/joomla/database/table/user.php b/libraries/joomla/database/table/user.php index 4a078bdb43..a1be26e75a 100644 --- a/libraries/joomla/database/table/user.php +++ b/libraries/joomla/database/table/user.php @@ -130,7 +130,7 @@ function bind($array, $ignore = '') { if (key_exists('params', $array) && is_array($array['params'])) { - $registry = new JRegistry(); + $registry = new JRegistry; $registry->loadArray($array['params']); $array['params'] = (string) $registry; } diff --git a/libraries/joomla/database/tablenested.php b/libraries/joomla/database/tablenested.php index e0d71fc719..542c795f46 100644 --- a/libraries/joomla/database/tablenested.php +++ b/libraries/joomla/database/tablenested.php @@ -1580,7 +1580,7 @@ protected function _getTreeRepositionData($referenceNode, $nodeWidth, $position // Initialise variables. $k = $this->_tbl_key; - $data = new stdClass(); + $data = new stdClass; // Run the calculations and build the data object by reference position. switch ($position) diff --git a/libraries/joomla/event/dispatcher.php b/libraries/joomla/event/dispatcher.php index 20be36cef0..1066758634 100644 --- a/libraries/joomla/event/dispatcher.php +++ b/libraries/joomla/event/dispatcher.php @@ -39,7 +39,7 @@ public static function getInstance() if (!is_object($instance)) { - $instance = new JDispatcher(); + $instance = new JDispatcher; } return $instance; diff --git a/libraries/joomla/filesystem/archive.php b/libraries/joomla/filesystem/archive.php index b9e9e9b111..ea7e920822 100644 --- a/libraries/joomla/filesystem/archive.php +++ b/libraries/joomla/filesystem/archive.php @@ -198,7 +198,7 @@ public static function getAdapter($type) } } - $adapters[$type] = new $class(); + $adapters[$type] = new $class; } return $adapters[$type]; diff --git a/libraries/joomla/form/fields/helpsite.php b/libraries/joomla/form/fields/helpsite.php index 610a7aa3b3..85b5c48ebd 100644 --- a/libraries/joomla/form/fields/helpsite.php +++ b/libraries/joomla/form/fields/helpsite.php @@ -44,7 +44,7 @@ class JFormFieldHelpsite extends JFormFieldList protected function getOptions() { // Get Joomla version. - $version = new JVersion(); + $version = new JVersion; $jver = explode('.', $version->getShortVersion()); // Merge any additional options in the XML definition. diff --git a/libraries/joomla/form/form.php b/libraries/joomla/form/form.php index 7b02a2d9c0..6a419751f3 100644 --- a/libraries/joomla/form/form.php +++ b/libraries/joomla/form/form.php @@ -88,7 +88,7 @@ public function __construct($name, array $options = array()) $this->name = $name; // Initialise the JRegistry data. - $this->data = new JRegistry(); + $this->data = new JRegistry; // Set the options if specified. $this->options['control'] = isset($options['control']) ? $options['control'] : false; @@ -208,7 +208,7 @@ public function filter($data, $group = null) // Initialise variables. $input = new JRegistry($data); - $output = new JRegistry(); + $output = new JRegistry; // Get the fields for which to filter the data. $fields = $this->findFieldsByGroup($group); @@ -847,7 +847,7 @@ public function removeGroup($group) public function reset($xml = false) { unset($this->data); - $this->data = new JRegistry(); + $this->data = new JRegistry; if ($xml) { diff --git a/libraries/joomla/form/helper.php b/libraries/joomla/form/helper.php index cdd2bb3b18..0231a321cd 100644 --- a/libraries/joomla/form/helper.php +++ b/libraries/joomla/form/helper.php @@ -116,7 +116,7 @@ protected static function loadType($entity, $type, $new = true) if (($class = self::loadClass($entity, $type)) !== false) { // Instantiate a new type object. - $types[$key] = new $class(); + $types[$key] = new $class; return $types[$key]; } else diff --git a/libraries/joomla/installer/adapters/component.php b/libraries/joomla/installer/adapters/component.php index ef6dc1000a..193fffc1b4 100644 --- a/libraries/joomla/installer/adapters/component.php +++ b/libraries/joomla/installer/adapters/component.php @@ -672,7 +672,7 @@ public function update() $old_manifest = null; // Create a new installer because findManifest sets stuff // Look in the administrator first - $tmpInstaller = new JInstaller(); + $tmpInstaller = new JInstaller; $tmpInstaller->setPath('source', $this->parent->getPath('extension_administrator')); if (!$tmpInstaller->findManifest()) diff --git a/libraries/joomla/installer/adapters/language.php b/libraries/joomla/installer/adapters/language.php index f1f2c43812..80c1357c41 100644 --- a/libraries/joomla/installer/adapters/language.php +++ b/libraries/joomla/installer/adapters/language.php @@ -536,7 +536,7 @@ public function uninstall($eid) $count = 0; foreach ($users as $user) { - $registry = new JRegistry(); + $registry = new JRegistry; $registry->loadString($user->params); if ($registry->get($param_name) == $element) { diff --git a/libraries/joomla/installer/adapters/library.php b/libraries/joomla/installer/adapters/library.php index 2c9eadaf61..54c530cdde 100644 --- a/libraries/joomla/installer/adapters/library.php +++ b/libraries/joomla/installer/adapters/library.php @@ -78,7 +78,7 @@ public function install() if ($this->parent->getOverwrite() || $this->parent->getUpgrade()) { // We can upgrade, so uninstall the old one - $installer = new JInstaller(); // we don't want to compromise this instance! + $installer = new JInstaller; // we don't want to compromise this instance! $installer->uninstall('library', $result); } else @@ -208,7 +208,7 @@ public function update() $element = str_replace('.xml', '', basename($this->parent->getPath('manifest'))); $this->set('name', $name); $this->set('element', $element); - $installer = new JInstaller(); // we don't want to compromise this instance! + $installer = new JInstaller; // we don't want to compromise this instance! $db = $this->parent->getDbo(); $db->setQuery('SELECT extension_id FROM #__extensions WHERE type="library" AND element = "' . $element . '"'); $result = $db->loadResult(); diff --git a/libraries/joomla/installer/adapters/package.php b/libraries/joomla/installer/adapters/package.php index 2496d3eeaa..24261915ef 100644 --- a/libraries/joomla/installer/adapters/package.php +++ b/libraries/joomla/installer/adapters/package.php @@ -132,7 +132,7 @@ public function install() // If it's an archive $package = JInstallerHelper::unpack($file); } - $tmpInstaller = new JInstaller(); + $tmpInstaller = new JInstaller; if (!$tmpInstaller->install($package['dir'])) { $this->parent->abort( @@ -285,7 +285,7 @@ function uninstall($id) $error = false; foreach ($manifest->filelist as $extension) { - $tmpInstaller = new JInstaller(); + $tmpInstaller = new JInstaller; $id = $this->_getExtensionID($extension->type, $extension->id, $extension->client, $extension->group); $client = JApplicationHelper::getClientInfo($extension->client, true); if ($id) diff --git a/libraries/joomla/installer/adapters/plugin.php b/libraries/joomla/installer/adapters/plugin.php index 8fd9740574..a51db1c395 100644 --- a/libraries/joomla/installer/adapters/plugin.php +++ b/libraries/joomla/installer/adapters/plugin.php @@ -305,7 +305,7 @@ public function install() { // Hunt for the original XML file $old_manifest = null; - $tmpInstaller = new JInstaller(); // create a new installer because findManifest sets stuff; side effects! + $tmpInstaller = new JInstaller; // create a new installer because findManifest sets stuff; side effects! // Look in the extension root $tmpInstaller->setPath('source', $this->parent->getPath('extension_root')); if ($tmpInstaller->findManifest()) diff --git a/libraries/joomla/installer/adapters/template.php b/libraries/joomla/installer/adapters/template.php index a4217285b2..6b3722f586 100644 --- a/libraries/joomla/installer/adapters/template.php +++ b/libraries/joomla/installer/adapters/template.php @@ -491,7 +491,7 @@ function discover_install() $this->parent->extension->name = $manifest_details['name']; $this->parent->extension->enabled = 1; - $data = new JObject(); + $data = new JObject; foreach ($manifest_details as $key => $value) { diff --git a/libraries/joomla/installer/helper.php b/libraries/joomla/installer/helper.php index 44609c27f9..e484788d8b 100644 --- a/libraries/joomla/installer/helper.php +++ b/libraries/joomla/installer/helper.php @@ -44,7 +44,7 @@ public static function downloadPackage($url, $target = false) // Set user agent jimport('joomla.version'); - $version = new JVersion(); + $version = new JVersion; ini_set('user_agent', $version->getUserAgent('Installer')); // Open the remote server socket for reading diff --git a/libraries/joomla/installer/installer.php b/libraries/joomla/installer/installer.php index 0076de66cb..4a1c56f864 100644 --- a/libraries/joomla/installer/installer.php +++ b/libraries/joomla/installer/installer.php @@ -130,7 +130,7 @@ public static function getInstance() if (!isset($instance)) { - $instance = new JInstaller(); + $instance = new JInstaller; } return $instance; } diff --git a/libraries/joomla/language/help.php b/libraries/joomla/language/help.php index 60672b46db..e0345325d5 100644 --- a/libraries/joomla/language/help.php +++ b/libraries/joomla/language/help.php @@ -95,7 +95,7 @@ static function createURL($ref, $useComponent = false, $override = null, $compon * Replace substitution codes in the URL. */ $lang = JFactory::getLanguage(); - $version = new JVersion(); + $version = new JVersion; $jver = explode('.', $version->getShortVersion()); $jlang = explode('-', $lang->getTag()); diff --git a/libraries/joomla/language/language.php b/libraries/joomla/language/language.php index aedc42946c..0f6843d248 100644 --- a/libraries/joomla/language/language.php +++ b/libraries/joomla/language/language.php @@ -861,7 +861,7 @@ protected function parse($filename) $lineNumber = 0; // Open the file as a stream. - $stream = new JStream(); + $stream = new JStream; $stream->open($filename); while (!$stream->eof()) diff --git a/libraries/joomla/log/log.php b/libraries/joomla/log/log.php index a210d9966b..b767d5209f 100755 --- a/libraries/joomla/log/log.php +++ b/libraries/joomla/log/log.php @@ -162,7 +162,7 @@ public static function add($entry, $priority = JLog::INFO, $category = '', $date // Automatically instantiate the singleton object if not already done. if (empty(self::$instance)) { - self::setInstance(new JLog()); + self::setInstance(new JLog); } // If the entry object isn't a JLogEntry object let's make one. @@ -191,7 +191,7 @@ public static function addLogger(array $options, $priorities = JLog::ALL, $categ // Automatically instantiate the singleton object if not already done. if (empty(self::$instance)) { - self::setInstance(new JLog()); + self::setInstance(new JLog); } // The default logger is the formatted text log file. @@ -263,7 +263,7 @@ public static function getInstance($file = 'error.php', $options = null, $path = // Only create the object if not already created. if (empty(self::$legacy[$signature])) { - self::$legacy[$signature] = new JLog(); + self::$legacy[$signature] = new JLog; // Register the configuration. self::$legacy[$signature]->configurations[$signature] = $options; diff --git a/libraries/joomla/log/loggers/formattedtext.php b/libraries/joomla/log/loggers/formattedtext.php index 6199adba42..c53d6ce36e 100644 --- a/libraries/joomla/log/loggers/formattedtext.php +++ b/libraries/joomla/log/loggers/formattedtext.php @@ -187,7 +187,7 @@ public function addEntry(JLogEntry $entry) // Write the new entry to the file. if (!fputs($this->file, $line . "\n")) { - throw new LogException(); + throw new LogException; } } @@ -257,7 +257,7 @@ protected function initFile() { if (!fputs($this->file, $head)) { - throw new LogException(); + throw new LogException; } } } diff --git a/libraries/joomla/mail/mail.php b/libraries/joomla/mail/mail.php index 2e2d19f067..25f984cc64 100644 --- a/libraries/joomla/mail/mail.php +++ b/libraries/joomla/mail/mail.php @@ -54,7 +54,7 @@ public static function getInstance($id = 'Joomla') if (empty($instances[$id])) { - $instances[$id] = new JMail(); + $instances[$id] = new JMail; } return $instances[$id]; diff --git a/libraries/joomla/plugin/plugin.php b/libraries/joomla/plugin/plugin.php index 972c8d89de..62f14b1f85 100644 --- a/libraries/joomla/plugin/plugin.php +++ b/libraries/joomla/plugin/plugin.php @@ -65,7 +65,7 @@ public function __construct(&$subject, $config = array()) } else { - $this->params = new JRegistry(); + $this->params = new JRegistry; $this->params->loadString($config['params']); } } diff --git a/libraries/joomla/registry/format.php b/libraries/joomla/registry/format.php index 88f8bbb9d3..acda79e612 100644 --- a/libraries/joomla/registry/format.php +++ b/libraries/joomla/registry/format.php @@ -59,7 +59,7 @@ public static function getInstance($type) } } - $instances[$type] = new $class(); + $instances[$type] = new $class; } return $instances[$type]; } diff --git a/libraries/joomla/registry/format/ini.php b/libraries/joomla/registry/format/ini.php index 3638bb4c90..a519fd0287 100644 --- a/libraries/joomla/registry/format/ini.php +++ b/libraries/joomla/registry/format/ini.php @@ -99,11 +99,11 @@ public function stringToObject($data, $options = array()) // If no lines present just return the object. if (empty($data)) { - return new stdClass(); + return new stdClass; } // Initialize variables. - $obj = new stdClass(); + $obj = new stdClass; $section = false; $lines = explode("\n", $data); @@ -127,7 +127,7 @@ public function stringToObject($data, $options = array()) if (($line[0] == '[') && ($line[$length - 1] == ']')) { $section = substr($line, 1, $length - 2); - $obj->$section = new stdClass(); + $obj->$section = new stdClass; continue; } } diff --git a/libraries/joomla/registry/format/xml.php b/libraries/joomla/registry/format/xml.php index e1e9e0dcd3..59ea8a5646 100644 --- a/libraries/joomla/registry/format/xml.php +++ b/libraries/joomla/registry/format/xml.php @@ -74,7 +74,7 @@ public function objectToString($object, $options = array()) public function stringToObject($data, $options = array()) { // Initialize variables. - $obj = new stdClass(); + $obj = new stdClass; // Parse the XML string. $xml = simplexml_load_string($data); @@ -123,7 +123,7 @@ protected function getValueFromNode($node) } break; default: - $value = new stdClass(); + $value = new stdClass; foreach ($node->children() as $child) { $value->$child['name'] = $this->getValueFromNode($child); diff --git a/libraries/joomla/registry/registry.php b/libraries/joomla/registry/registry.php index 706b570fb2..3f22335446 100644 --- a/libraries/joomla/registry/registry.php +++ b/libraries/joomla/registry/registry.php @@ -40,7 +40,7 @@ class JRegistry public function __construct($data = null) { // Instantiate the internal data object. - $this->data = new stdClass(); + $this->data = new stdClass; // Optionally load supplied data. if (is_array($data) || is_object($data)) @@ -204,7 +204,7 @@ public static function getInstance($id) if (empty($instances[$id])) { - $instances[$id] = new JRegistry(); + $instances[$id] = new JRegistry; } return $instances[$id]; @@ -335,7 +335,7 @@ public function set($path, $value) { if (!isset($node->$nodes[$i]) && ($i != $n)) { - $node->$nodes[$i] = new stdClass(); + $node->$nodes[$i] = new stdClass; } $node = $node->$nodes[$i]; } @@ -415,7 +415,7 @@ protected function bindData(&$parent, $data) { if ((is_array($v) && JArrayHelper::isAssociative($v)) || is_object($v)) { - $parent->$k = new stdClass(); + $parent->$k = new stdClass; $this->bindData($parent->$k, $v); } else @@ -469,13 +469,13 @@ protected function asArray($data) * @since 11.1 * * @deprecated 12.1 Use loadString passing XML as the format instead. - * @note + * @note */ public function loadXML($data, $namespace = null) { // Deprecation warning. JLog::add('JRegistry::loadXML() is deprecated.', JLog::WARNING, 'deprecated'); - + return $this->loadString($data, 'XML'); } @@ -496,7 +496,7 @@ public function loadINI($data, $namespace = null, $options = array()) { // Deprecation warning. JLog::add('JRegistry::loadINI() is deprecated.', JLog::WARNING, 'deprecated'); - + return $this->loadString($data, 'INI', $options); } @@ -515,7 +515,7 @@ public function loadJSON($data) { // Deprecation warning. JLog::add('JRegistry::loadJSON() is deprecated.', JLog::WARNING, 'deprecated'); - + return $this->loadString($data, 'JSON'); } @@ -534,7 +534,7 @@ public function makeNameSpace($namespace) { // Deprecation warning. JLog::add('JRegistry::makeNameSpace() is deprecated.', JLog::WARNING, 'deprecated'); - + //$this->_registry[$namespace] = array('data' => new stdClass()); return true; } @@ -552,7 +552,7 @@ public function getNameSpaces() { // Deprecation warning. JLog::add('JRegistry::getNameSpaces() is deprecated.', JLog::WARNING, 'deprecated'); - + //return array_keys($this->_registry); return array(); } @@ -573,7 +573,7 @@ public function getValue($path, $default = null) { // Deprecation warning. JLog::add('JRegistry::getValue() is deprecated.', JLog::WARNING, 'deprecated'); - + $parts = explode('.', $path); if (count($parts) > 1) { @@ -599,7 +599,7 @@ public function setValue($path, $value) { // Deprecation warning. JLog::add('JRegistry::setValue() is deprecated.', JLog::WARNING, 'deprecated'); - + $parts = explode('.', $path); if (count($parts) > 1) { @@ -624,7 +624,7 @@ public function loadSetupFile() { // Deprecation warning. JLog::add('JRegistry::loadXML() is deprecated.', JLog::WARNING, 'deprecated'); - + return true; } }