diff --git a/recipe/magento2.php b/recipe/magento2.php index ca1b19f2d..bc2e97f80 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -10,6 +10,8 @@ use Deployer\Exception\RunException; use Deployer\Host\Host; +use function Deployer\Support\array_is_list; + const CONFIG_IMPORT_NEEDED_EXIT_CODE = 2; const DB_UPDATE_NEEDED_EXIT_CODE = 2; const MAINTENANCE_MODE_ACTIVE_OUTPUT_MSG = 'maintenance mode is active'; diff --git a/src/Support/helpers.php b/src/Support/helpers.php index cdda3ff10..b6251f7bd 100644 --- a/src/Support/helpers.php +++ b/src/Support/helpers.php @@ -65,6 +65,18 @@ function array_merge_alternate(array $original, array $override) return $original; } +/** + * Polyfill for the array_is_list function introduced in PHP 8.1. + * + * @param array $array The array to check. + * @return bool Returns true if the array is a list, false otherwise. + */ +function array_is_list(array $array): bool +{ + $keys = array_keys($array); + return $keys === array_keys($keys); +} + /** * Determines if the given string contains the given value. */