Skip to content

Commit

Permalink
https://github.com/mage2pro/core/issues/379
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Jun 5, 2024
1 parent 3625a26 commit c61392c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/code/local/Df/Core/lib/text/prepend-append.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ function df_pad($phrase, $length, $pattern = ' ', $position = STR_PAD_RIGHT) {/*
/** @var int $left_pad */ /** @var int $right_pad */
switch ($position) {
case STR_PAD_RIGHT:
list($left_pad, $right_pad) = [0, $num_pad_chars];
# 2024-06-06 "Use the «Symmetric array destructuring» PHP 7.1 feature": https://github.com/mage2pro/core/issues/379
[$left_pad, $right_pad] = [0, $num_pad_chars];
break;
case STR_PAD_LEFT:
list($left_pad, $right_pad) = [$num_pad_chars, 0];
# 2024-06-06 "Use the «Symmetric array destructuring» PHP 7.1 feature": https://github.com/mage2pro/core/issues/379
[$left_pad, $right_pad] = [$num_pad_chars, 0];
break;
case STR_PAD_BOTH:
$left_pad = floor($num_pad_chars / 2);
Expand Down

0 comments on commit c61392c

Please sign in to comment.