Make WordPress Core


Ignore:
Timestamp:
09/15/2019 11:03:45 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Code Modernisation: Introduce the spread operator in tests/phpunit/*.

Rather than relying func_get_args() to retrieve arbitrary function arguments, we can now use the spread operator to assign them directly to a variable.

Props jrf.
See #47678.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/hooks/doAction.php

    r42343 r46127  
    165165        /**
    166166         * Use this rather than MockAction so we can test callbacks with no args
     167         *
     168         * @param mixed ...$args Optional arguments passed to the action.
    167169         */
    168         public function _action_callback() {
    169                 $args           = func_get_args();
     170        public function _action_callback( ...$args ) {
    170171                $this->events[] = array(
    171172                        'action' => __FUNCTION__,
Note: See TracChangeset for help on using the changeset viewer.