Make WordPress Core


Ignore:
Timestamp:
05/29/2015 03:42:40 PM (10 years ago)
Author:
wonderboymusic
Message:

Add @static* annotations where they are missing.
Initialize all static vars that are not, most to null.

See #32444.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-http.php

    r32542 r32650  
    342342     *
    343343     * @since 3.2.0
     344     *
     345     * @static
    344346     * @access private
    345347     *
     
    627629     * @link https://core.trac.wordpress.org/ticket/14636 Allow wildcard domains in WP_ACCESSIBLE_HOSTS
    628630     *
     631     * @staticvar array|null $accessible_hosts
     632     * @staticvar array      $wildcard_regex
     633     *
    629634     * @param string $uri URI of url.
    630635     * @return bool True to block, false to allow.
     
    657662            return true;
    658663
    659         static $accessible_hosts;
    660         static $wildcard_regex = false;
    661         if ( null == $accessible_hosts ) {
     664        static $accessible_hosts = null;
     665        static $wildcard_regex = array();
     666        if ( null === $accessible_hosts ) {
    662667            $accessible_hosts = preg_split('|,\s*|', WP_ACCESSIBLE_HOSTS);
    663668
     
    688693     *
    689694     * @since 4.1.0
     695     *
     696     * @static
    690697     * @access protected
    691698     *
     
    726733     * @since 3.4.0
    727734     *
     735     * @static
    728736     * @access public
     737     *
    729738     * @param string $maybe_relative_path The URL which might be relative
    730739     * @param string $url                 The URL which $maybe_relative_path is relative to
     
    796805     *
    797806     * @since 3.7.0
     807     *
     808     * @static
    798809     *
    799810     * @param string $url The URL which was requested.
     
    17991810     * @since 2.8.0
    18001811     *
     1812     * @staticvar array|null $bypass_hosts
     1813     * @staticvar array      $wildcard_regex
     1814     *
    18011815     * @param string $uri URI to check.
    18021816     * @return bool True, to send through the proxy and false if, the proxy should not be used.
     
    18381852            return true;
    18391853
    1840         static $bypass_hosts;
    1841         static $wildcard_regex = false;
    1842         if ( null == $bypass_hosts ) {
     1854        static $bypass_hosts = null;
     1855        static $wildcard_regex = array();
     1856        if ( null === $bypass_hosts ) {
    18431857            $bypass_hosts = preg_split('|,\s*|', WP_PROXY_BYPASS_HOSTS);
    18441858
     
    20882102     * @since 2.8.0
    20892103     *
     2104     * @static
     2105     *
    20902106     * @param string $raw String to compress.
    20912107     * @param int $level Optional, default is 9. Compression level, 9 is highest.
     
    21072123     * @since 2.8.0
    21082124     *
     2125     * @static
     2126     *
    21092127     * @param string $compressed String to decompress.
    21102128     * @param int $length The optional length of the compressed data.
     
    21512169     * @link http://au2.php.net/manual/en/function.gzinflate.php#70875
    21522170     * @link http://au2.php.net/manual/en/function.gzinflate.php#77336
     2171     *
     2172     * @static
    21532173     *
    21542174     * @param string $gzData String to decompress.
     
    21912211     * @since 2.8.0
    21922212     *
     2213     * @static
     2214     *
    21932215     * @param string $url
    21942216     * @param array  $args
     
    22372259     * @since 2.8.0
    22382260     *
     2261     * @static
     2262     *
    22392263     * @return string Content-Encoding string to send in the header.
    22402264     */
     
    22472271     *
    22482272     * @since 2.8.0
     2273     *
     2274     * @static
    22492275     *
    22502276     * @param array|string $headers All of the available headers.
     
    22712297     * @since 2.8.0
    22722298     *
     2299     * @static
     2300     *
    22732301     * @return bool
    22742302     */
Note: See TracChangeset for help on using the changeset viewer.