[wp-trac] [WordPress Trac] #25160: Unnecessarily passing $this by reference in core

WordPress Trac noreply at wordpress.org
Wed Aug 28 15:07:45 UTC 2013


#25160: Unnecessarily passing $this by reference in core
-------------------------------------+------------------------------
 Reporter:  jdgrimes                 |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  General                  |     Version:
 Severity:  trivial                  |  Resolution:
 Keywords:  has-patch needs-testing  |
-------------------------------------+------------------------------

Comment (by jdgrimes):

 Replying to [comment:4 wonderboymusic]:
 > if you get 80 errors, you broke something. Most of this is okay at a
 glance, but `src/wp-includes/class.wp-scripts.php` wasn't removed properly

 I think that one needs to stay, but it should have remained
 `do_action_ref_array()` - that's fixed in the latest patch. I got these
 two errors without it.

 {{{
 14) Tests_Dependencies_jQuery::test_location_of_jquery
 Parameter 1 to wp_default_scripts() expected to be a reference, value
 given

 /svn/wordpress/trunk/src/wp-includes/plugin.php:406
 /svn/wordpress/trunk/src/wp-includes/class.wp-scripts.php:39
 /svn/wordpress/trunk/src/wp-includes/class.wp-scripts.php:34
 /svn/wordpress/trunk/tests/tests/dependencies/jquery.php:10

 15)
 Tests_Dependencies_jQuery::test_dont_allow_deregister_core_scripts_in_admin
 Parameter 1 to wp_default_scripts() expected to be a reference, value
 given

 /svn/wordpress/trunk/src/wp-includes/plugin.php:406
 /svn/wordpress/trunk/src/wp-includes/class.wp-scripts.php:39
 /svn/wordpress/trunk/src/wp-includes/class.wp-scripts.php:34
 /svn/wordpress/trunk/src/wp-includes/functions.wp-scripts.php:111
 /svn/wordpress/trunk/tests/tests/dependencies/jquery.php:55
 }}}

 As for the errors, I don't believe that many of them were caused by this
 patch directly - e.g.:

 {{{
 31) Tests_Image_Size::test_shrink_dimensions_boundary
 wp_shrink_dimensions is <strong>deprecated</strong> since version 3.0! Use
 wp_constrain_dimensions() instead.
 }}}

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25160#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list