paragonie / random_compat

PHP 5.x support for random_bytes() and random_int()
https://paragonie.com/projects
MIT License
8.16k stars 145 forks source link

PHP 7.2 compatibility #162

Closed shital7mahajan closed 3 years ago

shital7mahajan commented 5 years ago

Hi,

I have run following PHPCS command and getting following error & warning:

$ phpcs --standard=PHPCompatibility --extensions=php,module,inc,install,test,profile,theme --runtime-set testVersion 7.2 .

FILE: paragonie\random_compat\lib\byte_safe_strings.php

FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES

32 | WARNING | INI directive 'mbstring.func_overload' is deprecated since PHP 7.2 86 | WARNING | INI directive 'mbstring.func_overload' is deprecated since PHP 7.2

FILE: paragonie\random_compat\lib\random_bytes_mcrypt.php

FOUND 3 ERRORS AFFECTING 1 LINE

58 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead 58 | ERROR | Function mcrypt_create_iv() is deprecated since PHP 7.1 and removed since PHP 7.2; Use random_bytes() or OpenSSL instead 58 | ERROR | The constant "MCRYPT_DEV_URANDOM" is deprecated since PHP 7.1 and removed since PHP 7.2

Any plan to resolve this?

PatrickRose commented 5 years ago

Why are you using a PHP7 polyfill when you're running PHP 7.2?

glensc commented 5 years ago

@shital7mahajan read phpcompatibility readme how to handle polyfills. no issue/bug in this project.

@PatrickRose likely the dependency comes from external project dependency, i.e using Symfony older branch whose minimum requirement is 5.6 for example.

paragonie-scott commented 4 years ago

Honestly, it shouldn't matter. PHPCS shouldn't be run on Composer dependencies.