Making WordPress.org

Changeset 5935


Ignore:
Timestamp:
09/18/2017 08:21:04 PM (7 years ago)
Author:
coffee2code
Message:

Browse Happy API: Add missing docblocks and improve the existing ones.

Location:
sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/browsers.php

    r5934 r5935  
    88
    99/**
    10  * Browser current version numbers.
     10 * Returns current version numbers for all browsers.
    1111 *
    1212 * These are for major release branches, not full build numbers.
    1313 * Firefox 3.6, 4, etc., not Chrome 11.0.696.65.
     14 *
     15 * @return array Associative array of browser names with their respective
     16 *               current (or somewhat current) version number.
    1417 */
    1518function get_browser_current_versions() {
     
    2326}
    2427
     28/**
     29 * Returns browser data for a given browser.
     30 *
     31 * @param string|false $browser The name of the browser. Default false.
     32 * @return false|array {
     33 *     Array of data about the browser. False if the browser is unknown.
     34 *
     35 *     @type string    $name        Name of the browser.
     36 *     @type string    $wikipedia   Wikipedia name for the browser.
     37 *     @type int|float $normalized  How should browser version number be
     38 *                                  normalized? 1 == just first number, else
     39 *                                  include second number (i.e. decimal value)
     40 *     @type string    $url         The home URL for the browser.
     41 *     @type string    $img_src     The non-HTTPs URL for the browser's logo image.
     42 *     @type string    $img_src_ssl The HTTPS URL for the browser's logo image.
     43 * }
     44 */
    2545function browsehappy_api_get_browser_data( $browser = false ) {
    2646
  • sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/index.php

    r5934 r5935  
    3333}
    3434
     35/**
     36 * Logs anonymized user-agent data.
     37 *
     38 * @param string $ua   The user-agent string.
     39 * @param array  $data Parsed user-agent data.
     40 */
    3541function bh_record_data( $ua, $data ) {
    3642    global $wpdb;
  • sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/parse.php

    r5934 r5935  
    77
    88/**
    9 * Parses a user agent string into its important parts
    10 *
    11 * @param string $user_agent
    12 *
    13 * @return array containing platform, name, and version
    14 */
     9 * Parses a user agent string into its important parts.
     10 *
     11 * @param string $user_agent The user agent string for a browser.
     12 * @return array {
     13 *     Array containing data based on the parsing of the user agent.
     14 *
     15 *     @type string $platform        The platform running the browser.
     16 *     @type string $name            The name of the browser.
     17 *     @type string $version         The reported version of the browser.
     18 *     @type string $update_url      The URL to obtain the update for the browser.
     19 *     @type string $img_src         The non-HTTPS URL for the browser's logo image.
     20 *     @type string $img_src_ssl     The HTTPS URL for the browser's logo image.
     21 *     @type string $current_version The current latest version of the browser.
     22 *     @type bool   $upgrade         Is there an update available for the browser?
     23 *     @type bool   $insecure        Is the browser insecure?
     24 * }
     25 */
    1526function browsehappy_parse_user_agent( $user_agent ) {
    1627    $data = array();
     
    104115}
    105116
     117/**
     118 * Returns the current version for the given browser.
     119 *
     120 * @param string $name The name of the browser.
     121 * @return string      The version for the browser or an empty string if an
     122 *                     unknown browser.
     123 */
    106124function get_browser_version_from_name( $name ) {
    107125    $versions = get_browser_current_versions();
Note: See TracChangeset for help on using the changeset viewer.