From eab3aa7802c9dab577b15f3993cf62f5451a88b8 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 10 Jan 2015 23:27:21 +0000 Subject: [PATCH] In `WP_MatchesMapRegex`: * Exactly one method was made private in [28516], and is only used internally. * 2 properties were made private, but they just store variables passed to the constructor. * Instances of this class are never created in core. `WP_MatchesMapRegex::apply()` is called statically in `WP->parse_request()` and `url_to_postid()`. The chances that: 1) this class is used as an instance somewhere and 2) the properties that have always been marked `@access private` and begin with `_` were used publicly ...is extremely low. Remove the magic methods, I should not have added them. While we're at it, use the PHP5-style `__construct()` instead of the class name. See #30891. Built from https://develop.svn.wordpress.org/trunk@31136 git-svn-id: http://core.svn.wordpress.org/trunk@31117 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp.php | 68 +--------------------------------------- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 68 deletions(-) diff --git a/wp-includes/class-wp.php b/wp-includes/class-wp.php index 6ac5fb4777..8f8f95dd12 100644 --- a/wp-includes/class-wp.php +++ b/wp-includes/class-wp.php @@ -661,72 +661,6 @@ class WP_MatchesMapRegex { */ public $_pattern = '(\$matches\[[1-9]+[0-9]*\])'; // magic number - /** - * Make private properties readable for backwards compatibility. - * - * @since 4.0.0 - * @access public - * - * @param string $name Property to get. - * @return mixed Property. - */ - public function __get( $name ) { - return $this->$name; - } - - /** - * Make private properties settable for backwards compatibility. - * - * @since 4.0.0 - * @access public - * - * @param string $name Property to set. - * @param mixed $value Property value. - * @return mixed Newly-set property. - */ - public function __set( $name, $value ) { - return $this->$name = $value; - } - - /** - * Make private properties checkable for backwards compatibility. - * - * @since 4.0.0 - * @access public - * - * @param string $name Property to check if set. - * @return bool Whether the property is set. - */ - public function __isset( $name ) { - return isset( $this->$name ); - } - - /** - * Make private properties un-settable for backwards compatibility. - * - * @since 4.0.0 - * @access public - * - * @param string $name Property to unset. - */ - public function __unset( $name ) { - unset( $this->$name ); - } - - /** - * Make private/protected methods readable for backwards compatibility. - * - * @since 4.0.0 - * @access public - * - * @param callable $name Method to call. - * @param array $arguments Arguments to pass when calling. - * @return mixed|bool Return value of the callback, false otherwise. - */ - public function __call( $name, $arguments ) { - return call_user_func_array( array( $this, $name ), $arguments ); - } - /** * constructor * @@ -734,7 +668,7 @@ class WP_MatchesMapRegex { * @param array $matches data to use in map * @return self */ - public function WP_MatchesMapRegex($subject, $matches) { + public function __construct($subject, $matches) { $this->_subject = $subject; $this->_matches = $matches; $this->output = $this->_map(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 39357b3e56..481728d27d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31135'; +$wp_version = '4.2-alpha-31136'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.