[wp-trac] [WordPress Trac] #54504: Update Requests library to version 2.0.0

WordPress Trac noreply at wordpress.org
Mon Nov 29 16:23:49 UTC 2021


#54504: Update Requests library to version 2.0.0
-------------------------------------------------+-------------------------
 Reporter:  jrf                                  |       Owner:
                                                 |  SergeyBiryukov
     Type:  task (blessed)                       |      Status:  closed
 Priority:  normal                               |   Milestone:  5.9
Component:  External Libraries                   |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch needs-dev-note php80       |     Focuses:
  php81                                          |
-------------------------------------------------+-------------------------
Changes (by SergeyBiryukov):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 Replying to [comment:19 schlessera]:
 > > Thanks for the context! Since PHP namespaces are case-insensitive, is
 there any chance to capitalize that as WPorg\Requests\, so that the
 capitalization of WP is consistent in lines like this and across the
 project in general?
 >
 > {{{#!php
 > new WP_REST_Request( WPorg\Requests\Requests::POST, $route );
 > }}}
 >
 > The above would actually be expected to use an import, which would turn
 the code into:
 > {{{#!php
 > new WP_REST_Request( Requests::POST, $route );
 > }}}
 >
 > The import itself can be automatically generated/managed by any decent
 IDE or code quality tool, so you would never type that namespace anyway.

 Thanks for chiming in! That was just one of the examples of the current
 code as committed in [52244]:
 {{{#!php
 new WP_REST_Request( WpOrg\Requests\Requests::POST, $route );
 }}}
 There are currently ~60 instances like that in core, though I guess they
 could use an import too.

 > Also, just as a final remark, @jrf and me (well @jrf, mostly) invested
 lots of time and energy in making a library that is a critical dependency
 of WordPress Core but had fallen into disrepair usable and maintainable
 again. A lot of thought went into everything, to ensure it works both as a
 dependency of WordPress Core as well as a useful package for any other PHP
 project that is depending on it, while maintaining backwards compatibility
 whenever we could. The entire endeavour was planned in such a way that
 pulling in the latest version is as frictionless as possible and can
 mostly just be automated.

 There is no doubt about that, I highly appreciate all the efforts what
 went into the 2.0.0 release, and I'm sure that most users of the package
 will too.

 I guess I do feel a bit strongly about capitalizing the WP acronym in a
 consistent way, but I'm happy to accept that the decision has been made
 and will not be addressed further. Re-closing this as fixed, as it looks
 like a consensus was reached here.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54504#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list