Make WordPress Core

Opened 7 years ago

Closed 5 years ago

#42227 closed defect (bug) (fixed)

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

Reported by: jaydeep-rami's profile Jaydeep Rami Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.2 Priority: normal
Severity: normal Version: 4.9
Component: Filesystem API Keywords: has-patch needs-testing
Focuses: docs Cc:

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 7 years ago.
Fixed: PHPDoc correction for src/wp-admin/includes/class-wp-filesystem-base.php
42227-2.patch (2.0 KB) - added by man4toman 5 years ago.
42227-3.patch (6.3 KB) - added by man4toman 5 years ago.

Download all attachments as: .zip

Change History (12)

@Jaydeep Rami
7 years ago

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

#1 follow-up: @SergeyBiryukov
7 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 in get_theme_root() as well.
  • $mode should be documented as int|false, here and in other class-wp-filesystem-*.php files as well.
Last edited 6 years ago by SergeyBiryukov (previous) (diff)

#2 in reply to: ↑ 1 @Jaydeep Rami
7 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
6 years 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.


6 years ago

#5 @audrasjb
6 years 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
5 years ago

#6 @man4toman
5 years ago

  • Keywords needs-testing added; needs-refresh removed

@man4toman
5 years ago

#7 @man4toman
5 years 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.


5 years ago

#9 @SergeyBiryukov
5 years 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.