Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
994f99e
Update phpcs rules
haqadn Jan 28, 2026
d402d81
CRM: Fix code style formatting throughout codebase
haqadn Jan 28, 2026
0e18678
Make comments consistent
haqadn Jan 28, 2026
8a68e1e
CRM: Update phan baseline after code formatting
haqadn Jan 28, 2026
77b1611
CRM: Fix indentation in comment blocks and array alignment
haqadn Jan 29, 2026
95e9c32
CRM: Fix indentation mismatches in DAL files
haqadn Jan 29, 2026
c338adb
CRM: Fix code style spacing in DAL helper and object files
haqadn Jan 30, 2026
58477f2
Merge remote-tracking branch 'origin/trunk' into fix/crm-code-style-f…
haqadn Jan 30, 2026
862e903
Merge remote-tracking branch 'origin/trunk' into fix/crm-code-style-f…
haqadn Feb 2, 2026
ae60fc6
Restore proper icon class
haqadn Feb 2, 2026
0d52fee
Keep comment formatting looking nice
haqadn Feb 2, 2026
8dd81eb
Restore lowercase wordpress icon class name
haqadn Feb 3, 2026
2af1dc0
Use phpcbf-only excludes for strict comparison rules
haqadn Feb 3, 2026
4cc74ed
Restore strict in_array check for transactiontotal
haqadn Feb 3, 2026
5e0f273
Fix empty parentheses spacing in DAL3.Helpers
haqadn Feb 3, 2026
166bad2
Fix code style: tabs, braces, and alignment across CRM files
haqadn Feb 4, 2026
5b1d88e
Move block comments out of function parameter lists in DAL3.Helpers
haqadn Feb 4, 2026
ea8eedf
Move block comments out of function parameter lists in IntegrationFuncs
haqadn Feb 4, 2026
1f04172
Apply phpcbf auto-fixes and normalize indentation across CRM files
haqadn Feb 4, 2026
5d4a6f8
Merge branch 'trunk' into fix/crm-code-style-formatting
haqadn Feb 4, 2026
2d615f4
Update phan baseline to reflect formatting changes
haqadn Feb 5, 2026
a3a9c8b
Fix remaining auto-fixable PHPCS issues and suppress mixed-context vi…
haqadn Feb 5, 2026
fe61d3b
Use disabled()
haqadn Feb 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions projects/plugins/crm/.phan/baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
*/
return [
// # Issue statistics:
// PhanUndeclaredVariable : 870+ occurrences
// PhanTypeArraySuspiciousNullable : 420+ occurrences
// PhanUndeclaredVariable : 880+ occurrences
// PhanTypeArraySuspiciousNullable : 440+ occurrences
// PhanRedundantCondition : 390+ occurrences
// PhanTypeMismatchReturn : 300+ occurrences
// PhanUnextractableAnnotationElementName : 200+ occurrences
// PhanTypeArraySuspicious : 190+ occurrences
// PhanPossiblyUndeclaredVariable : 150+ occurrences
// PhanTypeMismatchPropertyProbablyReal : 150+ occurrences
// PhanPluginUnreachableCode : 140+ occurrences
// PhanPossiblyUndeclaredVariable : 140+ occurrences
// PhanTypePossiblyInvalidDimOffset : 130+ occurrences
// PhanTypeMismatchReturnProbablyReal : 110+ occurrences
// PhanSuspiciousValueComparison : 100+ occurrences
Expand All @@ -41,8 +41,8 @@
// PhanPluginDuplicateAdjacentStatement : 35+ occurrences
// PhanPluginSimplifyExpressionBool : 35+ occurrences
// PhanSuspiciousWeakTypeComparison : 30+ occurrences
// PhanUnreferencedUseNormal : 30+ occurrences
// PhanParamSignatureMismatch : 25+ occurrences
// PhanUnreferencedUseNormal : 25+ occurrences
// PhanCommentParamWithoutRealParam : 20+ occurrences
// PhanParamSignaturePHPDocMismatchReturnType : 20+ occurrences
// PhanPossiblyUndeclaredGlobalVariable : 20+ occurrences
Expand Down Expand Up @@ -177,7 +177,7 @@
'includes/ZeroBSCRM.DAL3.Obj.LineItems.php' => ['PhanEmptyForeach', 'PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginRedundantAssignment', 'PhanPluginUnreachableCode', 'PhanPossiblyUndeclaredVariable', 'PhanRedundantCondition', 'PhanSuspiciousValueComparison', 'PhanSuspiciousWeakTypeComparison', 'PhanTypeArraySuspiciousNullable', 'PhanTypeComparisonFromArray', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentInternal', 'PhanTypeMismatchArgumentInternalReal', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDefault', 'PhanTypeMismatchForeach', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnNullable', 'PhanTypeMismatchReturnProbablyReal', 'PhanUndeclaredVariable', 'PhanUnextractableAnnotationElementName'],
'includes/ZeroBSCRM.DAL3.Obj.Logs.php' => ['PhanEmptyForeach', 'PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnreachableCode', 'PhanPossiblyUndeclaredVariable', 'PhanRedundantCondition', 'PhanSuspiciousValueComparison', 'PhanTypeArraySuspiciousNull', 'PhanTypeArraySuspiciousNullable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentInternal', 'PhanTypeMismatchArgumentInternalReal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDefault', 'PhanTypeMismatchForeach', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnProbablyReal', 'PhanUndeclaredVariable', 'PhanUndeclaredVariableDim', 'PhanUnextractableAnnotationElementName'],
'includes/ZeroBSCRM.DAL3.Obj.QuoteTemplates.php' => ['PhanCommentParamWithoutRealParam', 'PhanEmptyForeach', 'PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginRedundantAssignment', 'PhanPluginUnreachableCode', 'PhanPossiblyUndeclaredVariable', 'PhanRedundantCondition', 'PhanSuspiciousValueComparison', 'PhanSuspiciousWeakTypeComparison', 'PhanTypeArraySuspiciousNullable', 'PhanTypeComparisonFromArray', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentInternal', 'PhanTypeMismatchArgumentInternalReal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDefault', 'PhanTypeMismatchForeach', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnNullable', 'PhanTypeMismatchReturnProbablyReal', 'PhanUndeclaredVariable', 'PhanUndeclaredVariableDim', 'PhanUnextractableAnnotationElementName'],
'includes/ZeroBSCRM.DAL3.Obj.Quotes.php' => ['PhanCommentParamWithoutRealParam', 'PhanEmptyForeach', 'PhanNoopBinaryOperator', 'PhanPluginDuplicateConditionalNullCoalescing', 'PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginRedundantAssignment', 'PhanPluginUnreachableCode', 'PhanPossiblyUndeclaredVariable', 'PhanRedundantCondition', 'PhanSuspiciousValueComparison', 'PhanSuspiciousWeakTypeComparison', 'PhanTypeArraySuspiciousNull', 'PhanTypeArraySuspiciousNullable', 'PhanTypeComparisonFromArray', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentInternalReal', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDefault', 'PhanTypeMismatchDimFetchNullable', 'PhanTypeMismatchForeach', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnNullable', 'PhanTypeMismatchReturnProbablyReal', 'PhanTypePossiblyInvalidDimOffset', 'PhanUndeclaredVariable', 'PhanUndeclaredVariableDim', 'PhanUnextractableAnnotationElementName'],
'includes/ZeroBSCRM.DAL3.Obj.Quotes.php' => ['PhanCommentParamWithoutRealParam', 'PhanEmptyForeach', 'PhanPluginDuplicateConditionalNullCoalescing', 'PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginRedundantAssignment', 'PhanPluginUnreachableCode', 'PhanPossiblyUndeclaredVariable', 'PhanRedundantCondition', 'PhanSuspiciousValueComparison', 'PhanSuspiciousWeakTypeComparison', 'PhanTypeArraySuspiciousNull', 'PhanTypeArraySuspiciousNullable', 'PhanTypeComparisonFromArray', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentInternalReal', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDefault', 'PhanTypeMismatchDimFetchNullable', 'PhanTypeMismatchForeach', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnNullable', 'PhanTypeMismatchReturnProbablyReal', 'PhanTypePossiblyInvalidDimOffset', 'PhanUndeclaredVariable', 'PhanUndeclaredVariableDim', 'PhanUnextractableAnnotationElementName'],
'includes/ZeroBSCRM.DAL3.Obj.Segments.php' => ['PhanEmptyForeach', 'PhanPluginNeverReturnMethod', 'PhanPluginUnreachableCode', 'PhanRedundantCondition', 'PhanTypeArraySuspiciousNullable', 'PhanTypeMismatchDefault', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnProbablyReal', 'PhanUndeclaredMethod', 'PhanUndeclaredVariable', 'PhanUnextractableAnnotationElementName'],
'includes/ZeroBSCRM.DAL3.Obj.Transactions.php' => ['PhanCommentParamWithoutRealParam', 'PhanEmptyForeach', 'PhanImpossibleTypeComparison', 'PhanNoopBinaryOperator', 'PhanPluginDuplicateConditionalNullCoalescing', 'PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginRedundantAssignment', 'PhanPluginUnreachableCode', 'PhanPossiblyUndeclaredVariable', 'PhanRedundantCondition', 'PhanSuspiciousValueComparison', 'PhanSuspiciousWeakTypeComparison', 'PhanTypeArraySuspicious', 'PhanTypeArraySuspiciousNull', 'PhanTypeArraySuspiciousNullable', 'PhanTypeComparisonFromArray', 'PhanTypeComparisonToArray', 'PhanTypeConversionFromArray', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentInternalReal', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDefault', 'PhanTypeMismatchDimFetchNullable', 'PhanTypeMismatchForeach', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnNullable', 'PhanTypeMismatchReturnProbablyReal', 'PhanTypePossiblyInvalidDimOffset', 'PhanUndeclaredVariable', 'PhanUndeclaredVariableDim', 'PhanUnextractableAnnotationElementName'],
'includes/ZeroBSCRM.DAL3.ObjectLayer.php' => ['PhanCommentParamWithoutRealParam', 'PhanEmptyForeach', 'PhanPluginDuplicateConditionalNullCoalescing', 'PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPossiblyUndeclaredVariable', 'PhanRedundantCondition', 'PhanTypeArraySuspicious', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentInternal', 'PhanTypeMismatchArgumentInternalProbablyReal', 'PhanTypeMismatchDefault', 'PhanTypeMismatchForeach', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnNullable', 'PhanTypeMismatchReturnProbablyReal', 'PhanUndeclaredFunction', 'PhanUnextractableAnnotationElementName'],
Expand All @@ -192,13 +192,13 @@
'includes/ZeroBSCRM.FormatHelpers.php' => ['PhanNoopVariable', 'PhanPluginRedundantAssignment', 'PhanPluginUnreachableCode', 'PhanPossiblyUndeclaredVariable', 'PhanRedundantCondition', 'PhanTypeArraySuspiciousNullable', 'PhanTypeInvalidLeftOperandOfAdd', 'PhanTypeMismatchArgument'],
'includes/ZeroBSCRM.Forms.php' => ['PhanPluginSimplifyExpressionBool', 'PhanTypeNonVarPassByRef'],
'includes/ZeroBSCRM.GeneralFuncs.php' => ['PhanCommentParamWithoutRealParam', 'PhanMisspelledAnnotation', 'PhanPluginNeverReturnFunction', 'PhanPluginSimplifyExpressionBool', 'PhanPluginUnreachableCode', 'PhanRedundantCondition', 'PhanSuspiciousValueComparison', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanTypeMismatchArgumentInternal', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchDimFetch', 'PhanUndeclaredConstant', 'PhanUndeclaredFunction', 'PhanUndeclaredVariableDim'],
'includes/ZeroBSCRM.IntegrationFuncs.php' => ['PhanPluginRedundantAssignment', 'PhanPluginUnreachableCode', 'PhanRedundantCondition'],
'includes/ZeroBSCRM.IntegrationFuncs.php' => ['PhanPluginRedundantAssignment', 'PhanPluginUnreachableCode', 'PhanRedundantCondition', 'PhanTypeMismatchArgument'],
'includes/ZeroBSCRM.InternalAutomatorRecipes.php' => ['PhanPluginRedundantAssignment', 'PhanRedundantCondition', 'PhanSuspiciousValueComparison'],
'includes/ZeroBSCRM.InvoiceBuilder.php' => ['PhanPluginDuplicateAdjacentStatement', 'PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginRedundantAssignment', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchReturn', 'PhanTypePossiblyInvalidDimOffset', 'PhanUndeclaredVariable'],
'includes/ZeroBSCRM.Jetpack.php' => ['PhanPluginDuplicateConditionalNullCoalescing'],
'includes/ZeroBSCRM.List.Columns.php' => ['PhanPluginMixedKeyNoKey'],
'includes/ZeroBSCRM.List.php' => ['PhanPossiblyUndeclaredVariable', 'PhanRedundantCondition', 'PhanTypeArraySuspicious', 'PhanTypeArraySuspiciousNullable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentInternal'],
'includes/ZeroBSCRM.Mail.php' => ['PhanPluginMixedKeyNoKey', 'PhanPluginRedundantAssignment', 'PhanPluginUnreachableCode', 'PhanRedundantCondition', 'PhanSuspiciousValueComparison', 'PhanUndeclaredClassCatch', 'PhanUndeclaredClassInstanceof', 'PhanUndeclaredClassMethod', 'PhanUndeclaredClassProperty', 'PhanUndeclaredClassReference', 'PhanUndeclaredVariable', 'PhanUnreferencedUseNormal'],
'includes/ZeroBSCRM.Mail.php' => ['PhanPluginMixedKeyNoKey', 'PhanPluginRedundantAssignment', 'PhanPluginUnreachableCode', 'PhanRedundantCondition', 'PhanSuspiciousValueComparison', 'PhanUndeclaredClassCatch', 'PhanUndeclaredClassInstanceof', 'PhanUndeclaredClassMethod', 'PhanUndeclaredClassProperty', 'PhanUndeclaredClassReference', 'PhanUndeclaredVariable'],
'includes/ZeroBSCRM.MailTracking.php' => ['PhanTypeArraySuspiciousNullable'],
'includes/ZeroBSCRM.MetaBox.php' => ['PhanTypeConversionFromArray', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullableInternal'],
'includes/ZeroBSCRM.MetaBoxes3.Companies.php' => ['PhanDeprecatedFunction', 'PhanPluginDuplicateAdjacentStatement', 'PhanRedundantCondition', 'PhanTypeMismatchArgument', 'PhanTypePossiblyInvalidDimOffset', 'PhanUndeclaredVariable'],
Expand All @@ -222,7 +222,7 @@
'includes/ZeroBSCRM.Social.php' => ['PhanMisspelledAnnotation', 'PhanTypeArraySuspiciousNullable'],
'includes/ZeroBSCRM.TagManager.php' => ['PhanEmptyForeach', 'PhanRedundantCondition', 'PhanUndeclaredProperty'],
'includes/class-learn-menu.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanRedundantCondition', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchDefault'],
'includes/class-oauth-handler.php' => ['PhanTypeArraySuspicious', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnProbablyReal', 'PhanTypePossiblyInvalidDimOffset', 'PhanUndeclaredClassCatch', 'PhanUndeclaredClassMethod', 'PhanUndeclaredTypeReturnType', 'PhanUndeclaredVariable', 'PhanUnreferencedUseNormal'],
'includes/class-oauth-handler.php' => ['PhanTypeArraySuspicious', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnProbablyReal', 'PhanTypePossiblyInvalidDimOffset', 'PhanUndeclaredClassCatch', 'PhanUndeclaredClassMethod', 'PhanUndeclaredTypeReturnType', 'PhanUndeclaredVariable'],
'includes/class-package-installer.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredClassMethod'],
'includes/jpcrm-dependency-checker.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullable'],
'includes/jpcrm-fonts.php' => ['PhanUndeclaredClassMethod', 'PhanUndeclaredTypeParameter'],
Expand Down Expand Up @@ -255,7 +255,7 @@
'modules/woo-sync/admin/settings/connection_edit.page.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullable'],
'modules/woo-sync/admin/settings/connections.page.php' => ['PhanPluginDuplicateConditionalNullCoalescing', 'PhanPossiblyUndeclaredVariable'],
'modules/woo-sync/admin/woo-sync-hub/main.page.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullable'],
'modules/woo-sync/includes/class-woo-sync-background-sync-job.php' => ['PhanCommentParamWithoutRealParam', 'PhanPluginDuplicateCatchStatementBody', 'PhanPluginDuplicateConditionalNullCoalescing', 'PhanPossiblyUndeclaredVariable', 'PhanRedundantCondition', 'PhanTypeArraySuspiciousNullable', 'PhanTypeComparisonFromArray', 'PhanTypeMagicVoidWithReturn', 'PhanTypeMismatchArgument', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchReturnProbablyReal', 'PhanTypePossiblyInvalidDimOffset', 'PhanUndeclaredFunction', 'PhanUndeclaredMethod', 'PhanUndeclaredVariable', 'PhanUnextractableAnnotationElementName', 'PhanUnreferencedUseNormal'],
'modules/woo-sync/includes/class-woo-sync-background-sync-job.php' => ['PhanCommentParamWithoutRealParam', 'PhanPluginDuplicateCatchStatementBody', 'PhanPluginDuplicateConditionalNullCoalescing', 'PhanPossiblyUndeclaredVariable', 'PhanRedundantCondition', 'PhanTypeArraySuspiciousNullable', 'PhanTypeComparisonFromArray', 'PhanTypeMagicVoidWithReturn', 'PhanTypeMismatchArgument', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchReturnProbablyReal', 'PhanTypePossiblyInvalidDimOffset', 'PhanUndeclaredFunction', 'PhanUndeclaredMethod', 'PhanUndeclaredVariable', 'PhanUnextractableAnnotationElementName'],
'modules/woo-sync/includes/class-woo-sync-background-sync.php' => ['PhanUnextractableAnnotationElementName'],
'modules/woo-sync/includes/class-woo-sync-my-account-integration.php' => ['PhanPluginDuplicateConditionalNullCoalescing', 'PhanRedundantCondition', 'PhanTypeArraySuspicious', 'PhanTypePossiblyInvalidDimOffset'],
'modules/woo-sync/includes/class-woo-sync-woo-admin-integration.php' => ['PhanUndeclaredClassMethod', 'PhanUndeclaredClassProperty', 'PhanUndeclaredTypeParameter'],
Expand Down
22 changes: 21 additions & 1 deletion projects/plugins/crm/.phpcs.dir.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@
<!-- We'll have to update all uses in all of our paid extensions as well, any community maintained plugins, etc. -->
<rule ref="WordPress.NamingConventions.ValidFunctionName">
<exclude name="WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid"/>
<exclude name="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid"/>
</rule>

<!-- Legacy codebase uses camelCase/PascalCase for variables and properties -->
<!-- Renaming would require extensive refactoring across all extensions -->
<rule ref="WordPress.NamingConventions.ValidVariableName">
<exclude name="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase"/>
<exclude name="WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase"/>
</rule>
Comment on lines +7 to +15
Copy link
Copy Markdown
Contributor

@anomiex anomiex Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a lot of existing inline phpcs:ignores for these that are now obsolete.

Also probably a bunch for the various sniffs you auto-fixed.

  • Generic.ControlStructures.InlineControlStructure.NotAllowed
  • Generic.Formatting.DisallowMultipleStatements.SameLine
  • Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed
  • Generic.WhiteSpace.ScopeIndent.Incorrect
  • Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace
  • Squiz.PHP.EmbeddedPhp.ContentAfterEnd
  • Squiz.PHP.EmbeddedPhp.ContentBeforeOpen
  • Squiz.Strings.DoubleQuoteUsage.NotRequired
  • Universal.Operators.StrictComparisons.LooseEqual
  • Universal.Operators.StrictComparisons.LooseNotEqual
  • WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
  • WordPress.Arrays.ArrayIndentation.ItemNotAligned
  • WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
  • WordPress.WP.I18n.UnorderedPlaceholdersText


<!-- Disable auto-fixing strict comparisons as they can change behavior -->
<!-- Changing == to === could break type coercion logic (e.g., '2' == 2 vs '2' === 2) -->
<rule ref="Universal.Operators.StrictComparisons">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To really only disable the auto-fixing, while keeping the rule enabled,

Suggested change
<rule ref="Universal.Operators.StrictComparisons">
<rule ref="Universal.Operators.StrictComparisons" phpcbf-only="true">

<exclude phpcbf-only="true" name="Universal.Operators.StrictComparisons.LooseEqual"/>
<exclude phpcbf-only="true" name="Universal.Operators.StrictComparisons.LooseNotEqual"/>
</rule>

<!-- Don't auto-add strict parameter to in_array() -->
<rule ref="WordPress.PHP.StrictInArray">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

Suggested change
<rule ref="WordPress.PHP.StrictInArray">
<rule ref="WordPress.PHP.StrictInArray" phpcbf-only="true">

<exclude phpcbf-only="true" name="WordPress.PHP.StrictInArray.MissingTrueStrict"/>
</rule>

<rule ref="WordPress.WP.I18n">
Expand All @@ -30,7 +50,7 @@
<rule ref="Squiz.Commenting.InlineComment">
<exclude name="Squiz.Commenting.InlineComment.WrongStyle"/>
</rule>

<!-- Ideally we'd just configure PHPCompatibility with the right PHP version, but it uses <config> rather than <properties>. Sigh. -->
<!-- So instead we have to manually disable certain sniffs. -->
<rule ref="./.phpcs.dir.phpcompatibility.xml" />
Expand Down
1 change: 0 additions & 1 deletion projects/plugins/crm/admin/company/view.page.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
!
* Single company view page
*/
defined( 'ZEROBSCRM_PATH' ) || exit( 0 );
Expand Down
3 changes: 1 addition & 2 deletions projects/plugins/crm/admin/contact/add-file.page.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
!
* Single contact view page
*/
defined( 'ZEROBSCRM_PATH' ) || exit( 0 );
Expand Down Expand Up @@ -106,7 +105,7 @@

if ( isset( $upload['error'] ) && $upload['error'] != 0 ) {
echo "<div class='ui message red' style='margin-right:20px'><i class='icon info'></i> ";
echo sprintf( esc_html__( 'There was an error uploading your file: %s', 'zero-bs-crm' ), esc_html( $upload['error'] ) );
printf( esc_html__( 'There was an error uploading your file: %s', 'zero-bs-crm' ), esc_html( $upload['error'] ) );

Check failure on line 108 in projects/plugins/crm/admin/contact/add-file.page.php

View workflow job for this annotation

GitHub Actions / PHP Code Sniffer (changes to excluded files only)

A function call to esc_html__() with texts containing placeholders was found, but was not accompanied by a "translators:" comment on the line above to clarify the meaning of the placeholders. (WordPress.WP.I18n.MissingTranslatorsComment)
Comment thread
haqadn marked this conversation as resolved.
echo '</div>';
$error_while_adding = true;
} else {
Expand Down
3 changes: 1 addition & 2 deletions projects/plugins/crm/admin/contact/view.page.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
!
* Single contact view page
*/
defined( 'ZEROBSCRM_PATH' ) || exit( 0 );
Expand Down Expand Up @@ -1127,7 +1126,7 @@ function jpcrm_render_contact_view_page( $id = -1 ) {

if ( $wp_user !== null && zeroBSCRM_isWPAdmin() ) {
$url = admin_url( 'user-edit.php?user_id=' . $zbsFile['owner'] );
echo '<br /><br /><a style="font-size: 12px;" href="' . esc_url( $url ) . '" target="_blank"><i class="wordpress simple icon"></i> ' . esc_html__( 'View WordPress Profile', 'zero-bs-crm' ) . '</a>';
echo '<br /><br /><a style="font-size: 12px;" href="' . esc_url( $url ) . '" target="_blank"><i class="wordpress simple icon"></i> ' . esc_html__( 'View WordPress Profile', 'zero-bs-crm' ) . '</a>'; // phpcs:ignore WordPress.WP.CapitalPDangit.MisspelledInText -- "wordpress" is a Semantic UI icon class name, not the brand name.
Comment thread
haqadn marked this conversation as resolved.
}

?>
Expand Down
1 change: 0 additions & 1 deletion projects/plugins/crm/admin/crm-resources/main.page.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
!
* Main Hub Page file: This is the main file which renders the Resources view
* Jetpack CRM - https://jetpackcrm.com
*/
Expand Down
1 change: 0 additions & 1 deletion projects/plugins/crm/admin/email/main.page.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
!
* Main Email page: This is the main file which renders the (single-send) email layout
* Jetpack CRM - https://jetpackcrm.com
*
Expand Down
1 change: 0 additions & 1 deletion projects/plugins/crm/admin/export/main.page.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
!
* Export Page
* Jetpack CRM - https://jetpackcrm.com
*/
Expand Down
1 change: 0 additions & 1 deletion projects/plugins/crm/admin/settings/business-info.page.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
!
* Admin Page: Settings: Business Info Settings
*/

Expand Down
13 changes: 6 additions & 7 deletions projects/plugins/crm/admin/settings/client-portal.page.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
!
* Admin Page: Settings: Client Portal settings
*/

Expand Down Expand Up @@ -79,14 +78,14 @@
$zbsStatusSettingPotential = array();
$zbsStatuses = explode( ',', $zbsStatusStr );

foreach ( $zbsStatuses as $statusStr ) {
foreach ( $zbsStatuses as $statusStr ) {

// permify
$statusKey = strtolower( str_replace( ' ', '_', str_replace( ':', '_', $statusStr ) ) );
// permify
$statusKey = strtolower( str_replace( ' ', '_', str_replace( ':', '_', $statusStr ) ) );

// check post
if ( isset( $_POST[ 'wpzbscrm_portaluser_group_' . $statusKey ] ) ) {
$zbsStatusSettingPotential[] = $statusKey;
// check post
if ( isset( $_POST[ 'wpzbscrm_portaluser_group_' . $statusKey ] ) ) {
$zbsStatusSettingPotential[] = $statusKey;
}
}

Expand Down
1 change: 0 additions & 1 deletion projects/plugins/crm/admin/settings/companies.page.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
!
* Admin Page: Settings: Company settings
*/

Expand Down
1 change: 0 additions & 1 deletion projects/plugins/crm/admin/settings/custom-fields.page.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
!
* Admin Page: Settings: Custom field settings
*/

Expand Down
1 change: 0 additions & 1 deletion projects/plugins/crm/admin/settings/field-options.page.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
!
* Admin Page: Settings: Field options
*/

Expand Down
1 change: 0 additions & 1 deletion projects/plugins/crm/admin/settings/field-sorts.page.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
/*
!
* Admin Page: Settings: Field sorts
*/

Expand Down
Loading
Loading