Skip to content

Commit fdc5c32

Browse files
committed
fix: Add type hints to granular cache flush methods
Add array<string> type hints to method parameters for PHPStan compliance.
1 parent bcdeeca commit fdc5c32

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎src/Cache_Command.php‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ function ( $key ) {
632632
* $ wp cache flush-post 123
633633
* Success: Post cache for ID 123 cleared.
634634
*
635-
* @param array $args Positional arguments.
635+
* @param array<string> $args Positional arguments.
636636
*/
637637
public function flush_post( $args ) {
638638
$post_id = ! empty( $args ) ? (int) $args[0] : null;
@@ -667,7 +667,7 @@ public function flush_post( $args ) {
667667
* $ wp cache flush-term 5
668668
* Success: Term cache for ID 5 cleared.
669669
*
670-
* @param array $args Positional arguments.
670+
* @param array<string> $args Positional arguments.
671671
*/
672672
public function flush_term( $args ) {
673673
$term_id = ! empty( $args ) ? (int) $args[0] : null;
@@ -702,7 +702,7 @@ public function flush_term( $args ) {
702702
* $ wp cache flush-comment 42
703703
* Success: Comment cache for ID 42 cleared.
704704
*
705-
* @param array $args Positional arguments.
705+
* @param array<string> $args Positional arguments.
706706
*/
707707
public function flush_comment( $args ) {
708708
$comment_id = ! empty( $args ) ? (int) $args[0] : null;
@@ -737,7 +737,7 @@ public function flush_comment( $args ) {
737737
* $ wp cache flush-user 1
738738
* Success: User cache for ID 1 cleared.
739739
*
740-
* @param array $args Positional arguments.
740+
* @param array<string> $args Positional arguments.
741741
*/
742742
public function flush_user( $args ) {
743743
$user_id = ! empty( $args ) ? (int) $args[0] : null;
@@ -772,7 +772,7 @@ public function flush_user( $args ) {
772772
* $ wp cache flush-option my_option
773773
* Success: Option cache for 'my_option' cleared.
774774
*
775-
* @param array $args Positional arguments.
775+
* @param array<string> $args Positional arguments.
776776
*/
777777
public function flush_option( $args ) {
778778
$option_name = ! empty( $args ) ? $args[0] : null;

0 commit comments

Comments
 (0)