-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
PHP Version
8.3
CodeIgniter4 Version
4.6.4
CodeIgniter4 Installation Method
Composer (using codeigniter4/appstarter)
Which operating systems have you tested for this bug?
macOS
Which server did you use?
apache
Database
No response
What happened?
The random_string text helper (docs) is incorrectly marked as deprecated. Because of this, PHP Intelephense in VS Code shows the use of random_string as deprecated. Even though none of the deprecated types are used.
Only the type 'basic', 'md5', and 'sha1' are deprecated because they are not cryptographically secure. The random_string function itself is not deprecated.
Code:
CodeIgniter4/system/Helpers/text_helper.php
Line 551 in e56ba93
| * @deprecated The type 'basic', 'md5', and 'sha1' are deprecated. They are not cryptographically secure. |
The @deprecated tag is used to indicate which Structural Elements are deprecated and are to be removed in a future version.
https://docs.phpdoc.org/guide/references/phpdoc/tags/deprecated.html#deprecated
https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc-tags.md#54-deprecated
Steps to Reproduce
Add this code to a CI4 project:
$newHash = random_string('crypto', 10);
Expected Output
Not deprecated
Anything else?
No response