Skip to:
Content

bbPress.org


Ignore:
Timestamp:
11/22/2025 06:05:25 AM (4 months ago)
Author:
johnjamesjacoby
Message:

Tools - Code Improvement: stop ignoring these PHPCS sniffs:

  • Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition
  • Generic.CodeAnalysis.EmptyStatement.DetectedElseif
  • Generic.CodeAnalysis.EmptyStatement.DetectedIf
  • Generic.CodeAnalysis.UselessOverridingMethod.Found
  • Generic.ControlStructures.InlineControlStructure.NotAllowed
  • Generic.Files.LineEndings.InvalidEOLChar
  • Generic.Formatting.DisallowMultipleStatements.SameLine
  • Generic.Formatting.SpaceAfterCast.TooMuchSpace
  • Generic.Functions.OpeningFunctionBraceKernighanRitchie.ContentAfterBrace
  • Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed
  • NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceAfterArrayOpenerMultiLine
  • NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceAfterArrayOpenerSingleLine
  • NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceBeforeArrayCloserMultiLine
  • NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLineCloserSameLine
  • PEAR.Functions.FunctionCallSignature.CloseBracketLine
  • PEAR.Functions.FunctionCallSignature.EmptyLine
  • PEAR.Functions.FunctionCallSignature.Indent
  • PEAR.Functions.FunctionCallSignature.MultipleArguments
  • PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection
  • PHPCompatibility.Syntax.RemovedCurlyBraceArrayAccess.Found
  • PSR2.Classes.ClassDeclaration.CloseBraceAfterBody
  • PSR2.Classes.PropertyDeclaration.ScopeMissing
  • PSR2.Classes.PropertyDeclaration.Underscore
  • PSR2.Classes.PropertyDeclaration.VarUsed
  • PSR2.ControlStructures.ElseIfDeclaration.NotAllowed
  • PSR2.ControlStructures.SwitchDeclaration.BreakIndent
  • PSR2.Methods.MethodDeclaration.Underscore
  • Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace
  • Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterOpen
  • Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose
  • Squiz.Functions.MultiLineFunctionDeclaration.ContentAfterBrace
  • Squiz.PHP.DisallowSizeFunctionsInLoops.Found
  • Squiz.Scope.MethodScope.Missing
  • Squiz.WhiteSpace.SuperfluousWhitespace.EndLine
  • Universal.NamingConventions.NoReservedKeywordParameterNames.arrayFound
  • Universal.NamingConventions.NoReservedKeywordParameterNames.echoFound
  • Universal.NamingConventions.NoReservedKeywordParameterNames.parentFound
  • Universal.Operators.DisallowStandalonePostIncrementDecrement.PostDecrementFound
  • Universal.Operators.DisallowStandalonePostIncrementDecrement.PostIncrementFound
  • Universal.Operators.StrictComparisons.LooseEqual
  • Universal.Operators.StrictComparisons.LooseNotEqual
  • WordPress.Arrays.ArrayKeySpacingRestrictions.TooMuchSpaceAfterKey
  • WordPress.DateTime.CurrentTimeTimestamp.Requested
  • WordPress.DateTime.RestrictedFunctions.date_date
  • WordPress.Files.FileName.NotHyphenatedLowercase
  • WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound
  • WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound
  • WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound
  • WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
  • WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
  • WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
  • WordPress.PHP.IniSet.Risky
  • WordPress.PHP.PregQuoteDelimiter.Missing
  • WordPress.PHP.StrictInArray.MissingTrueStrict
  • WordPress.WP.AlternativeFunctions.parse_url_parse_url
  • WordPress.WP.AlternativeFunctions.rand_mt_rand
  • WordPress.WP.AlternativeFunctions.strip_tags_strip_tag
  • WordPress.WP.AlternativeFunctions.strip_tags_strip_tags
  • WordPress.WP.Capabilities.Unknown
  • WordPress.WP.DeprecatedParameters.Get_termsParam2Found
  • WordPress.WP.DeprecatedParameters.Wp_count_termsParam2Found
  • WordPress.WP.DiscouragedFunctions.query_posts_query_posts
  • WordPress.WP.DiscouragedFunctions.wp_reset_query_wp_reset_query
  • WordPress.WP.EnqueuedResourceParameters.NotInFooter
  • WordPress.WP.GlobalVariablesOverride.Prohibited
  • WordPress.WP.I18n.LowLevelTranslationFunction

This commit includes code formatting changes for the above sniffs.

See #3658.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/common/shortcodes.php

    r7361 r7378  
    4848    private function setup_globals() {
    4949
     50        // phpcs:disable PEAR.Functions.FunctionCallSignature.CloseBracketLine
     51
    5052        // Setup the shortcodes
    51         $this->codes = apply_filters( 'bbp_shortcodes', array(
    52 
    53             /** Forums ********************************************************/
    54 
    55             'bbp-forum-index'      => array( $this, 'display_forum_index'   ), // Forum Index
    56             'bbp-forum-form'       => array( $this, 'display_forum_form'    ), // Topic form
    57             'bbp-single-forum'     => array( $this, 'display_forum'         ), // Specific forum - pass an 'id' attribute
    58 
    59             /** Topics ********************************************************/
    60 
    61             'bbp-topic-index'      => array( $this, 'display_topic_index'   ), // Topic index
    62             'bbp-topic-form'       => array( $this, 'display_topic_form'    ), // Topic form
    63             'bbp-single-topic'     => array( $this, 'display_topic'         ), // Specific topic - pass an 'id' attribute
    64 
    65             /** Topic Tags ****************************************************/
    66 
    67             'bbp-topic-tags'       => array( $this, 'display_topic_tags'    ), // All topic tags in a cloud
    68             'bbp-single-tag'       => array( $this, 'display_topics_of_tag' ), // Topics of Tag
    69 
    70             /** Replies *******************************************************/
    71 
    72             'bbp-reply-form'       => array( $this, 'display_reply_form'    ), // Reply form
    73             'bbp-single-reply'     => array( $this, 'display_reply'         ), // Specific reply - pass an 'id' attribute
    74 
    75             /** Views *********************************************************/
    76 
    77             'bbp-single-view'      => array( $this, 'display_view'          ), // Single view
    78 
    79             /** Search ********************************************************/
    80 
    81             'bbp-search-form'      => array( $this, 'display_search_form'   ), // Search form
    82             'bbp-search'           => array( $this, 'display_search'        ), // Search
    83 
    84             /** Account *******************************************************/
    85 
    86             'bbp-login'            => array( $this, 'display_login'         ), // Login
    87             'bbp-register'         => array( $this, 'display_register'      ), // Register
    88             'bbp-lost-pass'        => array( $this, 'display_lost_pass'     ), // Lost Password
    89 
    90             /** Others *******************************************************/
    91 
    92             'bbp-stats'            => array( $this, 'display_stats'         ), // Stats
    93         ) );
     53        $this->codes = apply_filters(
     54            'bbp_shortcodes',
     55            array(
     56
     57                /** Forums ****************************************************/
     58
     59                'bbp-forum-index'      => array( $this, 'display_forum_index'   ), // Forum Index
     60                'bbp-forum-form'       => array( $this, 'display_forum_form'    ), // Topic form
     61                'bbp-single-forum'     => array( $this, 'display_forum'         ), // Specific forum - pass an 'id' attribute
     62
     63                /** Topics ****************************************************/
     64
     65                'bbp-topic-index'      => array( $this, 'display_topic_index'   ), // Topic index
     66                'bbp-topic-form'       => array( $this, 'display_topic_form'    ), // Topic form
     67                'bbp-single-topic'     => array( $this, 'display_topic'         ), // Specific topic - pass an 'id' attribute
     68
     69                /** Topic Tags ************************************************/
     70
     71                'bbp-topic-tags'       => array( $this, 'display_topic_tags'    ), // All topic tags in a cloud
     72                'bbp-single-tag'       => array( $this, 'display_topics_of_tag' ), // Topics of Tag
     73
     74                /** Replies ***************************************************/
     75
     76                'bbp-reply-form'       => array( $this, 'display_reply_form'    ), // Reply form
     77                'bbp-single-reply'     => array( $this, 'display_reply'         ), // Specific reply - pass an 'id' attribute
     78
     79                /** Views *****************************************************/
     80
     81                'bbp-single-view'      => array( $this, 'display_view'          ), // Single view
     82
     83                /** Search ****************************************************/
     84
     85                'bbp-search-form'      => array( $this, 'display_search_form'   ), // Search form
     86                'bbp-search'           => array( $this, 'display_search'        ), // Search
     87
     88                /** Account ***************************************************/
     89
     90                'bbp-login'            => array( $this, 'display_login'         ), // Login
     91                'bbp-register'         => array( $this, 'display_register'      ), // Register
     92                'bbp-lost-pass'        => array( $this, 'display_lost_pass'     ), // Lost Password
     93
     94                /** Others ****************************************************/
     95
     96                'bbp-stats'            => array( $this, 'display_stats'         ), // Stats
     97            )
     98        );
     99
     100        // phpcs:enable
    94101    }
    95102
     
    514521
    515522        // Output the topic tags
    516         wp_tag_cloud( array(
    517             'smallest' => 9,
    518             'largest'  => 38,
    519             'number'   => 80,
    520             'taxonomy' => bbp_get_topic_tag_tax_id()
    521         ) );
     523        wp_tag_cloud(
     524            array(
     525                'smallest' => 9,
     526                'largest'  => 38,
     527                'number'   => 80,
     528                'taxonomy' => bbp_get_topic_tag_tax_id()
     529            )
     530        );
    522531
    523532        // Return contents of output buffer
     
    854863     */
    855864    public function display_topics_of_tag_query( $args = array() ) {
    856         $args['tax_query'] = array( 
     865        $args['tax_query'] = array(
    857866            array(
    858867                'taxonomy' => bbp_get_topic_tag_tax_id(),
    859868                'field'    => 'id',
    860869                'terms'    => bbpress()->current_topic_tag_id
    861             ) 
     870            )
    862871        );
    863872
Note: See TracChangeset for help on using the changeset viewer.