CC-4090: Make code style PSR compliant - part 4

-forms directory
This commit is contained in:
Martin Konecny 2012-08-28 23:04:55 -04:00
parent 481616a0d6
commit b2327472e8
29 changed files with 505 additions and 519 deletions

View file

@ -3,8 +3,8 @@
/**
* Check if a field is empty but only when specific fields have specific values
*/
class ConditionalNotEmpty extends Zend_Validate_Abstract {
class ConditionalNotEmpty extends Zend_Validate_Abstract
{
const KEY_IS_EMPTY = 'keyIsEmpty';
protected $_messageTemplates = array(
@ -32,8 +32,8 @@ class ConditionalNotEmpty extends Zend_Validate_Abstract {
* this function returns true if the expected values doesn't match the actual user input,
* or if $value is not empty. Returns false otherwise.
*
* @param String $value - this field's value
* @param array $context - names and values of the rest of the fields in this form
* @param String $value - this field's value
* @param array $context - names and values of the rest of the fields in this form
* @return boolean - true if valid; false otherwise
*/
public function isValid($value, $context = null)
@ -43,7 +43,7 @@ class ConditionalNotEmpty extends Zend_Validate_Abstract {
}
if (is_array($context)) {
foreach($this->_fieldValues as $fieldName=>$fieldValue) {
foreach ($this->_fieldValues as $fieldName=>$fieldValue) {
if (!isset($context[$fieldName]) || $context[$fieldName] != $fieldValue) {
return true;
}
@ -55,8 +55,7 @@ class ConditionalNotEmpty extends Zend_Validate_Abstract {
}
$this->_error(self::KEY_IS_EMPTY);
return false;
}
}
?>

View file

@ -1,6 +1,7 @@
<?php
class PasswordNotEmpty extends ConditionalNotEmpty {
class PasswordNotEmpty extends ConditionalNotEmpty
{
public function isValid($value, $context = null)
{
$result = parent::isValid($value, $context);
@ -11,8 +12,7 @@ class PasswordNotEmpty extends ConditionalNotEmpty {
return true;
}
}
return $result;
}
}
?>