Skip to content

Commit

Permalink
php 7.2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
wernerkrauss committed Sep 11, 2018
1 parent fa6fd63 commit 1609669
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions code/cart/ShoppingCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,9 @@ protected static function build_url($action, $buyable, $params = array())
*
* you will need to decode the url with javascript before using it.
*/
protected static function params_to_get_string($array)
protected static function params_to_get_string(array $array)
{
if ($array & count($array > 0)) {
if ($array && count($array) > 0) {
array_walk($array, create_function('&$v,$k', '$v = $k."=".$v ;'));
return "?" . implode("&", $array);
}
Expand Down
2 changes: 1 addition & 1 deletion code/cms/ShopConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function getCountriesList($prefixisocode = false)
asort($countries);
if ($allowed = $this->owner->AllowedCountries) {
$allowed = explode(",", $allowed);
if (count($allowed > 0)) {
if (count($allowed) > 0) {
$countries = array_intersect_key($countries, array_flip($allowed));
}
}
Expand Down
2 changes: 1 addition & 1 deletion code/model/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public function getDefaultSearchContext()
/**
* Hack for swapping out relation list with OrderItemList
*/
public function getComponents($componentName, $filter = "", $sort = "", $join = "", $limit = null)
public function getComponents($componentName, $filter = null, $sort = null, $join = null, $limit = null)
{
$components = parent::getComponents($componentName, $filter = "", $sort = "", $join = "", $limit = null);
if ($componentName === "Items" && get_class($components) !== "UnsavedRelationList") {
Expand Down
4 changes: 2 additions & 2 deletions code/product/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,9 @@ public function isOrphaned()
return false;
}

public function Link()
public function Link($action = null)
{
$link = parent::Link();
$link = parent::Link($action);
$this->extend('updateLink', $link);
return $link;
}
Expand Down

0 comments on commit 1609669

Please sign in to comment.