impress-org / givewp

GiveWP - The #1 Donation Plugin for WordPress. Easily accept donations and fundraise using your WordPress website.
https://givewp.com/
GNU General Public License v3.0
345 stars 191 forks source link

Str::reverse() does not support PHP 7.0 #6772

Closed kjohnson closed 1 year ago

kjohnson commented 1 year ago

Details

The Str helper method reverse uses the function mb_str_split, which requires PHP 7 >= 7.4.0, PHP 8.

FILE: .../runner/work/givewp/givewp/src/Framework/Support/Facades/Str.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 565 | ERROR | The function mb_str_split() is not present in PHP
     |       | version 7.3 or earlier
----------------------------------------------------------------------
class Str
{
    public static function reverse($value)
    {
        return implode(array_reverse(mb_str_split($value)));
    }
}
kjohnson commented 1 year ago

We could either require polyfill-mbstring as a dependency or remove the Str::reverse method, which isn't currently being used anywhere.