Making WordPress.org

Opened 21 months ago

Closed 17 months ago

Last modified 17 months ago

#6425 closed defect (bug) (invalid)

In wordpress.org, the photo-directory plugin has PHPCS error.

Reported by: smit08's profile smit08 Owned by:
Milestone: Priority: normal
Component: Photo Directory Keywords: has-patch needs-testing
Cc:

Description

Path: trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/vendor/grpc/grpc/src/lib/RpcServer.php

while scanning the PHPCS 8.0 compatibility of meta sites and plugins, I found the photo-directory plugin, there is a PHPCS error.

Error: Using 'continue' outside of a loop or switch structure is invalid and will throw a fatal error since PHP 7.0

Attachments (1)

6425.patch (741 bytes) - added by smit08 21 months ago.

Download all attachments as: .zip

Change History (5)

@smit08
21 months ago

#1 @rudlinkon
21 months ago

  • Keywords has-patch added; needs-patch removed

Great findings

#2 @rudlinkon
21 months ago

  • Keywords needs-testing added

#3 @coffee2code
17 months ago

  • Component changed from General to Photo Directory
  • Resolution set to invalid
  • Status changed from new to closed

Thanks for the report @smit08! A few things, however:

  1. The code in question is a vendor library required and utilized by the two Google libraries used by the Photo Directory. We do not control the code, nor would we want to maintain a fork of it (without their being a compelling reason to do so). At the moment, if this is a bug it hasn't been triggered thus far. The grpc/grpc package still has this line of code. If you think this is a legitimate bug, then I recommend reporting it to the maintainers. This would fix things more widely and save us from having to maintain local changes to the library.
  1. The class containing the code in question is marked as experimental and is not actually being used by either of those Google libraries or any other dependency, so we aren't affected by it.
  1. While I don't question that the scan you performed flagged that continue as being used outside of a loop, but having looked at the code it seems to me the continue is indeed within a while loop, which is perfectly valid. In the code, if a request is not implemented, it simply continues to the next (infinite) while loop iteration, basically waiting for the next event.

This seems like maybe it was a false positive reported by the scanning tool?

#4 @smit08
17 months ago

Hi @coffee2code

Thanks for reviewing the ticket and patch. I agree with you. Thanks for closing this ticket.

Note: See TracTickets for help on using tickets.