Skip to content

Commit e018208

Browse files
committed
Update PHPDoc for patch commands
- Remove extra spaces in `cache patch` PHPDoc annotation - Specify default value for `expiration` argument in `transient patch` PHPDoc annotation
1 parent b663d43 commit e018208

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/Cache_Command.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,10 +499,10 @@ function ( $key ) {
499499
* ---
500500
*
501501
* [--expiration=<expiration>]
502-
* : Define how long to keep the value, in seconds. `0` means as long as possible.
503-
* ---
504-
* default: 0
505-
* ---
502+
* : Define how long to keep the value, in seconds. `0` means as long as possible.
503+
* ---
504+
* default: 0
505+
* ---
506506
*
507507
* [--format=<format>]
508508
* : The serialization format for the value.

src/Transient_Command.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,9 @@ function ( $key ) {
497497
*
498498
* [--expiration=<expiration>]
499499
* : Time until expiration, in seconds.
500+
* ---
501+
* default: 0
502+
* ---
500503
*
501504
* [--network]
502505
* : Get the value of a network|site transient. On single site, this is
@@ -505,7 +508,7 @@ function ( $key ) {
505508
*/
506509
public function patch( $args, $assoc_args ) {
507510
list( $action, $key ) = $args;
508-
$expiration = (int) Utils\get_flag_value( $assoc_args, 'expiration', 0 );
511+
$expiration = (int) Utils\get_flag_value( $assoc_args, 'expiration' );
509512

510513
$read_func = Utils\get_flag_value( $assoc_args, 'network' ) ? 'get_site_transient' : 'get_transient';
511514
$write_func = Utils\get_flag_value( $assoc_args, 'network' ) ? 'set_site_transient' : 'set_transient';

0 commit comments

Comments
 (0)