WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 7 months ago

#42227 closed defect (bug) (fixed)

PHPDoc correction for src/wp-admin/includes/class-wp-filesystem-base.php

Reported by: Jaydeep Rami Owned by: SergeyBiryukov
Milestone: 5.2 Priority: normal
Severity: normal Version: 4.9
Component: Filesystem API Keywords: has-patch needs-testing
Focuses: docs Cc:
PR Number:

Description

There are a wrong argument type in PHPDoc. Below is file path:

/wp-admin/includes/class-wp-filesystem-base.php

Thanks,

Attachments (3)

42227.patch (2.2 KB) - added by Jaydeep Rami 2 years ago.
Fixed: PHPDoc correction for src/wp-admin/includes/class-wp-filesystem-base.php
42227-2.patch (2.0 KB) - added by man4toman 7 months ago.
42227-3.patch (6.3 KB) - added by man4toman 7 months ago.

Download all attachments as: .zip

Change History (12)

@Jaydeep Rami
2 years ago

Fixed: PHPDoc correction for src/wp-admin/includes/class-wp-filesystem-base.php

#1 follow-up: @SergeyBiryukov
2 years ago

  • Component changed from General to Filesystem API

Hi Jaydeep, thanks for the patch!

The existing docs for these arguments are correct, it's just that default values don't match the expected type.

  • $theme should either be documented as string|false, or the default value should be changed to an empty string, here and and in get_theme_root() as well.
  • $mode should be documented as int|false, here and in other class-wp-filesystem-*.php files as well.
Version 0, edited 2 years ago by SergeyBiryukov (next)

#2 in reply to: ↑ 1 @Jaydeep Rami
2 years ago

Replying to SergeyBiryukov: Thank you @SergeyBiryukov, I understood. Thanks for the explanation!

Hi Jaydeep, thanks for the patch!

The existing docs for these arguments are correct, it's just that default values don't match the expected type.

  • $theme should either be documented as string|false, or the default value should be changed to an empty string, here and and in get_theme_root() as well.
  • $mode should be documented as int|false, here and in other class-wp-filesystem-*.php files as well.

#3 @SergeyBiryukov
8 months ago

  • Milestone changed from Awaiting Review to 5.2
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

Related: #46779

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


8 months ago

#5 @audrasjb
8 months ago

  • Keywords has-patch needs-refresh added

As per today's bug scrub, the patch needs a refresh to land in 5.2.

Cheers,
Jb

@man4toman
7 months ago

#6 @man4toman
7 months ago

  • Keywords needs-testing added; needs-refresh removed

@man4toman
7 months ago

#7 @man4toman
7 months ago

$mode should be documented as int|false, here and in other class-wp-filesystem-*.php files as well.

If I understand it correctly, the third patch must be OK.

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


7 months ago

#9 @SergeyBiryukov
7 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 45226:

Docs: Improve documentation for various WP_Filesystem_Base methods and extending classes.

Props jaydeep-rami, man4toman, SaeedFard, mukesh27, mohadeseghasemi, ebrahimzadeh, juiiee8487, SergeyBiryukov.
Fixes #42227, #46806, #46840. See #46543.

Note: See TracTickets for help on using tickets.