Make WordPress Core

Changeset 32533


Ignore:
Timestamp:
05/21/2015 09:30:31 PM (11 years ago)
Author:
wonderboymusic
Message:

In class-oembed.php, clarify/add some return docs.

See #32444.

File:
1 edited

Legend:

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

    r32116 r32533  
    196196         * @param string        $url  The URL to the content.
    197197         * @param string|array  $args Optional provider arguments.
    198          * @return bool|string False on failure, otherwise the oEmbed provider URL.
     198         * @return false|string False on failure, otherwise the oEmbed provider URL.
    199199         */
    200200        public function get_provider( $url, $args = '' ) {
    … …  
    307307         *
    308308         * @param string $url The URL that should be inspected for discovery `<link>` tags.
    309          * @return bool|string False on failure, otherwise the oEmbed provider URL.
     309         * @return false|string False on failure, otherwise the oEmbed provider URL.
    310310         */
    311311        public function discover( $url ) {
    … …  
    385385         * @param string $url The URL to the content that is desired to be embedded.
    386386         * @param array $args Optional arguments. Usually passed from a shortcode.
    387          * @return bool|object False on failure, otherwise the result in the form of an object.
     387         * @return false|object False on failure, otherwise the result in the form of an object.
    388388         */
    389389        public function fetch( $provider, $url, $args = '' ) {
    … …  
    421421         * @param string $provider_url_with_args URL to the provider with full arguments list (url, maxheight, etc.)
    422422         * @param string $format Format to use
    423          * @return bool|object False on failure, otherwise the result in the form of an object.
     423         * @return false|object|WP_Error False on failure, otherwise the result in the form of an object.
    424424         */
    425425        private function _fetch_with_format( $provider_url_with_args, $format ) {
    … …  
    443443         * @since 3.0.0
    444444         * @access private
     445         *
     446         * @param string $response_body
     447         * @return object|false
    445448         */
    446449        private function _parse_json( $response_body ) {
    447                 return ( ( $data = json_decode( trim( $response_body ) ) ) && is_object( $data ) ) ? $data : false;
     450                $data = json_decode( trim( $response_body ) );
     451                return ( $data && is_object( $data ) ) ? $data : false;
    448452        }
    449453
    … …  
    453457         * @since 3.0.0
    454458         * @access private
     459         *
     460         * @param string $response_body
     461         * @return object|false
    455462         */
    456463        private function _parse_xml( $response_body ) {
    … …  
    474481         * @since 3.6.0
    475482         * @access private
     483         *
     484         * @param string $response_body
     485         * @return object|false
    476486         */
    477487        private function _parse_xml_body( $response_body ) {
Note: See TracChangeset for help on using the changeset viewer.