[wp-trac] [WordPress Trac] #63497: Docs: Fix parameter order mismatch in wp_cache_cas_by_key()

WordPress Trac noreply at wordpress.org
Wed May 28 13:41:17 UTC 2025


#63497: Docs: Fix parameter order mismatch in wp_cache_cas_by_key()
-----------------------------------------+---------------------
 Reporter:  truptikanzariya              |       Owner:  (none)
     Type:  defect (bug)                 |      Status:  new
 Priority:  normal                       |   Milestone:  6.9
Component:  Build/Test Tools             |     Version:
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch changes-requested  |     Focuses:  docs
-----------------------------------------+---------------------
Changes (by sabernhardt):

 * keywords:  has-patch commit => has-patch changes-requested
 * focuses:   => docs


Old description:

> 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...

New description:

 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...

--

Comment:

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

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63497#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list