Skip to content

Commit

Permalink
Merge pull request #857 from Flyingmana/patch-implode
Browse files Browse the repository at this point in the history
correct argument order of implode calls
  • Loading branch information
Flyingmana authored Jan 21, 2020
2 parents 25f17b0 + 7a01eb2 commit 8a99646
Show file tree
Hide file tree
Showing 23 changed files with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected function _actionsToHtml(array $actions = array())
$attributesObject->setData($action['@']);
$html[] = '<a ' . $attributesObject->serialize() . '>' . $action['#'] . '</a>';
}
return implode($html, '<span class="separator">|</span>');
return implode('<span class="separator">|</span>', $html);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Centinel/Model/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ protected function _getConfig()
*/
protected function _generateChecksum($paymentMethodCode, $cardType, $cardNumber, $cardExpMonth, $cardExpYear, $amount, $currencyCode)
{
return md5(implode(func_get_args(), '_'));
return md5(implode('_', func_get_args()));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Paygate/Model/Authorizenet.php
Original file line number Diff line number Diff line change
Expand Up @@ -1517,7 +1517,7 @@ protected function _generateChecksum(Varien_Object $object, $checkSumDataKeys =
$data[] = $dataKey;
$data[] = $object->getData($dataKey);
}
return md5(implode($data, '_'));
return md5(implode('_', $data));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ protected function _applyRulesFilter()
}

if (!empty($rulesFilterSqlParts)) {
$this->getSelect()->where(implode($rulesFilterSqlParts, ' OR '));
$this->getSelect()->where(implode(' OR ', $rulesFilterSqlParts));
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Tag/Block/Product/List.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function renderTags($pattern, $glue = ' ')
$tag->getTaggedProductsUrl(), $this->escapeHtml($tag->getName()), $tag->getProducts()
);
}
return implode($out, $glue);
return implode($glue, $out);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ protected function _parseXmlResponse($response)
if ($this->_rawRequest->getAction() == 'GenerateLabel') {
$result = new Varien_Object();
if (!empty($this->_errors)) {
$result->setErrors(implode($this->_errors, '; '));
$result->setErrors(implode('; ', $this->_errors));
} else {
if ($xml !== false) {
if ($r->getDestCountryId() == self::USA_COUNTRY_ID) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
$mapNew[] = $shippingMethod;
}
}
$mapNew = implode($mapNew, ',');
$mapNew = implode(',', $mapNew);
} else {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
$newValue[] = $oldToNewMethodCodesMap[$shippingMethod];
}
}
$newValue = implode($newValue, ',');
$newValue = implode(',', $newValue);
} else {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function addPaymentInfoToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $
'label' => $showCount ? $this->__('Credit Card %s', $key + 1) : $this->__('Credit Card')
));
foreach ($card as $label => $value) {
$creditCard->addCustomChild('item', implode($this->getValueAsArray($value, true), '\n'), array(
$creditCard->addCustomChild('item', implode('\n', $this->getValueAsArray($value, true)), array(
'label' => $label
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function addPaymentInfoToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $

if ($specificInfo = $this->getSpecificInformation()) {
foreach ($specificInfo as $label => $value) {
$orderItemXmlObj->addCustomChild('item', implode($this->getValueAsArray($value, true), '\n'), array(
$orderItemXmlObj->addCustomChild('item', implode('\n', $this->getValueAsArray($value, true)), array(
'label' => $label
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function addPaymentInfoToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $

if ($specificInfo = $this->getSpecificInformation()) {
foreach ($specificInfo as $label => $value) {
$orderItemXmlObj->addCustomChild('item', implode($this->getValueAsArray($value, true), '\n'), array(
$orderItemXmlObj->addCustomChild('item', implode('\n', $this->getValueAsArray($value, true)), array(
'label' => $label
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function addPaymentInfoToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $

if ($specificInfo = $this->getSpecificInformation()) {
foreach ($specificInfo as $label => $value) {
$orderItemXmlObj->addCustomChild('item', implode($this->getValueAsArray($value, true), '\n'), array(
$orderItemXmlObj->addCustomChild('item', implode('\n', $this->getValueAsArray($value, true)), array(
'label' => $label
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ protected function _addPaymentMethodInfoToXmlObj(Mage_XmlConnect_Model_Simplexml
if (!empty($specificInfo)) {
foreach ($specificInfo as $label => $value) {
if ($value) {
$paymentNode->addCustomChild('item',implode($this->getValueAsArray($value, true), '\n'), array(
$paymentNode->addCustomChild('item',implode('\n', $this->getValueAsArray($value, true)), array(
'label' => $label
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<?php foreach ($card as $_label => $_value):?>
<tr>
<td><?php echo $this->escapeHtml($_label)?>:</td>
<td><?php echo nl2br(implode($this->getValueAsArray($_value, true), "\n"))?></td>
<td><?php echo nl2br(implode("\n", $this->getValueAsArray($_value, true)))?></td>
</tr>
<?php endforeach; ?>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
<?php endif;?>

<?php foreach ($card as $_label => $_value):?>
<?php echo $_label ?>: <?php echo implode($this->getValueAsArray($_value), ' ')?>{{pdf_row_separator}}
<?php echo $_label ?>: <?php echo implode(' ', $this->getValueAsArray($_value))?>{{pdf_row_separator}}
<?php endforeach; ?>
<?php endforeach; ?>
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<?php foreach ($_specificInfo as $_label => $_value):?>
<tr>
<td><?php echo $this->escapeHtml($_label)?>:</td>
<td><?php echo nl2br(implode($this->getValueAsArray($_value, true), "\n"))?></td>
<td><?php echo nl2br(implode("\n", $this->getValueAsArray($_value, true)))?></td>
</tr>
<?php endforeach; ?>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@

<?php if ($_specificInfo = $this->getSpecificInformation()):?>
<?php foreach ($_specificInfo as $_label => $_value):?>
<?php echo $_label ?>: <?php echo implode($this->getValueAsArray($_value), ' ')?>{{pdf_row_separator}}
<?php echo $_label ?>: <?php echo implode(' ', $this->getValueAsArray($_value))?>{{pdf_row_separator}}
<?php endforeach; ?>
<?php endif;?>

<?php echo implode($this->getChildPdfAsArray(), '{{pdf_row_separator}}') ?>
<?php echo implode('{{pdf_row_separator}}', $this->getChildPdfAsArray()) ?>
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<?php foreach ($card as $_label => $_value):?>
<tr>
<th><?php echo $this->escapeHtml($_label)?>:</th>
<td><?php echo nl2br(implode($this->getValueAsArray($_value, true), "\n"))?></td>
<td><?php echo nl2br(implode("\n", $this->getValueAsArray($_value, true)))?></td>
</tr>
<?php endforeach; ?>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<th><strong><?php echo $this->escapeHtml($_label)?>:</strong></th>
</tr>
<tr>
<td><?php echo nl2br(implode($this->getValueAsArray($_value, true), "\n"))?></td>
<td><?php echo nl2br(implode("\n", $this->getValueAsArray($_value, true)))?></td>
</tr>
<?php endforeach; ?>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<dl class="payment-info">
<?php foreach ($_specificInfo as $_label => $_value):?>
<dt><?php echo $this->escapeHtml($_label)?></dt>
<dd><?php echo nl2br(implode($this->getValueAsArray($_value, true), "\n"))?></dd>
<dd><?php echo nl2br(implode("\n", $this->getValueAsArray($_value, true)))?></dd>
<?php endforeach; ?>
</dl>
<?php endif;?>
Expand Down
14 changes: 7 additions & 7 deletions lib/Credis/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class Credis_Client {
* @var string
*/
protected $host;

/**
* Port on which the Redis server is running
* @var integer
Expand Down Expand Up @@ -269,12 +269,12 @@ class Credis_Client {
* @var int
*/
protected $requests = 0;

/**
* @var bool
*/
protected $subscribed = false;


/**
* Creates a Redisent connection to the Redis server on host {@link $host} and port {@link $port}.
Expand Down Expand Up @@ -305,15 +305,15 @@ public function __destruct()
$this->close();
}
}

/**
* @return bool
*/
public function isSubscribed()
{
return $this->subscribed;
}

/**
* Return the host of the Redis instance
* @return string
Expand Down Expand Up @@ -600,7 +600,7 @@ public function select($index)
$this->selectedDb = (int) $index;
return $response;
}

/**
* @param string|array $pattern
* @return array
Expand Down Expand Up @@ -1139,7 +1139,7 @@ protected function read_reply($name = '')
*/
private static function _prepare_command($args)
{
return sprintf('*%d%s%s%s', count($args), CRLF, implode(array_map(array('self', '_map'), $args), CRLF), CRLF);
return sprintf('*%d%s%s%s', count($args), CRLF, implode(CRLF, array_map(array('self', '_map'), $args)), CRLF);
}

private static function _map($arg)
Expand Down
2 changes: 1 addition & 1 deletion lib/phpseclib/File/ASN1.php
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ function _encode_der($source, $mapping, $idx = null, $special = array())
if ($mapping['type'] == self::TYPE_SET) {
sort($value);
}
$value = implode($value, '');
$value = implode('', $value);
break;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/phpseclib/Math/BigInteger.php
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ function __debugInfo()
$opts[] = 'OpenSSL';
}
if (!empty($opts)) {
$engine.= ' (' . implode($opts, ', ') . ')';
$engine.= ' (' . implode(', ', $opts) . ')';
}
return array(
'value' => '0x' . $this->toHex(true),
Expand Down

0 comments on commit 8a99646

Please sign in to comment.