Skip to:
Content

BuddyPress.org

Changeset 11350


Ignore:
Timestamp:
12/28/2016 09:54:03 PM (10 years ago)
Author:
slaffik
Message:

Profile: Improve bp-xprofile-template.php PHPDoc comments.

Added some proper casting for (int) and fixed @return statements, where we previously had mixed|void for some reason.

See #7306.

Location:
trunk/src/bp-xprofile
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/bp-xprofile-template.php

    r11258 r11350  
    257257         * @since 1.1.0
    258258         *
    259          * @return mixed|void
     259         * @return int
    260260         */
    261261        function bp_get_the_profile_group_id() {
     
    269269                 * @param int $id ID for the profile group.
    270270                 */
    271                 return apply_filters( 'bp_get_the_profile_group_id', $group->id );
     271                return (int) apply_filters( 'bp_get_the_profile_group_id', $group->id );
    272272        }
    273273
     
    286286         * @since 1.0.0
    287287         *
    288          * @return mixed|void
     288         * @return string
    289289         */
    290290        function bp_get_the_profile_group_name() {
     
    315315         * @since 1.1.0
    316316         *
    317          * @return mixed|void
     317         * @return string
    318318         */
    319319        function bp_get_the_profile_group_slug() {
     
    344344         * @since 1.0.0
    345345         *
    346          * @return mixed|void
     346         * @return string
    347347         */
    348348        function bp_get_the_profile_group_description() {
     
    373373         * @since 1.1.0
    374374         *
    375          * @return mixed|void
     375         * @return string
    376376         */
    377377        function bp_get_the_profile_group_edit_form_action() {
     
    497497         * @since 1.1.0
    498498         *
    499          * @return mixed|void
     499         * @return int
    500500         */
    501501        function bp_get_the_profile_field_id() {
     
    509509                 * @param int $id ID for the profile field.
    510510                 */
    511                 return apply_filters( 'bp_get_the_profile_field_id', $field->id );
     511                return (int) apply_filters( 'bp_get_the_profile_field_id', $field->id );
    512512        }
    513513
     
    526526         * @since 1.0.0
    527527         *
    528          * @return mixed|void
     528         * @return string
    529529         */
    530530        function bp_get_the_profile_field_name() {
     
    555555         * @since 1.0.0
    556556         *
    557          * @return mixed|void
     557         * @return string
    558558         */
    559559        function bp_get_the_profile_field_value() {
     
    588588         * @since 1.1.0
    589589         *
    590          * @return mixed|void
     590         * @return string
    591591         */
    592592        function bp_get_the_profile_field_edit_value() {
     
    641641         * @since 1.1.0
    642642         *
    643          * @return mixed|void
     643         * @return string
    644644         */
    645645        function bp_get_the_profile_field_type() {
     
    670670         * @since 1.1.0
    671671         *
    672          * @return mixed|void
     672         * @return string
    673673         */
    674674        function bp_get_the_profile_field_description() {
     
    699699         * @since 1.1.0
    700700         *
    701          * @return mixed|void
     701         * @return string
    702702         */
    703703        function bp_get_the_profile_field_input_name() {
     
    805805         * @since 1.1.0
    806806         *
    807          * @return mixed|void
     807         * @return bool
    808808         */
    809809        function bp_get_the_profile_field_is_required() {
     
    823823                 * @param bool $retval Whether or not the field is required.
    824824                 */
    825                 return apply_filters( 'bp_get_the_profile_field_is_required', (bool) $retval );
     825                return (bool) apply_filters( 'bp_get_the_profile_field_is_required', $retval );
    826826        }
    827827
     
    840840         * @since 1.6.0
    841841         *
    842          * @return mixed|void
     842         * @return string
    843843         */
    844844        function bp_get_the_profile_field_visibility_level() {
     
    878878         * @since 1.6.0
    879879         *
    880          * @return mixed|void
     880         * @return string
    881881         */
    882882        function bp_get_the_profile_field_visibility_level_label() {
     
    946946         *    @type int             $user_id ID of the user to get field data for.
    947947         * }
    948          * @return mixed|void
     948         * @return mixed
    949949         */
    950950        function bp_get_profile_field_data( $args = '' ) {
     
    10891089 *
    10901090 * @param bool $deprecated Deprecated boolean parameter.
    1091  * @return mixed|void
     1091 *
     1092 * @return string|mixed
    10921093 */
    10931094function bp_profile_group_name( $deprecated = true ) {
    1094         if ( !$deprecated ) {
     1095        if ( ! $deprecated ) {
    10951096                return bp_get_profile_group_name();
    10961097        } else {
     
    11041105         * @since 1.0.0
    11051106         *
    1106          * @return mixed|void
     1107         * @return string
    11071108         */
    11081109        function bp_get_profile_group_name() {
     
    11501151         * @since 1.0.0
    11511152         *
    1152          * @return bool|mixed|void
     1153         * @return bool|string
    11531154         */
    11541155        function bp_get_profile_last_updated() {
     
    11851186         * @since 1.1.0
    11861187         *
    1187          * @return mixed|void
     1188         * @return int
    11881189         */
    11891190        function bp_get_current_profile_group_id() {
     
    12001201                 * @since 1.1.0
    12011202                 *
    1202                  * @param string $profile_group_id Current profile group ID.
    1203                  */
    1204                 return apply_filters( 'bp_get_current_profile_group_id', $profile_group_id );
     1203                 * @param int $profile_group_id Current profile group ID.
     1204                 */
     1205                return (int) apply_filters( 'bp_get_current_profile_group_id', $profile_group_id );
    12051206        }
    12061207
     
    12191220         * @since 1.1.0
    12201221         *
    1221          * @return mixed|void
     1222         * @return string
    12221223         */
    12231224        function bp_get_avatar_delete_link() {
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-user-admin.php

    r11295 r11350  
    139139                                        'normal',
    140140                                        'core',
    141                                         array( 'profile_group_id' => absint( bp_get_the_profile_group_id() ) )
     141                                        array( 'profile_group_id' => bp_get_the_profile_group_id() )
    142142                                );
    143143                        endwhile;
Note: See TracChangeset for help on using the changeset viewer.