Make WordPress Core

Opened 8 weeks ago

Closed 7 weeks ago

#63497 closed defect (bug) (fixed)

Docs: Fix parameter order mismatch in wp_cache_cas_by_key()

Reported by: truptikanzariya's profile truptikanzariya Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.9 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch
Focuses: docs Cc:

Description (last modified by sabernhardt)

There is a parameter order mismatch in the PHPDoc block for the wp_cache_cas_by_key() function.

Affected File : /tests/phpunit/includes/object-cache.php

Issue

The function signature is: function wp_cache_cas_by_key( $cas_token, $server_key, $key, $value, $group = '', $expiration = 0 )

But the PHPDoc states:

 * @param string $server_key The key identifying the server to store the value on.
 * @param float  $cas_token  Unique value associated with the existing item. Generated by memcached.

Proposed Fix:
The PHPDoc should be updated to:

 * @param float  $cas_token  Unique value associated with the existing item. Generated by memcached.
 * @param string $server_key The key identifying the server to store the value on.

Thank you...

Attachments (3)

63497.patch (1.7 KB) - added by truptikanzariya 8 weeks ago.
63497.2.patch (2.9 KB) - added by rutvikbhambhi2004 7 weeks ago.
New Patch is here
63497.3.patch (4.7 KB) - added by nareshbheda 7 weeks ago.
The replace() function also reverses $server_key, $key, $value, $group, $by_key, and $expiration, on lines 1932 to 1937 of the same file.

Download all attachments as: .zip

Change History (7)

#1 @mukesh27
8 weeks ago

  • Component changed from Cache API to Build/Test Tools
  • Keywords commit added
  • Milestone changed from Awaiting Review to 6.9

Hi there!

Nice catch!

#2 @sabernhardt
8 weeks ago

  • Description modified (diff)
  • Focuses docs added
  • Keywords changes-requested added; commit removed

The casByKey() function also reverses $server_key and $cas_token, on lines 1241 to 1242 of the same file.

@rutvikbhambhi2004
7 weeks ago

New Patch is here

@nareshbheda
7 weeks ago

The replace() function also reverses $server_key, $key, $value, $group, $by_key, and $expiration, on lines 1932 to 1937 of the same file.

#3 @sabernhardt
7 weeks ago

  • Keywords changes-requested removed

#4 @SergeyBiryukov
7 weeks ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 60270:

Docs: Correct the order of parameters in some cache functions used by unit tests.

Follow-up to [40561].

Props truptikanzariya, rutvikbhambhi2004, nareshbheda, sabernhardt, mukesh27.
Fixes #63497.

Note: See TracTickets for help on using tickets.