Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Commit

Permalink
Removing unnecessary empty braces when instancing classes
Browse files Browse the repository at this point in the history
  • Loading branch information
elkuku committed Aug 29, 2011
1 parent 64be81a commit 9005bd1
Show file tree
Hide file tree
Showing 61 changed files with 110 additions and 110 deletions.
2 changes: 1 addition & 1 deletion libraries/joomla/access/access.php
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/access/rules.php
Expand Up @@ -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))
Expand Down
6 changes: 3 additions & 3 deletions libraries/joomla/application/application.php
Expand Up @@ -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.
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions libraries/joomla/application/categories.php
Expand Up @@ -883,7 +883,7 @@ function getParams()
{
if (!($this->params instanceof JRegistry))
{
$temp = new JRegistry();
$temp = new JRegistry;
$temp->loadString($this->params);
$this->params = $temp;
}
Expand All @@ -902,7 +902,7 @@ function getMetadata()
{
if (!($this->metadata instanceof JRegistry))
{
$temp = new JRegistry();
$temp = new JRegistry;
$temp->loadString($this->metadata);
$this->metadata = $temp;
}
Expand Down
10 changes: 5 additions & 5 deletions libraries/joomla/application/cli.php
Expand Up @@ -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());
Expand Down Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -277,7 +277,7 @@ protected function fetchConfigurationData()
// Instantiate the configuration object if it exists.
if (class_exists('JConfig'))
{
$config = new JConfig();
$config = new JConfig;
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions libraries/joomla/application/cli/daemon.php
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/application/component/controller.php
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions libraries/joomla/application/component/helper.php
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/application/component/model.php
Expand Up @@ -245,7 +245,7 @@ public function __construct($config = array())
}
else
{
$this->state = new JObject();
$this->state = new JObject;
}

// Set the model dbo
Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/application/component/modeladmin.php
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/application/helper.php
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions libraries/joomla/application/menu.php
Expand Up @@ -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;
}
Expand Down Expand Up @@ -298,7 +298,7 @@ public function getParams($id)
}
else
{
return new JRegistry();
return new JRegistry;
}
}

Expand Down
6 changes: 3 additions & 3 deletions libraries/joomla/application/module/helper.php
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/application/pathway.php
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions libraries/joomla/cache/cache.php
Expand Up @@ -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'];
Expand Down Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions libraries/joomla/cache/controller.php
Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/cache/controller/callback.php
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/cache/controller/output.php
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/cache/controller/page.php
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/cache/controller/view.php
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/cache/storage/apc.php
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/cache/storage/eaccelerator.php
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/cache/storage/file.php
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions libraries/joomla/cache/storage/memcache.php
Expand Up @@ -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']);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand All @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/client/http.php
Expand Up @@ -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);
Expand Down

0 comments on commit 9005bd1

Please sign in to comment.