From 14555b3af229c8a5407eb00f33e53220a67654ba Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 10 Jan 2015 23:27:00 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@31136 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp.php | 68 +----------------------------------- 1 file changed, 1 insertion(+), 67 deletions(-) diff --git a/src/wp-includes/class-wp.php b/src/wp-includes/class-wp.php index 6ac5fb4777..8f8f95dd12 100644 --- a/src/wp-includes/class-wp.php +++ b/src/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();