Problem/Motivation

Since we don't support PHP5 #3053363: Remove support for PHP 5 in Drupal 8.8 we no longer need to maintain \Drupal\Component\Utility\Crypt::randomBytes()

Proposed resolution

Deprecate the method for removal in Drupal 9.

Remaining tasks

  1. Create change record - https://www.drupal.org/node/add/changenotice?field_project=3060&field_is...
  2. Add @deprecated to docblock
  3. Add @trigger_error() to code
  4. Remove all usages in core
  5. Add legacy test to ensure we don't break it for the remainder of Drupal 8 lifetime.

User interface changes

None

API changes

\Drupal\Component\Utility\Crypt::randomBytes() is deprecated

Data model changes

None

Release notes snippet

N/a

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

alexpott’s picture

Status: Postponed » Needs work

The blocker is in!

alexpott’s picture

alexpott’s picture

  1. +++ b/core/lib/Drupal/Component/Uuid/composer.json
    @@ -9,8 +9,7 @@
    -    "drupal/core-utility": "^8.2"
    

    This whole component is no longer dependent on anything now!

  2. +++ b/core/tests/Drupal/Tests/Component/Utility/CryptTest.php
    @@ -18,17 +18,11 @@ class CryptTest extends TestCase {
    -   * @see \Drupal\Tests\Component\Utility\CryptRandomFallbackTest::testRandomBytesFallback
    

    This test CryptRandomFallbackTest is not in the code base. It was removed in #3053363: Remove support for PHP 5 in Drupal 8.8

Status: Needs review » Needs work

The last submitted patch, 4: 3054311-4.patch, failed testing. View results

Berdir’s picture

Status: Needs work » Reviewed & tested by the community

Looks good.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 83bee34 and pushed to 8.8.x. Thanks!

  • catch committed 83bee34 on 8.8.x
    Issue #3054311 by alexpott: Deprecate \Drupal\Component\Utility\Crypt::...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Krzysztof Domański’s picture

Published CR.