Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Several small refactorings. #1171

Merged
merged 8 commits into from

2 participants

@simonharrer

Several small refactorings. For more details, see the commit messages.

@LouisLandry

Thanks for this. Some good catches. There's one code style issue to clean up. http://developer.joomla.org/pulls/pulls/1171.html

Get that sorted out and we'll get it merged. Thanks again!

@simonharrer

How can I re-execute the checkstyle checks for this pull request?

@LouisLandry

It automatically happens. Thanks!

@LouisLandry LouisLandry merged commit 7f7d459 into joomla:staging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
1  libraries/joomla/client/ldap.php
@@ -628,6 +628,7 @@ public static function generatePassword($password, $type = 'md5')
{
case 'sha':
$userpassword = '{SHA}' . base64_encode(pack('H*', sha1($password)));
+ break;
case 'md5':
default:
$userpassword = '{MD5}' . base64_encode(pack('H*', md5($password)));
View
1  libraries/joomla/database/driver/oracle.php
@@ -255,7 +255,6 @@ public function getTableKeys($table)
{
$this->connect();
- $keys = array();
$query = $this->getQuery(true);
$fieldCasing = $this->getOption(PDO::ATTR_CASE);
View
6 libraries/joomla/form/fields/password.php
@@ -48,9 +48,6 @@ protected function getInput()
$meter = ((string) $this->element['strengthmeter'] == 'true');
$threshold = $this->element['threshold'] ? (int) $this->element['threshold'] : 66;
- // Initialize JavaScript field attributes.
- $onchange = $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
-
$script = '';
if ($meter)
{
@@ -65,9 +62,6 @@ protected function getInput()
);</script>';
}
- // Initialize JavaScript field attributes.
- $onchange = $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
-
return '<input type="password" name="' . $this->name . '" id="' . $this->id . '"' .
' value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' .
$auto . $class . $readonly . $disabled . $size . $maxLength . '/>' . $script;
View
12 libraries/joomla/form/form.php
@@ -308,7 +308,7 @@ public function getFieldAttribute($name, $attribute, $default = null, $group = n
// Make sure there is a valid JForm XML document.
if (!($this->xml instanceof SimpleXMLElement))
{
- throw new UnexpectedValueException(sprint('%s::getFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this)));
+ throw new UnexpectedValueException(sprintf('%s::getFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this)));
}
// Find the form field element from the definition.
@@ -791,7 +791,7 @@ public function removeField($name, $group = null)
// Make sure there is a valid JForm XML document.
if (!($this->xml instanceof SimpleXMLElement))
{
- throw new UnexpectedValueException(sprint('%s::getFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this)));
+ throw new UnexpectedValueException(sprintf('%s::getFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this)));
}
// Find the form field element from the definition.
@@ -822,7 +822,7 @@ public function removeGroup($group)
// Make sure there is a valid JForm XML document.
if (!($this->xml instanceof SimpleXMLElement))
{
- throw new UnexpectedValueException(sprint('%s::getFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this)));
+ throw new UnexpectedValueException(sprintf('%s::getFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this)));
}
// Get the fields elements for a given group.
@@ -878,7 +878,7 @@ public function setField(SimpleXMLElement $element, $group = null, $replace = tr
// Make sure there is a valid JForm XML document.
if (!($this->xml instanceof SimpleXMLElement))
{
- throw new UnexpectedValueException(sprint('%s::getFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this)));
+ throw new UnexpectedValueException(sprintf('%s::getFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this)));
}
// Find the form field element from the definition.
@@ -940,7 +940,7 @@ public function setFieldAttribute($name, $attribute, $value, $group = null)
// Make sure there is a valid JForm XML document.
if (!($this->xml instanceof SimpleXMLElement))
{
- throw new UnexpectedValueException(sprint('%s::getFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this)));
+ throw new UnexpectedValueException(sprintf('%s::getFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this)));
}
// Find the form field element from the definition.
@@ -982,7 +982,7 @@ public function setFields(&$elements, $group = null, $replace = true)
// Make sure there is a valid JForm XML document.
if (!($this->xml instanceof SimpleXMLElement))
{
- throw new UnexpectedValueException(sprint('%s::getFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this)));
+ throw new UnexpectedValueException(sprintf('%s::getFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this)));
}
// Make sure the elements to set are valid.
View
4 libraries/joomla/form/helper.php
@@ -105,7 +105,6 @@ protected static function loadType($entity, $type, $new = true)
// Initialize variables.
$key = md5($type);
- $class = '';
// Return an entity object if it already exists and we don't need a new one.
if (isset($types[$key]) && $new === false)
@@ -113,7 +112,8 @@ protected static function loadType($entity, $type, $new = true)
return $types[$key];
}
- if (($class = self::loadClass($entity, $type)) !== false)
+ $class = self::loadClass($entity, $type);
+ if ($class !== false)
{
// Instantiate a new type object.
$types[$key] = new $class;
View
4 libraries/joomla/html/html/rules.php
@@ -66,9 +66,9 @@ public static function assetFormWidget($actions, $assetId = null, $parent = null
{
$html[] = ' <tr class="row' . ($i % 2) . '">';
$html[] = ' <td class="col1">' . $group->text . '</td>';
- foreach ($actions as $i => $action)
+ foreach ($actions as $j => $action)
{
- $html[] = ' <td class="col' . ($i + 2) . '">'
+ $html[] = ' <td class="col' . ($j + 2) . '">'
. ($assetId ? ($inherited->allow($action->name, $group->identities) ? $images['allow'] : $images['deny'])
: ($inheriting->allow($action->name, $group->identities) ? $images['allow'] : $images['deny'])) . '</td>';
}
View
2  libraries/joomla/table/table.php
@@ -1008,8 +1008,6 @@ public function reorder($where = '')
if (!property_exists($this, 'ordering'))
{
throw new UnexpectedValueException(sprintf('%s does not support ordering.', get_class($this)));
- $this->setError($e);
- return false;
}
// Initialise variables.
Something went wrong with that request. Please try again.