wp/wp-includes/class-wp-dependency.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 21 48c4eec2b7e6
--- a/wp/wp-includes/class-wp-dependency.php	Tue Oct 22 16:11:46 2019 +0200
+++ b/wp/wp-includes/class-wp-dependency.php	Tue Dec 15 13:49:49 2020 +0100
@@ -21,7 +21,7 @@
 	 * The handle name.
 	 *
 	 * @since 2.6.0
-	 * @var null
+	 * @var string
 	 */
 	public $handle;
 
@@ -29,7 +29,7 @@
 	 * The handle source.
 	 *
 	 * @since 2.6.0
-	 * @var null
+	 * @var string
 	 */
 	public $src;
 
@@ -37,7 +37,7 @@
 	 * An array of handle dependencies.
 	 *
 	 * @since 2.6.0
-	 * @var array
+	 * @var string[]
 	 */
 	public $deps = array();
 
@@ -55,7 +55,7 @@
 	 * Additional arguments for the handle.
 	 *
 	 * @since 2.6.0
-	 * @var null
+	 * @var array
 	 */
 	public $args = null;  // Custom property, such as $in_footer or $media.
 
@@ -87,9 +87,13 @@
 	 * Setup dependencies.
 	 *
 	 * @since 2.6.0
+	 * @since 5.3.0 Formalized the existing `...$args` parameter by adding it
+	 *              to the function signature.
+	 *
+	 * @param mixed ...$args Dependency information.
 	 */
-	public function __construct() {
-		@list( $this->handle, $this->src, $this->deps, $this->ver, $this->args ) = func_get_args();
+	public function __construct( ...$args ) {
+		list( $this->handle, $this->src, $this->deps, $this->ver, $this->args ) = $args;
 		if ( ! is_array( $this->deps ) ) {
 			$this->deps = array();
 		}
@@ -119,7 +123,6 @@
 	 *
 	 * @param string $domain The translation textdomain.
 	 * @param string $path   Optional. The full file path to the directory containing translation files.
-	 *
 	 * @return bool False if $domain is not a string, true otherwise.
 	 */
 	public function set_translations( $domain, $path = null ) {