Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename method arguments to use camelCase casing (libraries/joomla directory) #31168

Merged
merged 10 commits into from
Oct 27, 2020
24 changes: 12 additions & 12 deletions libraries/joomla/database/driver/pgsql.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,26 +474,26 @@ public function renameTable($oldTable, $newTable, $backup = null, $prefix = null
/**
* This function return a field value as a prepared string to be used in a SQL statement.
*
* @param array $columns Array of table's column returned by ::getTableColumns.
* @param string $field_name The table field's name.
* @param string $field_value The variable value to quote and return.
* @param array $columns Array of table's column returned by ::getTableColumns.
* @param string $fieldName The table field's name.
* @param string $fieldValue The variable value to quote and return.
*
* @return string The quoted string.
*
* @since 3.9.0
*/
public function sqlValue($columns, $field_name, $field_value)
public function sqlValue($columns, $fieldName, $fieldValue)
{
switch ($columns[$field_name])
switch ($columns[$fieldName])
{
case 'boolean':
$val = 'NULL';

if ($field_value === 't' || $field_value === true || $field_value === 1 || $field_value === '1')
if ($fieldValue === 't' || $fieldValue === true || $fieldValue === 1 || $fieldValue === '1')
{
$val = 'TRUE';
}
elseif ($field_value === 'f' || $field_value === false || $field_value === 0 || $field_value === '0')
elseif ($fieldValue === 'f' || $fieldValue === false || $fieldValue === 0 || $fieldValue === '0')
{
$val = 'FALSE';
}
Expand All @@ -509,22 +509,22 @@ public function sqlValue($columns, $field_name, $field_value)
case 'smallint':
case 'serial':
case 'numeric,':
$val = $field_value === '' ? 'NULL' : $field_value;
$val = $fieldValue === '' ? 'NULL' : $fieldValue;
break;

case 'date':
case 'timestamp without time zone':
if (empty($field_value))
if (empty($fieldValue))
{
$field_value = $this->getNullDate();
$fieldValue = $this->getNullDate();
}

$val = $this->quote($field_value);
$val = $this->quote($fieldValue);

break;

default:
$val = $this->quote($field_value);
$val = $this->quote($fieldValue);
break;
}

Expand Down
30 changes: 15 additions & 15 deletions libraries/joomla/database/driver/postgresql.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,12 @@ public function getTableColumns($table, $typeOnly = true)
$tableSub = $this->replacePrefix($table);
$fn = explode('.', $tableSub);

if (count($fn) === 2)
if (count($fn) === 2)
{
$schema = $fn[0];
$tableSub = $fn[1];
}
else
}
else
{
$schema = 'public';
}
Expand Down Expand Up @@ -936,26 +936,26 @@ public function setUtf()
/**
* This function return a field value as a prepared string to be used in a SQL statement.
*
* @param array $columns Array of table's column returned by ::getTableColumns.
* @param string $field_name The table field's name.
* @param string $field_value The variable value to quote and return.
* @param array $columns Array of table's column returned by ::getTableColumns.
* @param string $fieldName The table field's name.
* @param string $fieldValue The variable value to quote and return.
*
* @return string The quoted string.
*
* @since 3.0.0
*/
public function sqlValue($columns, $field_name, $field_value)
public function sqlValue($columns, $fieldName, $fieldValue)
{
switch ($columns[$field_name])
switch ($columns[$fieldName])
{
case 'boolean':
$val = 'NULL';

if ($field_value == 't')
if ($fieldValue == 't')
{
$val = 'TRUE';
}
elseif ($field_value == 'f')
elseif ($fieldValue == 'f')
{
$val = 'FALSE';
}
Expand All @@ -971,21 +971,21 @@ public function sqlValue($columns, $field_name, $field_value)
case 'smallint':
case 'serial':
case 'numeric,':
$val = strlen($field_value) == 0 ? 'NULL' : $field_value;
$val = strlen($fieldValue) == 0 ? 'NULL' : $fieldValue;
break;

case 'date':
case 'timestamp without time zone':
if (empty($field_value))
if (empty($fieldValue))
{
$field_value = $this->getNullDate();
$fieldValue = $this->getNullDate();
}

$val = $this->quote($field_value);
$val = $this->quote($fieldValue);
break;

default:
$val = $this->quote($field_value);
$val = $this->quote($fieldValue);
break;
}

Expand Down
20 changes: 10 additions & 10 deletions libraries/joomla/database/query/postgresql.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,25 +404,25 @@ public function currentTimestamp()
/**
* Sets the FOR UPDATE lock on select's output row
*
* @param string $table_name The table to lock
* @param string $glue The glue by which to join the conditions. Defaults to ',' .
* @param string $tableName The table to lock
* @param string $glue The glue by which to join the conditions. Defaults to ',' .
*
* @return JDatabaseQueryPostgresql FOR UPDATE query element
*
* @since 1.7.3
*/
public function forUpdate($table_name, $glue = ',')
public function forUpdate($tableName, $glue = ',')
{
$this->type = 'forUpdate';

if (is_null($this->forUpdate))
{
$glue = strtoupper($glue);
$this->forUpdate = new JDatabaseQueryElement('FOR UPDATE', 'OF ' . $table_name, "$glue ");
$this->forUpdate = new JDatabaseQueryElement('FOR UPDATE', 'OF ' . $tableName, "$glue ");
}
else
{
$this->forUpdate->append($table_name);
$this->forUpdate->append($tableName);
}

return $this;
Expand All @@ -431,25 +431,25 @@ public function forUpdate($table_name, $glue = ',')
/**
* Sets the FOR SHARE lock on select's output row
*
* @param string $table_name The table to lock
* @param string $glue The glue by which to join the conditions. Defaults to ',' .
* @param string $tableName The table to lock
* @param string $glue The glue by which to join the conditions. Defaults to ',' .
*
* @return JDatabaseQueryPostgresql FOR SHARE query element
*
* @since 1.7.3
*/
public function forShare($table_name, $glue = ',')
public function forShare($tableName, $glue = ',')
{
$this->type = 'forShare';

if (is_null($this->forShare))
{
$glue = strtoupper($glue);
$this->forShare = new JDatabaseQueryElement('FOR SHARE', 'OF ' . $table_name, "$glue ");
$this->forShare = new JDatabaseQueryElement('FOR SHARE', 'OF ' . $tableName, "$glue ");
}
else
{
$this->forShare->append($table_name);
$this->forShare->append($tableName);
}

return $this;
Expand Down
30 changes: 15 additions & 15 deletions libraries/joomla/facebook/object.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,21 +160,21 @@ public function get($object)
/**
* Method to get object's connection.
*
* @param string $object The object id.
* @param string $connection The object's connection name.
* @param string $extra_fields URL fields.
* @param integer $limit The number of objects per page.
* @param integer $offset The object's number on the page.
* @param string $until A unix timestamp or any date accepted by strtotime.
* @param string $since A unix timestamp or any date accepted by strtotime.
* @param string $object The object id.
* @param string $connection The object's connection name.
* @param string $extraFields URL fields.
* @param integer $limit The number of objects per page.
* @param integer $offset The object's number on the page.
* @param string $until A unix timestamp or any date accepted by strtotime.
* @param string $since A unix timestamp or any date accepted by strtotime.
*
* @return mixed The decoded JSON response or false if the client is not authenticated.
*
* @since 3.2.0
*/
public function getConnection($object, $connection = null, $extra_fields = '', $limit = 0, $offset = 0, $until = null, $since = null)
public function getConnection($object, $connection = null, $extraFields = '', $limit = 0, $offset = 0, $until = null, $since = null)
{
$path = $object . '/' . $connection . $extra_fields;
$path = $object . '/' . $connection . $extraFields;

if ($this->oauth != null)
{
Expand Down Expand Up @@ -241,26 +241,26 @@ public function createConnection($object, $connection = null, $parameters = null
/**
* Method to delete a connection.
*
* @param string $object The object id.
* @param string $connection The object's connection name.
* @param string $extra_fields URL fields.
* @param string $object The object id.
* @param string $connection The object's connection name.
* @param string $extraFields URL fields.
*
* @return mixed The decoded JSON response or false if the client is not authenticated.
*
* @since 3.2.0
*/
public function deleteConnection($object, $connection = null, $extra_fields = '')
public function deleteConnection($object, $connection = null, $extraFields = '')
{
if ($this->oauth->isAuthenticated())
{
// Build the request path.
if ($connection != null)
{
$path = $object . '/' . $connection . $extra_fields;
$path = $object . '/' . $connection . $extraFields;
}
else
{
$path = $object . $extra_fields;
$path = $object . $extraFields;
}

// Send the delete request.
Expand Down
18 changes: 9 additions & 9 deletions libraries/joomla/facebook/photo.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,20 @@ public function getTags($photo, $limit = 0, $offset = 0, $until = null, $since =
}

/**
* Method to tag one or more Users in a photo. $to or $tag_text required.
* Method to tag one or more Users in a photo. $to or $tagText required.
* Requires authentication and publish_stream permission, user_photos permission for private photos.
*
* @param string $photo The photo id.
* @param mixed $to ID of the User or an array of Users to tag in the photo: [{"id":"1234"}, {"id":"12345"}].
* @param string $tag_text A text string to tag.
* @param integer $x x coordinate of tag, as a percentage offset from the left edge of the picture.
* @param integer $y y coordinate of tag, as a percentage offset from the top edge of the picture.
* @param string $photo The photo id.
* @param mixed $to ID of the User or an array of Users to tag in the photo: [{"id":"1234"}, {"id":"12345"}].
* @param string $tagText A text string to tag.
* @param integer $x x coordinate of tag, as a percentage offset from the left edge of the picture.
* @param integer $y y coordinate of tag, as a percentage offset from the top edge of the picture.
*
* @return boolean Returns true if successful, and false otherwise.
*
* @since 3.2.0
*/
public function createTag($photo, $to = null, $tag_text = null, $x = null, $y = null)
public function createTag($photo, $to = null, $tagText = null, $x = null, $y = null)
{
// Set POST request parameters.
if (is_array($to))
Expand All @@ -172,9 +172,9 @@ public function createTag($photo, $to = null, $tag_text = null, $x = null, $y =
$data['to'] = $to;
}

if ($tag_text)
if ($tagText)
{
$data['tag_text'] = $tag_text;
$data['tag_text'] = $tagText;
}

if ($x)
Expand Down
Loading