Skip to:
Content

bbPress.org

Changeset 7352


Ignore:
Timestamp:
11/14/2025 04:17:43 PM (4 months ago)
Author:
johnjamesjacoby
Message:

Tools - Build: Clean-up PHPCS, and enforce Yoda conditionals.

This commit includes changes to various PHP files, Composer requirements, and PHPCS config, to confirm that the WordPress.PHP.YodaConditions code sniff passes.

Props sirlouen.

In trunk, for 2.7.

Fixes #3613.

Location:
trunk
Files:
42 edited

Legend:

Unmodified
Added
Removed
  • trunk/composer.json

    r7106 r7352  
    44    "description": "bbPress is forum software with a twist from the creators of WordPress.",
    55    "require-dev": {
     6        "squizlabs/php_codesniffer": "^3.7.2",
    67        "phpcompatibility/phpcompatibility-wp": "^2.1",
    7         "wp-coding-standards/wpcs": "^2.3",
    8         "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2"
     8        "wp-coding-standards/wpcs": "^3.0",
     9        "dealerdirect/phpcodesniffer-composer-installer": "^1.0",
     10        "phpunit/phpunit": "^9",
     11        "yoast/phpunit-polyfills": "^3.0"
    912    },
    1013    "minimum-stability": "dev",
  • trunk/phpcs.xml.dist

    r7050 r7352  
    106106    </rule>
    107107
    108     <rule ref="WordPress.PHP.NoSilencedErrors">
    109         <properties>
    110             <property name="use_default_whitelist" value="true"/>
    111         </properties>
    112     </rule>
    113 
    114108
    115109    <!--
     
    157151    </rule>
    158152
    159     <rule ref="WordPress.Arrays.CommaAfterArrayItem.NoComma">
    160         <exclude-pattern>/src/*</exclude-pattern>
    161     </rule>
    162 
    163153
    164154    <!--
     
    168158    #############################################################################
    169159    -->
    170 
    171     <!-- Rules that require further review, partially reviewed -->
     160   
     161    <rule ref="Generic.CodeAnalysis.AssignmentInCondition.Found">
     162        <exclude-pattern>/src/*</exclude-pattern>
     163    </rule>
     164
     165    <rule ref="Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition">
     166        <exclude-pattern>/src/*</exclude-pattern>
     167    </rule>
     168
     169    <rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedElseif">
     170        <exclude-pattern>/src/*</exclude-pattern>
     171    </rule>
     172
     173    <rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedIf">
     174        <exclude-pattern>/src/*</exclude-pattern>
     175    </rule>
     176
     177    <rule ref="Generic.CodeAnalysis.RequireExplicitBooleanOperatorPrecedence.MissingParentheses">
     178        <exclude-pattern>/src/*</exclude-pattern>
     179    </rule>
     180
     181    <rule ref="Generic.CodeAnalysis.UselessOverridingMethod.Found">
     182        <exclude-pattern>/src/*</exclude-pattern>
     183    </rule>
     184
     185    <rule ref="Generic.ControlStructures.InlineControlStructure.NotAllowed">
     186        <exclude-pattern>/src/*</exclude-pattern>
     187    </rule>
     188
     189    <rule ref="Generic.Files.LineEndings.InvalidEOLChar">
     190        <exclude-pattern>/src/*</exclude-pattern>
     191    </rule>
     192
     193    <rule ref="Generic.Files.OneObjectStructurePerFile.MultipleFound">
     194        <exclude-pattern>/src/*</exclude-pattern>
     195    </rule>
    172196
    173197    <rule ref="Generic.Formatting.DisallowMultipleStatements.SameLine">
     
    187211    </rule>
    188212
    189     <rule ref="PEAR.Functions.FunctionCallSignature.Indent">
    190         <exclude-pattern>/src/*</exclude-pattern>
    191     </rule>
    192 
    193     <rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine">
    194         <exclude-pattern>/src/*</exclude-pattern>
    195     </rule>
    196 
    197     <rule ref="PSR2.ControlStructures.SwitchDeclaration.BreakIndent">
    198         <exclude-pattern>/src/*</exclude-pattern>
    199     </rule>
    200 
    201     <!-- Rules that require further review, not yet reviewed -->
    202 
    203     <rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedElseif">
    204         <exclude-pattern>/src/*</exclude-pattern>
    205     </rule>
    206 
    207     <rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedIf">
    208         <exclude-pattern>/src/*</exclude-pattern>
    209     </rule>
    210 
    211     <rule ref="Generic.CodeAnalysis.UselessOverridingMethod.Found">
    212         <exclude-pattern>/src/*</exclude-pattern>
    213     </rule>
    214 
    215     <rule ref="Generic.ControlStructures.InlineControlStructure.NotAllowed">
    216         <exclude-pattern>/src/*</exclude-pattern>
    217     </rule>
    218 
    219     <rule ref="Generic.Files.LineEndings.InvalidEOLChar">
    220         <exclude-pattern>/src/*</exclude-pattern>
    221     </rule>
    222 
    223     <rule ref="Generic.Files.OneObjectStructurePerFile.MultipleFound">
     213    <rule ref="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed">
     214        <exclude-pattern>/src/*</exclude-pattern>
     215    </rule>
     216
     217    <rule ref="NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceAfterArrayOpenerMultiLine">
     218        <exclude-pattern>/src/*</exclude-pattern>
     219    </rule>
     220
     221    <rule ref="NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceAfterArrayOpenerSingleLine">
     222        <exclude-pattern>/src/*</exclude-pattern>
     223    </rule>
     224
     225    <rule ref="NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceBeforeArrayCloserMultiLine">
     226        <exclude-pattern>/src/*</exclude-pattern>
     227    </rule>
     228
     229    <rule ref="NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceBeforeArrayCloserSingleLine">
     230        <exclude-pattern>/src/*</exclude-pattern>
     231    </rule>
     232
     233    <rule ref="NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine">
     234        <exclude-pattern>/src/*</exclude-pattern>
     235    </rule>
     236
     237    <rule ref="NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLineCloserSameLine">
    224238        <exclude-pattern>/src/*</exclude-pattern>
    225239    </rule>
     
    238252    </rule>
    239253
     254    <rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine">
     255        <exclude-pattern>/src/*</exclude-pattern>
     256    </rule>
     257
    240258    <rule ref="PEAR.Functions.FunctionCallSignature.FirstArgumentPosition">
    241259        <exclude-pattern>/src/*</exclude-pattern>
    242260    </rule>
    243261
     262    <rule ref="PEAR.Functions.FunctionCallSignature.Indent">
     263        <exclude-pattern>/src/*</exclude-pattern>
     264    </rule>
     265
    244266    <rule ref="PEAR.Functions.FunctionCallSignature.MultipleArguments">
    245267        <exclude-pattern>/src/*</exclude-pattern>
     
    270292    </rule>
    271293
     294    <rule ref="PSR2.Classes.ClassDeclaration.CloseBraceAfterBody">
     295        <exclude-pattern>/src/*</exclude-pattern>
     296    </rule>
     297
    272298    <rule ref="PSR2.Classes.PropertyDeclaration.ScopeMissing">
    273299        <exclude-pattern>/src/*</exclude-pattern>
     
    294320    </rule>
    295321
     322    <rule ref="PSR2.ControlStructures.SwitchDeclaration.BreakIndent">
     323        <exclude-pattern>/src/*</exclude-pattern>
     324    </rule>
     325
    296326    <rule ref="PSR2.ControlStructures.SwitchDeclaration.SpaceBeforeColonCASE">
    297327        <exclude-pattern>/src/*</exclude-pattern>
     
    302332    </rule>
    303333
     334    <rule ref="PSR2.Methods.FunctionClosingBrace.SpacingBeforeClose">
     335        <exclude-pattern>/src/*</exclude-pattern>
     336    </rule>
     337
    304338    <rule ref="PSR2.Methods.MethodDeclaration.Underscore">
    305339        <exclude-pattern>/src/*</exclude-pattern>
     
    318352    </rule>
    319353
     354    <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose">
     355        <exclude-pattern>/src/*</exclude-pattern>
     356    </rule>
     357
     358    <rule ref="Squiz.Functions.MultiLineFunctionDeclaration.ContentAfterBrace">
     359        <exclude-pattern>/src/*</exclude-pattern>
     360    </rule>
     361
    320362    <rule ref="Squiz.PHP.CommentedOutCode.Found">
    321363        <exclude-pattern>/src/*</exclude-pattern>
     
    362404    </rule>
    363405
     406    <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndLine">
     407        <exclude-pattern>/src/*</exclude-pattern>
     408    </rule>
     409
     410    <rule ref="Universal.Arrays.DuplicateArrayKey.Found">
     411        <exclude-pattern>/src/*</exclude-pattern>
     412    </rule>
     413
     414    <rule ref="Universal.ControlStructures.DisallowLonelyIf.Found">
     415        <exclude-pattern>/src/*</exclude-pattern>
     416    </rule>
     417
     418    <rule ref="Universal.Files.SeparateFunctionsFromOO.Mixed">
     419        <exclude-pattern>/src/*</exclude-pattern>
     420    </rule>
     421
     422    <rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames.arrayFound">
     423        <exclude-pattern>/src/*</exclude-pattern>
     424    </rule>
     425
     426    <rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames.classFound">
     427        <exclude-pattern>/src/*</exclude-pattern>
     428    </rule>
     429
     430    <rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames.defaultFound">
     431        <exclude-pattern>/src/*</exclude-pattern>
     432    </rule>
     433
     434    <rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames.echoFound">
     435        <exclude-pattern>/src/*</exclude-pattern>
     436    </rule>
     437
     438    <rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames.objectFound">
     439        <exclude-pattern>/src/*</exclude-pattern>
     440    </rule>
     441
     442    <rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames.parentFound">
     443        <exclude-pattern>/src/*</exclude-pattern>
     444    </rule>
     445
     446    <rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames.require_onceFound">
     447        <exclude-pattern>/src/*</exclude-pattern>
     448    </rule>
     449
     450    <rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames.stringFound">
     451        <exclude-pattern>/src/*</exclude-pattern>
     452    </rule>
     453
     454    <rule ref="Universal.Operators.DisallowStandalonePostIncrementDecrement.PostDecrementFound">
     455        <exclude-pattern>/src/*</exclude-pattern>
     456    </rule>
     457
     458    <rule ref="Universal.Operators.DisallowStandalonePostIncrementDecrement.PostIncrementFound">
     459        <exclude-pattern>/src/*</exclude-pattern>
     460    </rule>
     461
     462    <rule ref="Universal.Operators.StrictComparisons.LooseEqual">
     463        <exclude-pattern>/src/*</exclude-pattern>
     464    </rule>
     465
     466    <rule ref="Universal.Operators.StrictComparisons.LooseNotEqual">
     467        <exclude-pattern>/src/*</exclude-pattern>
     468    </rule>
     469
     470    <rule ref="Universal.WhiteSpace.CommaSpacing.TooMuchSpaceAfter">
     471        <exclude-pattern>/src/*</exclude-pattern>
     472    </rule>
     473
     474    <rule ref="Universal.WhiteSpace.DisallowInlineTabs.NonIndentTabsUsed">
     475        <exclude-pattern>/src/*</exclude-pattern>
     476    </rule>
     477
     478    <rule ref="Universal.WhiteSpace.PrecisionAlignment.Found">
     479        <exclude-pattern>/src/*</exclude-pattern>
     480    </rule>
     481
    364482    <rule ref="WordPress.Arrays.ArrayDeclarationSpacing.ArrayItemNoNewLine">
    365483        <exclude-pattern>/src/*</exclude-pattern>
     
    370488    </rule>
    371489
    372     <rule ref="WordPress.Arrays.ArrayDeclarationSpacing.CloseBraceNewLine">
    373         <exclude-pattern>/src/*</exclude-pattern>
    374     </rule>
    375 
    376     <rule ref="WordPress.Arrays.ArrayDeclarationSpacing.NoSpaceAfterArrayOpener">
    377         <exclude-pattern>/src/*</exclude-pattern>
    378     </rule>
    379 
    380     <rule ref="WordPress.Arrays.ArrayDeclarationSpacing.NoSpaceBeforeArrayCloser">
    381         <exclude-pattern>/src/*</exclude-pattern>
    382     </rule>
    383 
    384     <rule ref="WordPress.Arrays.ArrayDeclarationSpacing.SpaceBeforeArrayCloser">
    385         <exclude-pattern>/src/*</exclude-pattern>
    386     </rule>
    387 
    388490    <rule ref="WordPress.Arrays.ArrayIndentation.CloseBraceNotAligned">
    389491        <exclude-pattern>/src/*</exclude-pattern>
     
    410512    </rule>
    411513
    412     <rule ref="WordPress.Arrays.CommaAfterArrayItem.SpaceAfterComma">
    413         <exclude-pattern>/src/*</exclude-pattern>
    414     </rule>
    415 
    416514    <rule ref="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned">
    417515        <exclude-pattern>/src/*</exclude-pattern>
     
    426524    </rule>
    427525
    428     <rule ref="WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition">
    429         <exclude-pattern>/src/*</exclude-pattern>
    430     </rule>
    431 
    432     <rule ref="WordPress.CodeAnalysis.AssignmentInCondition.Found">
    433         <exclude-pattern>/src/*</exclude-pattern>
    434     </rule>
    435 
    436     <rule ref="WordPress.CodeAnalysis.EmptyStatement">
     526    <rule ref="WordPress.DB.PreparedSQL.InterpolatedNotPrepared">
     527    <exclude-pattern>/src/*</exclude-pattern>
     528    </rule>
     529
     530    <rule ref="WordPress.DB.PreparedSQL.NotPrepared">
     531        <exclude-pattern>/src/*</exclude-pattern>
     532    </rule>
     533
     534    <rule ref="WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare">
    437535        <exclude-pattern>/src/*</exclude-pattern>
    438536    </rule>
     
    446544    </rule>
    447545
    448     <rule ref="WordPress.DB.PreparedSQL.InterpolatedNotPrepared">
    449         <exclude-pattern>/src/*</exclude-pattern>
    450     </rule>
    451 
    452     <rule ref="WordPress.DB.PreparedSQL.NotPrepared">
    453         <exclude-pattern>/src/*</exclude-pattern>
    454     </rule>
    455 
    456546    <rule ref="WordPress.Files.FileName.InvalidClassFileName">
    457         <exclude-pattern>/src/*</exclude-pattern>
     547    <exclude-pattern>/src/*</exclude-pattern>
    458548    </rule>
    459549
     
    471561
    472562    <rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound">
    473         <exclude-pattern>/src/*</exclude-pattern>
     563    <exclude-pattern>/src/*</exclude-pattern>
    474564    </rule>
    475565
     
    486576    </rule>
    487577
    488     <rule ref="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid">
    489         <exclude-pattern>/src/*</exclude-pattern>
    490     </rule>
    491 
    492578    <rule ref="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase">
    493579        <exclude-pattern>/src/*</exclude-pattern>
     
    518604    </rule>
    519605
    520     <rule ref="WordPress.PHP.StrictComparisons.LooseComparison">
    521         <exclude-pattern>/src/*</exclude-pattern>
    522     </rule>
    523 
    524606    <rule ref="WordPress.PHP.StrictInArray.MissingTrueStrict">
    525607        <exclude-pattern>/src/*</exclude-pattern>
    526608    </rule>
    527609
    528     <rule ref="WordPress.PHP.YodaConditions.NotYoda">
    529         <exclude-pattern>/src/*</exclude-pattern>
    530     </rule>
    531 
    532610    <rule ref="WordPress.Security.EscapeOutput.OutputNotEscaped">
    533611        <exclude-pattern>/src/*</exclude-pattern>
     
    546624    </rule>
    547625
    548     <rule ref="WordPress.WhiteSpace.ControlStructureSpacing.ExtraSpaceAfterCloseParenthesis">
     626    <rule ref="WordPress.WP.AlternativeFunctions.json_encode_json_encode">
     627        <exclude-pattern>/src/*</exclude-pattern>
     628    </rule>
     629
     630    <rule ref="WordPress.WP.AlternativeFunctions.parse_url_parse_url">
     631        <exclude-pattern>/src/*</exclude-pattern>
     632    </rule>
     633
     634    <rule ref="WordPress.WP.AlternativeFunctions.rand_mt_rand">
     635        <exclude-pattern>/src/*</exclude-pattern>
     636    </rule>
     637
     638    <rule ref="WordPress.WP.AlternativeFunctions.strip_tags_strip_tag">
     639        <exclude-pattern>/src/*</exclude-pattern>
     640    </rule>
     641
     642    <rule ref="WordPress.WP.AlternativeFunctions.strip_tags_strip_tags">
     643        <exclude-pattern>/src/*</exclude-pattern>
     644    </rule>
     645
     646    <rule ref="WordPress.WP.Capabilities.Unknown">
     647        <exclude-pattern>/src/*</exclude-pattern>
     648    </rule>
     649
     650    <rule ref="WordPress.WP.DeprecatedParameters.Get_termsParam2Found">
     651        <exclude-pattern>/src/*</exclude-pattern>
     652    </rule>
     653
     654    <rule ref="WordPress.WP.DeprecatedParameters.Wp_count_termsParam2Found">
     655        <exclude-pattern>/src/*</exclude-pattern>
     656    </rule>
     657
     658    <rule ref="WordPress.WP.DiscouragedFunctions.query_posts_query_posts">
     659        <exclude-pattern>/src/*</exclude-pattern>
     660    </rule>
     661
     662    <rule ref="WordPress.WP.DiscouragedFunctions.wp_reset_query_wp_reset_query">
     663        <exclude-pattern>/src/*</exclude-pattern>
     664    </rule>
     665
     666    <rule ref="WordPress.WP.EnqueuedResourceParameters.NotInFooter">
     667        <exclude-pattern>/src/*</exclude-pattern>
     668    </rule>
     669
     670    <rule ref="WordPress.WP.GlobalVariablesOverride.Prohibited">
     671        <exclude-pattern>/src/*</exclude-pattern>
     672    </rule>
     673
     674    <rule ref="WordPress.WP.I18n.LowLevelTranslationFunction">
     675        <exclude-pattern>/src/*</exclude-pattern>
     676    </rule>
     677
     678    <rule ref="WordPress.WP.I18n.MissingTranslatorsComment">
     679        <exclude-pattern>/src/*</exclude-pattern>
     680    </rule>
     681
     682    <rule ref="WordPress.WP.I18n.NonSingularStringLiteralText">
     683        <exclude-pattern>/src/*</exclude-pattern>
     684    </rule>
     685
     686    <rule ref="WordPress.WP.PostsPerPage.posts_per_page_posts_per_page">
    549687        <exclude-pattern>/src/*</exclude-pattern>
    550688    </rule>
     
    554692    </rule>
    555693
     694    <rule ref="WordPress.WhiteSpace.ControlStructureSpacing.ExtraSpaceBeforeCloseParenthesis">
     695        <exclude-pattern>/src/*</exclude-pattern>
     696    </rule>
     697
    556698    <rule ref="WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterOpenParenthesis">
    557699        <exclude-pattern>/src/*</exclude-pattern>
     
    562704    </rule>
    563705
    564     <rule ref="WordPress.WhiteSpace.DisallowInlineTabs.NonIndentTabsUsed">
    565         <exclude-pattern>/src/*</exclude-pattern>
    566     </rule>
    567 
    568706    <rule ref="WordPress.WhiteSpace.OperatorSpacing.NoSpaceAfter">
    569707        <exclude-pattern>/src/*</exclude-pattern>
     
    581719        <exclude-pattern>/src/*</exclude-pattern>
    582720    </rule>
    583 
    584     <rule ref="WordPress.WhiteSpace.PrecisionAlignment.Found">
    585         <exclude-pattern>/src/*</exclude-pattern>
    586     </rule>
    587 
    588     <rule ref="WordPress.WP.AlternativeFunctions.json_encode_json_encode">
    589         <exclude-pattern>/src/*</exclude-pattern>
    590     </rule>
    591 
    592     <rule ref="WordPress.WP.AlternativeFunctions.parse_url_parse_url">
    593         <exclude-pattern>/src/*</exclude-pattern>
    594     </rule>
    595 
    596     <rule ref="WordPress.WP.AlternativeFunctions.rand_mt_rand">
    597         <exclude-pattern>/src/*</exclude-pattern>
    598     </rule>
    599 
    600     <rule ref="WordPress.WP.AlternativeFunctions.strip_tags_strip_tags">
    601         <exclude-pattern>/src/*</exclude-pattern>
    602     </rule>
    603 
    604     <rule ref="WordPress.WP.DiscouragedFunctions.query_posts_query_posts">
    605         <exclude-pattern>/src/*</exclude-pattern>
    606     </rule>
    607 
    608     <rule ref="WordPress.WP.DiscouragedFunctions.wp_reset_query_wp_reset_query">
    609         <exclude-pattern>/src/*</exclude-pattern>
    610     </rule>
    611 
    612     <rule ref="WordPress.WP.EnqueuedResourceParameters.NotInFooter">
    613         <exclude-pattern>/src/*</exclude-pattern>
    614     </rule>
    615 
    616     <rule ref="WordPress.WP.GlobalVariablesOverride.Prohibited">
    617         <exclude-pattern>/src/*</exclude-pattern>
    618     </rule>
    619 
    620     <rule ref="WordPress.WP.I18n.LowLevelTranslationFunction">
    621         <exclude-pattern>/src/*</exclude-pattern>
    622     </rule>
    623 
    624     <rule ref="WordPress.WP.I18n.MissingTranslatorsComment">
    625         <exclude-pattern>/src/*</exclude-pattern>
    626     </rule>
    627 
    628     <rule ref="WordPress.WP.I18n.NonSingularStringLiteralText">
    629         <exclude-pattern>/src/*</exclude-pattern>
    630     </rule>
    631 
     721   
    632722</ruleset>
  • trunk/src/includes/admin/classes/class-bbp-admin.php

    r7345 r7352  
    973973
    974974        // Forum Archive
    975         } elseif ( $post->post_name === bbp_get_root_slug() ) {
     975        } elseif ( bbp_get_root_slug() === $post->post_name ) {
    976976            $retval[] = esc_html_x( 'Forum Archive', 'page label', 'bbpress' );
    977977
    978978        // Topic Archive
    979         } elseif ( $post->post_name === bbp_get_topic_archive_slug() ) {
     979        } elseif ( bbp_get_topic_archive_slug() === $post->post_name ) {
    980980            $retval[] = esc_html_x( 'Topic Archive', 'page label', 'bbpress' );
    981981        }
  • trunk/src/includes/admin/classes/class-bbp-converter-base.php

    r7244 r7352  
    473473                                // Translates a field from the old forum.
    474474                                } elseif ( isset( $row['callback_method'] ) ) {
    475                                     if ( ( $row['callback_method'] === 'callback_userid' ) && ( false === $this->convert_users ) ) {
     475                                    if ( ( 'callback_userid' === $row['callback_method'] ) && ( false === $this->convert_users ) ) {
    476476                                        $insert_postmeta[ $row['to_fieldname'] ] = $forum[ $row['from_fieldname'] ];
    477477                                    } else {
     
    490490
    491491                    // Something to insert into the destination field
    492                     if ( count( $insert_post ) > 0 || ( $to_type == 'tags' && count( $insert_postmeta ) > 0 ) ) {
     492                    if ( count( $insert_post ) > 0 || ( 'tags' === $to_type && count( $insert_postmeta ) > 0 ) ) {
    493493
    494494                        switch ( $to_type ) {
  • trunk/src/includes/admin/converters/AEF.php

    r6670 r7352  
    588588    public function authenticate_pass( $password, $serialized_pass ) {
    589589        $pass_array = unserialize( $serialized_pass );
    590         return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
     590        return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] );
    591591    }
    592592
  • trunk/src/includes/admin/converters/Drupal7.php

    r6670 r7352  
    586586    public function authenticate_pass( $password, $serialized_pass ) {
    587587        $pass_array = unserialize( $serialized_pass );
    588         return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
     588        return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] );
    589589    }
    590590
  • trunk/src/includes/admin/converters/Example.php

    r7056 r7352  
    707707    public function authenticate_pass( $password, $serialized_pass ) {
    708708        $pass_array = unserialize( $serialized_pass );
    709         return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
     709        return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] );
    710710    }
    711711}
  • trunk/src/includes/admin/converters/FluxBB.php

    r6670 r7352  
    609609    public function authenticate_pass( $password, $serialized_pass ) {
    610610        $pass_array = unserialize( $serialized_pass );
    611         return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
     611        return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] );
    612612    }
    613613
  • trunk/src/includes/admin/converters/Invision.php

    r7056 r7352  
    483483     */
    484484    public function callback_forum_type( $status = 0 ) {
    485         if ( $status == -1 ) {
     485        if ( -1 == $status ) {
    486486            $status = 'category';
    487487        } else {
     
    537537    public function authenticate_pass( $password, $serialized_pass ) {
    538538        $pass_array = unserialize( $serialized_pass );
    539         return ( $pass_array['hash'] == md5( md5( $pass_array['salt'] ) . md5( $this->to_char( $password ) ) ) );
     539        return ( md5( md5( $pass_array['salt'] ) . md5( $this->to_char( $password ) ) ) == $pass_array['hash'] );
    540540    }
    541541
  • trunk/src/includes/admin/converters/Kunena1.php

    r6670 r7352  
    464464    public function authenticate_pass($password, $serialized_pass) {
    465465        $pass_array = unserialize($serialized_pass);
    466         return ( $pass_array['hash'] == md5(md5($password) . $pass_array['salt']) );
     466        return ( md5(md5($password) . $pass_array['salt']) == $pass_array['hash'] );
    467467    }
    468468
     
    474474     */
    475475    public function callback_forum_type( $status = 0 ) {
    476         if ( $status == 0 ) {
     476        if ( 0 == $status ) {
    477477            $status = 'category';
    478478        } else {
  • trunk/src/includes/admin/converters/Kunena2.php

    r7006 r7352  
    495495    public function authenticate_pass($password, $serialized_pass) {
    496496        $pass_array = unserialize($serialized_pass);
    497         return ( $pass_array['hash'] == md5(md5($password) . $pass_array['salt']) );
     497        return ( md5(md5($password) . $pass_array['salt']) == $pass_array['hash'] );
    498498    }
    499499    /**
     
    504504     */
    505505    public function callback_forum_type( $status = 0 ) {
    506         if ( $status == 0 ) {
     506        if ( 0 == $status ) {
    507507            $status = 'category';
    508508        } else {
  • trunk/src/includes/admin/converters/Kunena3.php

    r6670 r7352  
    719719    public function authenticate_pass( $password, $serialized_pass ) {
    720720        $pass_array = unserialize( $serialized_pass );
    721         return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
     721        return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] );
    722722    }
    723723
     
    729729     */
    730730    public function callback_forum_type( $status = 0 ) {
    731         if ( $status == 0 ) {
     731        if ( 0 == $status ) {
    732732            $status = 'category';
    733733        } else {
  • trunk/src/includes/admin/converters/MyBB.php

    r6670 r7352  
    535535    public function authenticate_pass( $password, $serialized_pass ) {
    536536        $pass_array = unserialize( $serialized_pass );
    537         return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
     537        return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] );
    538538    }
    539539
  • trunk/src/includes/admin/converters/PHPFox3.php

    r6670 r7352  
    525525    public function authenticate_pass( $password, $serialized_pass ) {
    526526        $pass_array = unserialize( $serialized_pass );
    527         return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
     527        return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] );
    528528    }
    529529
  • trunk/src/includes/admin/converters/PHPWind.php

    r6670 r7352  
    505505    public function authenticate_pass( $password, $serialized_pass ) {
    506506        $pass_array = unserialize( $serialized_pass );
    507         return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
     507        return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] );
    508508    }
    509509
  • trunk/src/includes/admin/converters/Phorum.php

    r6670 r7352  
    535535    public function authenticate_pass( $password, $serialized_pass ) {
    536536        $pass_array = unserialize( $serialized_pass );
    537         return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
     537        return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] );
    538538    }
    539539
  • trunk/src/includes/admin/converters/PunBB.php

    r6670 r7352  
    682682    public function authenticate_pass( $password, $serialized_pass ) {
    683683        $pass_array = unserialize( $serialized_pass );
    684         return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
     684        return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] );
    685685    }
    686686
  • trunk/src/includes/admin/converters/SMF.php

    r7006 r7352  
    677677    public function authenticate_pass( $password, $serialized_pass ) {
    678678        $pass_array = unserialize( $serialized_pass );
    679         return ( $pass_array['hash'] === sha1( strtolower( $pass_array['username'] ) . $password ) ? true : false );
     679        return ( sha1( strtolower( $pass_array['username'] ) . $password ) === $pass_array['hash'] ? true : false );
    680680    }
    681681
  • trunk/src/includes/admin/converters/Vanilla.php

    r7056 r7352  
    572572     */
    573573    public function callback_forum_parent( $parent = 0 ) {
    574         if ( $parent == -1 ) {
     574        if ( -1 == $parent ) {
    575575            return 0;
    576576        } else {
  • trunk/src/includes/admin/converters/XMB.php

    r6670 r7352  
    642642    public function authenticate_pass( $password, $serialized_pass ) {
    643643        $pass_array = unserialize( $serialized_pass );
    644         return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
     644        return ( md5( md5( $password ). $pass_array['salt'] == $pass_array['hash'] ) );
    645645    }
    646646
  • trunk/src/includes/admin/converters/XenForo.php

    r7056 r7352  
    700700        switch ( $pass_array['hashFunc'] ) {
    701701            case 'sha256':
    702                 return ( $pass_array['hash'] == hash( 'sha256', hash( 'sha256', $password ) . $pass_array['salt'] ) );
     702                return ( hash( 'sha256', hash( 'sha256', $password ) . $pass_array['salt'] ) == $pass_array['hash'] );
    703703            case 'sha1':
    704                 return ( $pass_array['hash'] == sha1( sha1( $password ) . $pass_array['salt'] ) );
     704                return ( sha1( sha1( $password ) . $pass_array['salt'] ) == $pass_array['hash'] );
    705705        }
    706706    }
  • trunk/src/includes/admin/converters/bbPress1.php

    r7056 r7352  
    662662     */
    663663    public function callback_forum_type( $status = 0 ) {
    664         if ( $status == 1 ) {
     664        if ( 1 == $status ) {
    665665            $status = 'category';
    666666        } else {
  • trunk/src/includes/admin/converters/e107v1.php

    r7006 r7352  
    490490    public function authenticate_pass( $password, $serialized_pass ) {
    491491        $pass_array = unserialize( $serialized_pass );
    492         return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );
     492        return ( md5( md5( $password ). $pass_array['salt'] ) == $pass_array['hash'] );
    493493    }
    494494
     
    500500     */
    501501    public function callback_forum_type( $status = 0 ) {
    502         if ( $status == 0 ) {
     502        if ( 0 == $status ) {
    503503            $status = 'category';
    504504        } else {
  • trunk/src/includes/admin/converters/vBulletin.php

    r7056 r7352  
    652652    public function authenticate_pass( $password, $serialized_pass ) {
    653653        $pass_array = unserialize( $serialized_pass );
    654         return ( $pass_array['hash'] == md5( md5( $password ) . $pass_array['salt'] ) );
     654        return ( md5( md5( $password ) . $pass_array['salt'] ) == $pass_array['hash'] );
    655655    }
    656656
     
    662662     */
    663663    public function callback_forum_type( $status = 0 ) {
    664         if ( $status == -1 ) {
     664        if ( -1 == $status ) {
    665665            $status = 'category';
    666666        } else {
  • trunk/src/includes/admin/converters/vBulletin3.php

    r7056 r7352  
    656656    public function authenticate_pass( $password, $serialized_pass ) {
    657657        $pass_array = unserialize( $serialized_pass );
    658         return ( $pass_array['hash'] == md5( md5( $password ) . $pass_array['salt'] ) );
     658        return ( md5( md5( $password ) . $pass_array['salt'] ) == $pass_array['hash'] );
    659659    }
    660660
     
    666666     */
    667667    public function callback_forum_type( $status = 0 ) {
    668         if ( $status == -1 ) {
     668        if ( -1 == $status ) {
    669669            $status = 'category';
    670670        } else {
  • trunk/src/includes/admin/forums.php

    r7190 r7352  
    448448        switch ( $notice ) {
    449449            case 'opened' :
    450                 $message = ( $is_failure === true )
     450                $message = ( true === $is_failure )
    451451                    ? sprintf( esc_html__( 'There was a problem opening the forum "%1$s".', 'bbpress' ), $forum_title )
    452452                    : sprintf( esc_html__( 'Forum "%1$s" successfully opened.',             'bbpress' ), $forum_title );
     
    454454
    455455            case 'closed' :
    456                 $message = ( $is_failure === true )
     456                $message = ( true === $is_failure )
    457457                    ? sprintf( esc_html__( 'There was a problem closing the forum "%1$s".', 'bbpress' ), $forum_title )
    458458                    : sprintf( esc_html__( 'Forum "%1$s" successfully closed.',             'bbpress' ), $forum_title );
     
    462462        // Do additional forum toggle notice filters (admin side)
    463463        $message = apply_filters( 'bbp_toggle_forum_notice_admin', $message, $forum_id, $notice, $is_failure );
    464         $class   = ( $is_failure === true )
     464        $class   = ( true === $is_failure )
    465465            ? 'error'
    466466            : 'updated';
  • trunk/src/includes/admin/replies.php

    r7190 r7352  
    422422        $anonymous_data = bbp_filter_anonymous_post_data();
    423423        $author_id      = bbp_get_reply_author_id( $reply_id );
    424         $is_edit        = ( isset( $_POST['hidden_post_status'] ) && ( $_POST['hidden_post_status'] !== 'draft' ) );
     424        $is_edit        = ( isset( $_POST['hidden_post_status'] ) && ( 'draft' !== $_POST['hidden_post_status'] ) );
    425425
    426426        // Formally update the reply
     
    559559        switch ( $notice ) {
    560560            case 'spammed' :
    561                 $message = ( $is_failure === true )
     561                $message = ( true === $is_failure )
    562562                    ? sprintf( esc_html__( 'There was a problem marking the reply "%1$s" as spam.', 'bbpress' ), $reply_title )
    563563                    : sprintf( esc_html__( 'Reply "%1$s" successfully marked as spam.',             'bbpress' ), $reply_title );
     
    565565
    566566            case 'unspammed' :
    567                 $message = ( $is_failure === true )
     567                $message = ( true === $is_failure )
    568568                    ? sprintf( esc_html__( 'There was a problem unmarking the reply "%1$s" as spam.', 'bbpress' ), $reply_title )
    569569                    : sprintf( esc_html__( 'Reply "%1$s" successfully unmarked as spam.',             'bbpress' ), $reply_title );
     
    571571
    572572            case 'approved' :
    573                 $message = ( $is_failure === true )
     573                $message = ( true === $is_failure )
    574574                    ? sprintf( esc_html__( 'There was a problem approving the reply "%1$s".', 'bbpress' ), $reply_title )
    575575                    : sprintf( esc_html__( 'Reply "%1$s" successfully approved.',             'bbpress' ), $reply_title );
     
    577577
    578578            case 'unapproved' :
    579                 $message = ( $is_failure === true )
     579                $message = ( true === $is_failure )
    580580                    ? sprintf( esc_html__( 'There was a problem unapproving the reply "%1$s".', 'bbpress' ), $reply_title )
    581581                    : sprintf( esc_html__( 'Reply "%1$s" successfully unapproved.',             'bbpress' ), $reply_title );
     
    585585        // Do additional reply toggle notice filters (admin side)
    586586        $message = apply_filters( 'bbp_toggle_reply_notice_admin', $message, $reply_id, $notice, $is_failure );
    587         $class   = ( $is_failure === true )
     587        $class   = ( true === $is_failure )
    588588            ? 'error'
    589589            : 'updated';
  • trunk/src/includes/admin/tools/repair.php

    r7344 r7352  
    10671067            // If the topic is not a super sticky, and the forum ID does not
    10681068            // match the topic's forum ID, unset the forum's sticky meta.
    1069             if ( ! bbp_is_topic_super_sticky( $topic_id ) && ( $forum_id !== bbp_get_topic_forum_id( $topic_id ) ) ) {
     1069            if ( ! bbp_is_topic_super_sticky( $topic_id ) && ( bbp_get_topic_forum_id( $topic_id ) ) !== $forum_id ) {
    10701070                unset( $forum_stickies[ $forum_id ][ $id ] );
    10711071            }
  • trunk/src/includes/admin/topics.php

    r7190 r7352  
    539539        $anonymous_data = bbp_filter_anonymous_post_data();
    540540        $author_id      = bbp_get_topic_author_id( $topic_id );
    541         $is_edit        = ( isset( $_POST['hidden_post_status'] ) && ( $_POST['hidden_post_status'] !== 'draft' ) );
     541        $is_edit        = ( isset( $_POST['hidden_post_status'] ) && ( 'draft' !== $_POST['hidden_post_status'] ) );
    542542
    543543        // Formally update the topic
     
    710710        switch ( $notice ) {
    711711            case 'opened'    :
    712                 $message = ( $is_failure === true )
     712                $message = ( true === $is_failure )
    713713                    ? sprintf( esc_html__( 'There was a problem opening the topic "%1$s".', 'bbpress' ), $topic_title )
    714714                    : sprintf( esc_html__( 'Topic "%1$s" successfully opened.',             'bbpress' ), $topic_title );
     
    716716
    717717            case 'closed'    :
    718                 $message = ( $is_failure === true )
     718                $message = ( true === $is_failure )
    719719                    ? sprintf( esc_html__( 'There was a problem closing the topic "%1$s".', 'bbpress' ), $topic_title )
    720720                    : sprintf( esc_html__( 'Topic "%1$s" successfully closed.',             'bbpress' ), $topic_title );
     
    722722
    723723            case 'super_sticky' :
    724                 $message = ( $is_failure === true )
     724                $message = ( true ===  $is_failure )
    725725                    ? sprintf( esc_html__( 'There was a problem sticking the topic "%1$s" to front.', 'bbpress' ), $topic_title )
    726726                    : sprintf( esc_html__( 'Topic "%1$s" successfully stuck to front.',               'bbpress' ), $topic_title );
     
    728728
    729729            case 'stuck'   :
    730                 $message = ( $is_failure === true )
     730                $message = ( true === $is_failure )
    731731                    ? sprintf( esc_html__( 'There was a problem sticking the topic "%1$s".', 'bbpress' ), $topic_title )
    732732                    : sprintf( esc_html__( 'Topic "%1$s" successfully stuck.',               'bbpress' ), $topic_title );
     
    734734
    735735            case 'unstuck' :
    736                 $message = ( $is_failure === true )
     736                $message = ( true === $is_failure )
    737737                    ? sprintf( esc_html__( 'There was a problem unsticking the topic "%1$s".', 'bbpress' ), $topic_title )
    738738                    : sprintf( esc_html__( 'Topic "%1$s" successfully unstuck.',               'bbpress' ), $topic_title );
     
    740740
    741741            case 'spammed'   :
    742                 $message = ( $is_failure === true )
     742                $message = ( true === $is_failure )
    743743                    ? sprintf( esc_html__( 'There was a problem marking the topic "%1$s" as spam.', 'bbpress' ), $topic_title )
    744744                    : sprintf( esc_html__( 'Topic "%1$s" successfully marked as spam.',             'bbpress' ), $topic_title );
     
    746746
    747747            case 'unspammed' :
    748                 $message = ( $is_failure === true )
     748                $message = ( true === $is_failure )
    749749                    ? sprintf( esc_html__( 'There was a problem unmarking the topic "%1$s" as spam.', 'bbpress' ), $topic_title )
    750750                    : sprintf( esc_html__( 'Topic "%1$s" successfully unmarked as spam.',             'bbpress' ), $topic_title );
     
    752752
    753753            case 'approved'   :
    754                 $message = ( $is_failure === true )
     754                $message = ( true === $is_failure )
    755755                    ? sprintf( esc_html__( 'There was a problem approving the topic "%1$s".', 'bbpress' ), $topic_title )
    756756                    : sprintf( esc_html__( 'Topic "%1$s" successfully approved.',             'bbpress' ), $topic_title );
     
    758758
    759759            case 'unapproved' :
    760                 $message = ( $is_failure === true )
     760                $message = ( true === $is_failure )
    761761                    ? sprintf( esc_html__( 'There was a problem unapproving the topic "%1$s".', 'bbpress' ), $topic_title )
    762762                    : sprintf( esc_html__( 'Topic "%1$s" successfully unapproved.',             'bbpress' ), $topic_title );
     
    766766        // Do additional topic toggle notice filters (admin side)
    767767        $message = apply_filters( 'bbp_toggle_topic_notice_admin', $message, $topic_id, $notice, $is_failure );
    768         $class   = ( $is_failure === true )
     768        $class   = ( true === $is_failure )
    769769            ? 'error'
    770770            : 'updated';
  • trunk/src/includes/common/formatting.php

    r7335 r7352  
    369369        }
    370370
    371         if ( $nested_code_pre || empty( $piece ) || ( $piece[0] === '<' && ! preg_match( '|^<\s*[\w]{1,20}+://|', $piece ) ) ) {
     371        if ( $nested_code_pre || empty( $piece ) || ( '<' === $piece[0] && ! preg_match( '|^<\s*[\w]{1,20}+://|', $piece ) ) ) {
    372372            $r .= $piece;
    373373            continue;
  • trunk/src/includes/common/locks.php

    r6344 r7352  
    4444
    4545    // Return user who is or last edited
    46     if ( ! empty( $time ) && ( $time > ( time() - $time_window ) ) && ( $user !== bbp_get_current_user_id() ) ) {
     46    if ( ! empty( $time ) && ( $time > ( time() - $time_window ) ) && ( bbp_get_current_user_id() ) !== $user ) {
    4747        return (int) $user;
    4848    }
  • trunk/src/includes/common/template.php

    r7312 r7352  
    196196
    197197    // Check query
    198     if ( ! empty( $wp_query->bbp_is_forum_edit ) && ( $wp_query->bbp_is_forum_edit === true ) ) {
     198    if ( ! empty( $wp_query->bbp_is_forum_edit ) && ( true === $wp_query->bbp_is_forum_edit ) ) {
    199199        $retval = true;
    200200
     
    296296
    297297    // Check query
    298     if ( ! empty( $wp_query->bbp_is_topic_edit ) && ( $wp_query->bbp_is_topic_edit === true ) ) {
     298    if ( ! empty( $wp_query->bbp_is_topic_edit ) && ( true === $wp_query->bbp_is_topic_edit ) ) {
    299299        $retval = true;
    300300
     
    958958
    959959    // Check query
    960     if ( ! empty( $wp_query->bbp_is_edit ) && ( $wp_query->bbp_is_edit === true ) ) {
     960    if ( ! empty( $wp_query->bbp_is_edit ) && ( true === $wp_query->bbp_is_edit ) ) {
    961961        $retval = true;
    962962    }
     
    23182318
    23192319        // Don't show root if viewing page in place of forum archive
    2320         if ( ! empty( $root_id ) && ( ( is_single() || is_page() ) && ( $root_id === get_the_ID() ) ) ) {
     2320        if ( ! empty( $root_id ) && ( ( is_single() || is_page() ) && ( get_the_ID() === $root_id ) ) ) {
    23212321            $pre_include_root = false;
    23222322        }
  • trunk/src/includes/core/abstraction.php

    r7099 r7352  
    472472
    473473    // Return filtered value, or default if not intercepted
    474     return ( $filtered === reset( $r ) )
     474    return ( reset( $r ) === $filtered )
    475475        ? $default
    476476        : $filtered;
  • trunk/src/includes/core/update.php

    r7344 r7352  
    7171
    7272    // The plugin(s) being activated
    73     if ( $action === 'activate' ) {
     73    if ( 'activate' === $action ) {
    7474        $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array();
    7575    } else {
     
    123123
    124124    // The plugin(s) being deactivated
    125     if ( $action === 'deactivate' ) {
     125    if ( 'deactivate' === $action ) {
    126126        $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array();
    127127    } else {
  • trunk/src/includes/extend/akismet.php

    r7325 r7352  
    596596
    597597                // Normal result: true
    598                 if ( ! empty( $this->last_post['bbp_akismet_result'] ) && ( $this->last_post['bbp_akismet_result'] === 'true' ) ) {
     598                if ( ! empty( $this->last_post['bbp_akismet_result'] ) && ( 'true' === $this->last_post['bbp_akismet_result'] ) ) {
    599599
    600600                    // Leave a trail so other's know what we did
     
    619619
    620620                // Normal result: false
    621                 } elseif ( ! empty( $this->last_post['bbp_akismet_result'] ) && ( $this->last_post['bbp_akismet_result'] === 'false' ) ) {
     621                } elseif ( ! empty( $this->last_post['bbp_akismet_result'] ) && ( 'false' === $this->last_post['bbp_akismet_result'] ) ) {
    622622
    623623                    // Leave a trail so other's know what we did
  • trunk/src/includes/forums/functions.php

    r7350 r7352  
    287287        // If the forum is trash, or the forum_status is switched to
    288288        // trash, trash it properly
    289         if ( ( get_post_field( 'post_status', $forum_id ) === bbp_get_trash_status_id() ) || ( $forum_data['post_status'] === bbp_get_trash_status_id() ) ) {
     289        if ( ( get_post_field( 'post_status', $forum_id ) === bbp_get_trash_status_id() ) || ( bbp_get_trash_status_id() === $forum_data['post_status'] ) ) {
    290290
    291291            // Trash the reply
     
    299299
    300300        // If reply or forum are spam, officially spam this reply
    301         if ( $forum_data['post_status'] === bbp_get_spam_status_id() ) {
     301        if ( bbp_get_spam_status_id() === $forum_data['post_status'] ) {
    302302            add_post_meta( $forum_id, '_bbp_spam_meta_status', bbp_get_public_status_id() );
    303303
  • trunk/src/includes/forums/template.php

    r7347 r7352  
    294294
    295295    // Bail if not correct post type
    296     if ( $forum->post_type !== bbp_get_forum_post_type() ) {
     296    if (  bbp_get_forum_post_type() !== $forum->post_type ) {
    297297        return null;
    298298    }
     
    302302
    303303    // Array A
    304     if ( $output === ARRAY_A ) {
     304    if ( ARRAY_A === $output ) {
    305305        $retval = get_object_vars( $forum );
    306306
    307307    // Array N
    308     } elseif ( $output === ARRAY_N ) {
     308    } elseif ( ARRAY_N === $output ) {
    309309        $retval = array_values( get_object_vars( $forum ) );
    310310    }
     
    16001600
    16011601                // Break when it reach the max count
    1602                 if ( ( $operator === 'OR' ) && ( $count >= 1 ) ) {
     1602                if ( ( 'OR' === $operator ) && ( $count >= 1 ) ) {
    16031603                    break;
    16041604                }
     
    17371737
    17381738                // Break when it reach the max count
    1739                 if ( ( $operator === 'OR' ) && ( $count >= 1 ) ) {
     1739                if ( ( 'OR' === $operator ) && ( $count >= 1 ) ) {
    17401740                    break;
    17411741                }
  • trunk/src/includes/replies/functions.php

    r7350 r7352  
    431431        // If this reply starts as trash, add it to pre_trashed_replies
    432432        // for the topic, so it is properly restored.
    433         if ( bbp_is_topic_trash( $topic_id ) || ( $reply_data['post_status'] === bbp_get_trash_status_id() ) ) {
     433        if ( bbp_is_topic_trash( $topic_id ) || ( bbp_get_trash_status_id() === $reply_data['post_status'] ) ) {
    434434
    435435            // Trash the reply
     
    457457
    458458        // If reply or topic are spam, officially spam this reply
    459         } elseif ( bbp_is_topic_spam( $topic_id ) || ( $reply_data['post_status'] === bbp_get_spam_status_id() ) ) {
     459        } elseif ( bbp_is_topic_spam( $topic_id ) || ( bbp_get_spam_status_id() === $reply_data['post_status'] ) ) {
    460460            add_post_meta( $reply_id, '_bbp_spam_meta_status', bbp_get_public_status_id() );
    461461
     
    603603
    604604    // Forum exists
    605     if ( ! empty( $forum_id ) && ( $forum_id !== bbp_get_reply_forum_id( $reply_id ) ) ) {
     605    if ( ! empty( $forum_id ) && ( bbp_get_reply_forum_id( $reply_id ) !== $forum_id ) ) {
    606606
    607607        // Forum is a category
  • trunk/src/includes/replies/template.php

    r7347 r7352  
    367367
    368368    // Bail if not correct post type
    369     if ( $reply->post_type !== bbp_get_reply_post_type() ) {
     369    if ( bbp_get_reply_post_type() !== $reply->post_type ) {
    370370        return null;
    371371    }
     
    375375
    376376    // Array A
    377     if ( $output === ARRAY_A ) {
     377    if ( ARRAY_A === $output ) {
    378378        $retval = get_object_vars( $reply );
    379379
    380380    // Array N
    381     } elseif ( $output === ARRAY_N ) {
     381    } elseif ( ARRAY_N === $output ) {
    382382        $retval = array_values( get_object_vars( $reply ) );
    383383    }
  • trunk/src/includes/topics/functions.php

    r7350 r7352  
    343343
    344344        // If the topic is closed, close it properly
    345         if ( ( get_post_field( 'post_status', $topic_id ) === bbp_get_closed_status_id() ) || ( $topic_data['post_status'] === bbp_get_closed_status_id() ) ) {
     345        if ( ( get_post_field( 'post_status', $topic_id ) === bbp_get_closed_status_id() ) || bbp_get_closed_status_id() === ( $topic_data['post_status'] ) ) {
    346346
    347347            // Close the topic
     
    353353        // If the forum is trash, or the topic_status is switched to
    354354        // trash, trash the topic properly
    355         if ( ( get_post_field( 'post_status', $forum_id ) === bbp_get_trash_status_id() ) || ( $topic_data['post_status'] === bbp_get_trash_status_id() ) ) {
     355        if ( ( get_post_field( 'post_status', $forum_id ) === bbp_get_trash_status_id() ) || bbp_get_trash_status_id() === ( $topic_data['post_status'] ) ) {
    356356
    357357            // Trash the topic
     
    365365
    366366        // If the topic is spam, officially spam this topic
    367         if ( $topic_data['post_status'] === bbp_get_spam_status_id() ) {
     367        if ( bbp_get_spam_status_id() === $topic_data['post_status'] ) {
    368368            add_post_meta( $topic_id, '_bbp_spam_meta_status', bbp_get_public_status_id() );
    369369
  • trunk/src/includes/topics/template.php

    r7349 r7352  
    523523
    524524    // Bail if not correct post type
    525     if ( $topic->post_type !== bbp_get_topic_post_type() ) {
     525    if ( bbp_get_topic_post_type() !== $topic->post_type ) {
    526526        return null;
    527527    }
     
    531531
    532532    // Array A
    533     if ( $output === ARRAY_A ) {
     533    if ( ARRAY_A === $output ) {
    534534        $retval = get_object_vars( $topic );
    535535
    536536    // Array N
    537     } elseif ( $output === ARRAY_N ) {
     537    } elseif ( ARRAY_N === $output ) {
    538538        $retval = array_values( get_object_vars( $topic ) );
    539539    }
  • trunk/src/includes/users/template.php

    r7214 r7352  
    101101
    102102        // loop has just started
    103         if ( $this->current_user === -1 ) {
     103        if ( -1 === $this->current_user ) {
    104104
    105105            /**
Note: See TracChangeset for help on using the changeset viewer.