Add @static* annotations where they are missing.

Initialize all static vars that are not, most to `null`.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32650 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2015-05-29 15:42:40 +00:00
parent cced199188
commit c8a44d437a
35 changed files with 172 additions and 52 deletions

View File

@@ -341,6 +341,8 @@ class WP_Http {
* The order for requests is cURL, and then PHP Streams.
*
* @since 3.2.0
*
* @static
* @access private
*
* @param string $url URL to Request
@@ -626,6 +628,9 @@ class WP_Http {
* @link https://core.trac.wordpress.org/ticket/8927 Allow preventing external requests.
* @link https://core.trac.wordpress.org/ticket/14636 Allow wildcard domains in WP_ACCESSIBLE_HOSTS
*
* @staticvar array|null $accessible_hosts
* @staticvar array $wildcard_regex
*
* @param string $uri URI of url.
* @return bool True to block, false to allow.
*/
@@ -656,9 +661,9 @@ class WP_Http {
if ( !defined('WP_ACCESSIBLE_HOSTS') )
return true;
static $accessible_hosts;
static $wildcard_regex = false;
if ( null == $accessible_hosts ) {
static $accessible_hosts = null;
static $wildcard_regex = array();
if ( null === $accessible_hosts ) {
$accessible_hosts = preg_split('|,\s*|', WP_ACCESSIBLE_HOSTS);
if ( false !== strpos(WP_ACCESSIBLE_HOSTS, '*') ) {
@@ -687,6 +692,8 @@ class WP_Http {
* when URL parsing failed.
*
* @since 4.1.0
*
* @static
* @access protected
*
* @param string $url The URL to parse.
@@ -725,7 +732,9 @@ class WP_Http {
*
* @since 3.4.0
*
* @static
* @access public
*
* @param string $maybe_relative_path The URL which might be relative
* @param string $url The URL which $maybe_relative_path is relative to
* @return string An Absolute URL, in a failure condition where the URL cannot be parsed, the relative URL will be returned.
@@ -796,6 +805,8 @@ class WP_Http {
*
* @since 3.7.0
*
* @static
*
* @param string $url The URL which was requested.
* @param array $args The Arguments which were used to make the request.
* @param array $response The Response of the HTTP request.
@@ -1798,6 +1809,9 @@ class WP_HTTP_Proxy {
*
* @since 2.8.0
*
* @staticvar array|null $bypass_hosts
* @staticvar array $wildcard_regex
*
* @param string $uri URI to check.
* @return bool True, to send through the proxy and false if, the proxy should not be used.
*/
@@ -1837,9 +1851,9 @@ class WP_HTTP_Proxy {
if ( !defined('WP_PROXY_BYPASS_HOSTS') )
return true;
static $bypass_hosts;
static $wildcard_regex = false;
if ( null == $bypass_hosts ) {
static $bypass_hosts = null;
static $wildcard_regex = array();
if ( null === $bypass_hosts ) {
$bypass_hosts = preg_split('|,\s*|', WP_PROXY_BYPASS_HOSTS);
if ( false !== strpos(WP_PROXY_BYPASS_HOSTS, '*') ) {
@@ -2087,6 +2101,8 @@ class WP_Http_Encoding {
*
* @since 2.8.0
*
* @static
*
* @param string $raw String to compress.
* @param int $level Optional, default is 9. Compression level, 9 is highest.
* @param string $supports Optional, not used. When implemented it will choose the right compression based on what the server supports.
@@ -2106,6 +2122,8 @@ class WP_Http_Encoding {
*
* @since 2.8.0
*
* @static
*
* @param string $compressed String to decompress.
* @param int $length The optional length of the compressed data.
* @return string|bool False on failure.
@@ -2151,6 +2169,8 @@ class WP_Http_Encoding {
* @link http://au2.php.net/manual/en/function.gzinflate.php#70875
* @link http://au2.php.net/manual/en/function.gzinflate.php#77336
*
* @static
*
* @param string $gzData String to decompress.
* @return string|bool False on failure.
*/
@@ -2190,6 +2210,8 @@ class WP_Http_Encoding {
*
* @since 2.8.0
*
* @static
*
* @param string $url
* @param array $args
* @return string Types of encoding to accept.
@@ -2236,6 +2258,8 @@ class WP_Http_Encoding {
*
* @since 2.8.0
*
* @static
*
* @return string Content-Encoding string to send in the header.
*/
public static function content_encoding() {
@@ -2247,6 +2271,8 @@ class WP_Http_Encoding {
*
* @since 2.8.0
*
* @static
*
* @param array|string $headers All of the available headers.
* @return bool
*/
@@ -2270,6 +2296,8 @@ class WP_Http_Encoding {
*
* @since 2.8.0
*
* @static
*
* @return bool
*/
public static function is_available() {