Make WordPress Core

Opened 6 months ago

Closed 5 months ago

#62750 closed defect (bug) (fixed)

PHPcs Fixes in `class-ftp.php`

Reported by: viralsampat's profile viralsampat Owned by: desrosj's profile desrosj
Milestone: 6.8 Priority: lowest
Severity: trivial Version:
Component: General Keywords: has-patch
Focuses: coding-standards Cc:

Description (last modified by audrasjb)

Hello Team,

I have checked wp-admin & wp-includes folders and found few PHPcs fixes.

  • No space before closing parenthesis is prohibited
  • Line indented incorrectly; expected at least 1 tabs, found 0

I have applied a patch which will fix this issue.

Thanks,

[EDIT: the related changes are related to `wp-admin/includes/class-ftp.php`, see comment #2]

Attachments (1)

62750.patch (33.7 KB) - added by viralsampat 6 months ago.
I have checked above mentioned issue and I have resolved it and added patch.

Download all attachments as: .zip

Change History (9)

@viralsampat
6 months ago

I have checked above mentioned issue and I have resolved it and added patch.

#1 @audrasjb
6 months ago

  • Description modified (diff)
  • Keywords needs-patch added; dev-feedback needs-testing removed
  • Summary changed from PHPcs Fixes on WordPress core. to PHPcs Fixes in `class-ftp.php`
  • Version trunk deleted

Hello and thank you for opening this ticket, however ID3 is an external library so the related files should be modified on the related upstream repository. Also, we don't usually make much WPCS changes on deprecated.php since these functions are, well, deprecated :)

I'm renaming this ticket and description to only mention class-ftp.php.

(and please note that the ticket should reflect which changes are proposed and where, otherwise we would end up with a ton of ticket labelled as "PHPCS fixes in Core" 🙂).

#2 @viralsampat
6 months ago

Hello @audrasjb

Thank you so much for your feedback.

I will make sure and now onwards I will reflect which changes are proposed and where, So we can understand easily.

Thanks,

#3 @desrosj
6 months ago

  • Keywords changes-requested has-patch added; needs-patch removed
  • Milestone changed from Awaiting Review to Future Release
  • Priority changed from normal to lowest
  • Severity changed from normal to trivial

Could you update your patch to remove the changes to the ID3 library and the deprecated file? Since the code in that file is deprecated, we typically try not to update the code there unless absolutely necessary (PHP compatibility, security updates, etc.) as there is very little to no benefit.

In the class-ftp.php file, you've formatted the first if condition in {} but not the others. If we're going to make this change, we'll want to update all of them at the same time.

Just to share context because I keep having to dig around to find the history when changes are suggested to class-ftp.php. The PemFTP library is an upstream library, but is considered abandoned with the version contained in WordPress being the most up to date canonical source (see ticket:47751#comment:1).

#5 @shailu25
6 months ago

Created New PR.

Included all mentioned Changes in above comment.

Last edited 6 months ago by shailu25 (previous) (diff)

#6 @shailu25
5 months ago

  • Keywords changes-requested removed

#7 @desrosj
5 months ago

  • Milestone changed from Future Release to 6.8
  • Owner set to desrosj
  • Status changed from new to reviewing

#8 @desrosj
5 months ago

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

In 59846:

Coding Standards: Properly space and indent ! defined() checks.

Props viralsampat shailu25, audrasjb.
Fixes #62750.

Note: See TracTickets for help on using tickets.