Skip to content

Commit

Permalink
Varien - fixes
Browse files Browse the repository at this point in the history
- reverts change from review
- reverts some code style changes
- adds/fixed some methods/return types
  • Loading branch information
sreichel committed Jun 5, 2019
1 parent a7b2d99 commit 627c3f9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 22 deletions.
14 changes: 7 additions & 7 deletions lib/Varien/Data/Collection/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public function setOrder($field, $direction = self::SORT_ORDER_DESC)
*
* @param string $field
* @param string $direction
* @return Varien_Data_Collection_Db
* @return $this
*/
public function addOrder($field, $direction = self::SORT_ORDER_DESC)
{
Expand All @@ -290,7 +290,7 @@ public function addOrder($field, $direction = self::SORT_ORDER_DESC)
*
* @param string $field
* @param string $direction
* @return Varien_Data_Collection_Db
* @return $this
*/
public function unshiftOrder($field, $direction = self::SORT_ORDER_DESC)
{
Expand Down Expand Up @@ -327,7 +327,7 @@ private function _setOrder($field, $direction, $unshift = false)
/**
* Render sql select conditions
*
* @return Varien_Data_Collection_Db
* @return $this
*/
protected function _renderFilters()
{
Expand Down Expand Up @@ -500,7 +500,7 @@ protected function _getConditionFieldName($fieldName)
/**
* Render sql select orders
*
* @return Varien_Data_Collection_Db
* @return $this
*/
protected function _renderOrders()
{
Expand All @@ -517,7 +517,7 @@ protected function _renderOrders()
/**
* Render sql select limit
*
* @return Varien_Data_Collection_Db
* @return $this
*/
protected function _renderLimit()
{
Expand All @@ -533,7 +533,7 @@ protected function _renderLimit()
*
* @param bool $flag
*
* @return Varien_Data_Collection_Db
* @return $this
*/
public function distinct($flag)
{
Expand All @@ -544,7 +544,7 @@ public function distinct($flag)
/**
* Before load action
*
* @return Varien_Data_Collection_Db
* @return $this
*/
protected function _beforeLoad()
{
Expand Down
10 changes: 6 additions & 4 deletions lib/Varien/Data/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
* @method string getHtmlIdPrefix()
* @method string getHtmlIdSuffix()
* @method string getFieldNameSuffix()
* @method setDataObject(Mage_Core_Model_Abstract $value)
* @method $this setFieldNameSuffix(string $value)
*/
class Varien_Data_Form extends Varien_Data_Form_Abstract
{
Expand Down Expand Up @@ -129,7 +131,7 @@ public function getHtmlAttributes()
* @return Varien_Data_Form
* @throws Exception
*/
public function addElement(Varien_Data_Form_Element_Abstract $element, $after = false)
public function addElement(Varien_Data_Form_Element_Abstract $element, $after=false)
{
$this->checkElementId($element->getId());
parent::addElement($element, $after);
Expand Down Expand Up @@ -167,7 +169,7 @@ public function addElementToCollection($element)
public function checkElementId($elementId)
{
if ($this->_elementIdExists($elementId)) {
throw new Exception('Element with id "' . $elementId . '" already exists');
throw new Exception('Element with id "'.$elementId.'" already exists');
}
return true;
}
Expand Down Expand Up @@ -302,10 +304,10 @@ public function toHtml()
Varien_Profiler::start('form/toHtml');
$html = '';
if ($useContainer = $this->getUseContainer()) {
$html .= '<form ' . $this->serialize($this->getHtmlAttributes()) . '>';
$html .= '<form '.$this->serialize($this->getHtmlAttributes()).'>';
$html .= '<div>';
if (strtolower($this->getData('method')) == 'post') {
$html .= '<input name="form_key" type="hidden" value="' . Mage::getSingleton('core/session')->getFormKey() . '" />';
$html .= '<input name="form_key" type="hidden" value="'.Mage::getSingleton('core/session')->getFormKey().'" />';
}
$html .= '</div>';
}
Expand Down
5 changes: 0 additions & 5 deletions lib/Varien/Data/Form/Element/Fieldset.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ class Varien_Data_Form_Element_Fieldset extends Varien_Data_Form_Element_Abstrac
*/
protected $_sortChildrenByKey = '';

/**
* @var string
*/
protected $_sortDirection = '';

/**
* Children sort direction
*
Expand Down
11 changes: 6 additions & 5 deletions lib/Varien/Db/Adapter/Pdo/Mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ public function multi_query($sql)
/**
* Split multi statement query
*
* @param $sql string
* @param string $sql
* @return array
*/
protected function _splitMultiQuery($sql)
Expand Down Expand Up @@ -847,9 +847,9 @@ public function purgeOrphanRecords($tableName, $columnName, $refTableName, $refC
* @deprecated since 1.4.0.1
* @param string $fkName foreign key name
* @param string $tableName main table name
* @param string $keyName main table field name
* @param string $columnName main table field name
* @param string $refTableName refered table name
* @param string $refKeyName refered table field name
* @param string $refColumnName refered table field name
* @param string $onUpdate on update statement
* @param string $onDelete on delete statement
* @param bool $purge
Expand Down Expand Up @@ -2973,7 +2973,7 @@ public function prepareSqlCondition($fieldName, $condition)
/**
* Prepare Sql condition
*
* @param $text Condition value
* @param string $text Condition value
* @param mixed $value
* @param string $fieldName
* @return string
Expand Down Expand Up @@ -3094,6 +3094,7 @@ public function prepareColumnValue(array $column, $value)
* @param Zend_Db_Expr|Zend_Db_Select|string $expression
* @param string $true true value
* @param string $false false value
* @return Zend_Db_Expr
*/
public function getCheckSql($expression, $true, $false)
{
Expand All @@ -3110,7 +3111,7 @@ public function getCheckSql($expression, $true, $false)
* Returns valid IFNULL expression
*
* @param Zend_Db_Expr|Zend_Db_Select|string $expression
* @param string $value OPTIONAL. Applies when $expression is NULL
* @param string|int $value OPTIONAL. Applies when $expression is NULL
* @return Zend_Db_Expr
*/
public function getIfNullSql($expression, $value = 0)
Expand Down
2 changes: 1 addition & 1 deletion lib/Varien/Db/Statement/Pdo/Mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function _executeWithBinding(array $params)
}
}

/* @var $statement PDOStatement */
/* @var PDOStatement $statement */
$statement = $this->_stmt;
$bindValues = array(); // Separate array with values, as they are bound by reference
foreach ($params as $name => $param) {
Expand Down

0 comments on commit 627c3f9

Please sign in to comment.