You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix linter errors for ./includes/fbutils.php files (#3075)
Summary:
## Description
This PR fixes `phpcs` issues in `./includes/fbutils.php`. Comments were also added for several functions. The fixes were made manually (in conjunction with `./vendor/bin/phpcbf`) to ensure that the logic remains the same. Running `./vendor/bin/phpcs`:
```
FILE: /Users/angeloou/Local Sites/test-site-i/app/public/wp-content/plugins/facebook-for-woocommerce/includes/fbutils.php
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 131 ERRORS AND 25 WARNINGS AFFECTING 95 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
37 | ERROR | [ ] Missing member variable doc comment (Squiz.Commenting.VariableComment.Missing)
38 | ERROR | [ ] Missing member variable doc comment (Squiz.Commenting.VariableComment.Missing)
40 | ERROR | [ ] Member variable "$validGenderArray" is not in valid snake_case format, try "$valid_gender_array" (WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase)
40 | ERROR | [ ] Missing member variable doc comment (Squiz.Commenting.VariableComment.Missing)
145 | ERROR | [ ] access tags are prohibited (WooCommerce.Commenting.CommentTags.AccessTag)
163 | ERROR | [ ] access tags are prohibited (WooCommerce.Commenting.CommentTags.AccessTag)
184 | ERROR | [ ] access tags are prohibited (WooCommerce.Commenting.CommentTags.AccessTag)
210 | ERROR | [ ] Doc comment for parameter "$wpid" missing (Squiz.Commenting.FunctionComment.MissingParamTag)
213 | ERROR | [ ] access tags are prohibited (WooCommerce.Commenting.CommentTags.AccessTag)
214 | ERROR | [ ] Doc comment for parameter $id does not match actual variable name $wpid (Squiz.Commenting.FunctionComment.ParamNameNoMatch)
225 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found (Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterFunction)
232 | WARNING | [x] Equals sign not aligned with surrounding assignments; expected 13 spaces but found 1 space (Generic.Formatting.MultipleStatementAlignment.NotSameWarning)
242 | ERROR | [ ] access tags are prohibited (WooCommerce.Commenting.CommentTags.AccessTag)
250 | ERROR | [ ] Doc comment for parameter "$string" missing (Squiz.Commenting.FunctionComment.MissingParamTag)
250 | ERROR | [ ] Doc comment for parameter "$strip_html_tags" missing (Squiz.Commenting.FunctionComment.MissingParamTag)
257 | ERROR | [ ] access tags are prohibited (WooCommerce.Commenting.CommentTags.AccessTag)
258 | ERROR | [ ] Missing parameter name (Squiz.Commenting.FunctionComment.MissingParamName)
261 | WARNING | [ ] It is recommended not to use reserved keyword "string" as function parameter name. Found: $string
| | (Universal.NamingConventions.NoReservedKeywordParameterNames.stringFound)
272 | WARNING | [x] Found precision alignment of 1 spaces. (Universal.WhiteSpace.PrecisionAlignment.Found)
272 | ERROR | [x] Line indented incorrectly; expected 3 tabs, found 3 tabs and 1 spaces (Generic.WhiteSpace.ScopeIndent.IncorrectExact)
272 | ERROR | [x] No space after opening parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterOpenParenthesis)
272 | ERROR | [x] Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket)
272 | ERROR | [x] Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket)
272 | ERROR | [x] No space before closing parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeCloseParenthesis)
272 | ERROR | [x] Expected 1 space after closing parenthesis; found 0 (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis)
272 | ERROR | [x] Space between opening control structure and closing parenthesis is required (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterCloseParenthesis)
274 | WARNING | [x] Found precision alignment of 1 spaces. (Universal.WhiteSpace.PrecisionAlignment.Found)
274 | ERROR | [x] Line indented incorrectly; expected 3 tabs, found 3 tabs and 1 spaces (Generic.WhiteSpace.ScopeIndent.IncorrectExact)
286 | ERROR | [x] No space after opening parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterOpenParenthesis)
286 | ERROR | [x] No space before closing parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeCloseParenthesis)
286 | ERROR | [x] Expected 1 space after closing parenthesis; found 0 (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis)
286 | ERROR | [x] Space between opening control structure and closing parenthesis is required (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterCloseParenthesis)
296 | ERROR | [ ] access tags are prohibited (WooCommerce.Commenting.CommentTags.AccessTag)
315 | ERROR | [ ] access tags are prohibited (WooCommerce.Commenting.CommentTags.AccessTag)
318 | ERROR | [ ] Method name "isWoocommerceIntegration" in class WC_Facebookcommerce_Utils is not in snake case format, try "is_woocommerce_integration"
| | (WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid)
325 | ERROR | [ ] access tags are prohibited (WooCommerce.Commenting.CommentTags.AccessTag)
328 | ERROR | [ ] Method name "getIntegrationName" in class WC_Facebookcommerce_Utils is not in snake case format, try "get_integration_name"
| | (WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid)
339 | ERROR | [ ] access tags are prohibited (WooCommerce.Commenting.CommentTags.AccessTag)
345 | WARNING | [x] Loose comparisons are not allowed. Expected: "==="; Found: "==" (Universal.Operators.StrictComparisons.LooseEqual)
345 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
365 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
365 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
366 | WARNING | [ ] Not using strict comparison for in_array; supply true for $strict argument. (WordPress.PHP.StrictInArray.MissingTrueStrict)
383 | ERROR | [ ] Doc comment for parameter "$message" missing (Squiz.Commenting.FunctionComment.MissingParamTag)
383 | ERROR | [ ] Doc comment for parameter "$object" missing (Squiz.Commenting.FunctionComment.MissingParamTag)
383 | ERROR | [ ] Doc comment for parameter "$error" missing (Squiz.Commenting.FunctionComment.MissingParamTag)
383 | ERROR | [ ] Doc comment for parameter "$ems" missing (Squiz.Commenting.FunctionComment.MissingParamTag)
387 | ERROR | [x] Multi-line function declaration not indented correctly; expected 12 spaces but found 8 (Squiz.Functions.MultiLineFunctionDeclaration.Indent)
388 | ERROR | [x] Multi-line function declaration not indented correctly; expected 12 spaces but found 8 (Squiz.Functions.MultiLineFunctionDeclaration.Indent)
388 | WARNING | [ ] It is recommended not to use reserved keyword "object" as function parameter name. Found: $object
| | (Universal.NamingConventions.NoReservedKeywordParameterNames.objectFound)
389 | ERROR | [x] Multi-line function declaration not indented correctly; expected 12 spaces but found 8 (Squiz.Functions.MultiLineFunctionDeclaration.Indent)
390 | ERROR | [x] Multi-line function declaration not indented correctly; expected 12 spaces but found 8 (Squiz.Functions.MultiLineFunctionDeclaration.Indent)
390 | ERROR | [x] The closing parenthesis of a multi-line function declaration must be on a new line (Squiz.Functions.MultiLineFunctionDeclaration.CloseBracketLine)
395 | WARNING | [ ] json_encode() is discouraged. Use wp_json_encode() instead. (WordPress.WP.AlternativeFunctions.json_encode_json_encode)
401 | ERROR | [ ] Using short ternaries is not allowed as they are rarely used correctly (Universal.Operators.DisallowShortTernary.Found)
404 | ERROR | [x] Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket)
404 | ERROR | [x] Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket)
410 | WARNING | [ ] error_log() found. Debug code should not normally be used in production. (WordPress.PHP.DevelopmentFunctions.error_log_error_log)
417 | ERROR | [ ] Doc comment for parameter "$tip_id" missing (Squiz.Commenting.FunctionComment.MissingParamTag)
417 | ERROR | [ ] Doc comment for parameter "$channel_id" missing (Squiz.Commenting.FunctionComment.MissingParamTag)
417 | ERROR | [ ] Doc comment for parameter "$event" missing (Squiz.Commenting.FunctionComment.MissingParamTag)
417 | ERROR | [ ] Doc comment for parameter "$ems" missing (Squiz.Commenting.FunctionComment.MissingParamTag)
421 | ERROR | [ ] Using short ternaries is not allowed as they are rarely used correctly (Universal.Operators.DisallowShortTernary.Found)
424 | ERROR | [x] Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket)
424 | ERROR | [x] Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket)
430 | WARNING | [ ] error_log() found. Debug code should not normally be used in production. (WordPress.PHP.DevelopmentFunctions.error_log_error_log)
435 | WARNING | [x] Loose comparisons are not allowed. Expected: "==="; Found: "==" (Universal.Operators.StrictComparisons.LooseEqual)
435 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
435 | WARNING | [x] Loose comparisons are not allowed. Expected: "==="; Found: "==" (Universal.Operators.StrictComparisons.LooseEqual)
435 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
439 | WARNING | [x] Loose comparisons are not allowed. Expected: "==="; Found: "==" (Universal.Operators.StrictComparisons.LooseEqual)
439 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
439 | WARNING | [x] Loose comparisons are not allowed. Expected: "==="; Found: "==" (Universal.Operators.StrictComparisons.LooseEqual)
439 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
442 | WARNING | [ ] It is recommended not to use reserved keyword "die" as function parameter name. Found: $die (Universal.NamingConventions.NoReservedKeywordParameterNames.dieFound)
458 | ERROR | [ ] access tags are prohibited (WooCommerce.Commenting.CommentTags.AccessTag)
466 | ERROR | [ ] Doc comment for parameter "$product_group_id" missing (Squiz.Commenting.FunctionComment.MissingParamTag)
466 | ERROR | [ ] Doc comment for parameter "$compare_condition" missing (Squiz.Commenting.FunctionComment.MissingParamTag)
466 | ERROR | [ ] Doc comment for parameter "$post_type" missing (Squiz.Commenting.FunctionComment.MissingParamTag)
470 | ERROR | [x] Multi-line function declaration not indented correctly; expected 12 spaces but found 8 (Squiz.Functions.MultiLineFunctionDeclaration.Indent)
471 | ERROR | [x] Multi-line function declaration not indented correctly; expected 12 spaces but found 8 (Squiz.Functions.MultiLineFunctionDeclaration.Indent)
472 | ERROR | [x] Multi-line function declaration not indented correctly; expected 12 spaces but found 8 (Squiz.Functions.MultiLineFunctionDeclaration.Indent)
472 | ERROR | [x] The closing parenthesis of a multi-line function declaration must be on a new line (Squiz.Functions.MultiLineFunctionDeclaration.CloseBracketLine)
475 | WARNING | [ ] Detected usage of meta_query, possible slow query. (WordPress.DB.SlowDBQuery.slow_db_query_meta_query)
491 | ERROR | [ ] You must use "/**" style comments for a function comment (Squiz.Commenting.FunctionComment.WrongStyle)
514 | WARNING | [ ] parse_url() is discouraged because of inconsistency in the output across PHP versions; use wp_parse_url() instead.
| | (WordPress.WP.AlternativeFunctions.parse_url_parse_url)
585 | WARNING | [ ] Not using strict comparison for in_array; supply true for $strict argument. (WordPress.PHP.StrictInArray.MissingTrueStrict)
598 | ERROR | [ ] You must use "/**" style comments for a function comment (Squiz.Commenting.FunctionComment.WrongStyle)
602 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
625 | ERROR | [ ] You must use "/**" style comments for a function comment (Squiz.Commenting.FunctionComment.WrongStyle)
626 | ERROR | [x] Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket)
626 | ERROR | [x] Expected 1 space after the array opener in a single line array. Found: no spaces (NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceAfterArrayOpenerSingleLine)
626 | ERROR | [x] Expected 1 space before the array closer in a single line array. Found: no spaces (NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceBeforeArrayCloserSingleLine)
626 | ERROR | [x] Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket)
629 | ERROR | [ ] Method name "validateGender" in class WC_Facebookcommerce_Utils is not in snake case format, try "validate_gender"
| | (WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid)
630 | ERROR | [ ] Object property "$validGenderArray" is not in valid snake_case format, try "$valid_gender_array" (WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase)
633 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
633 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
637 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
637 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
637 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
640 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
645 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
645 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
648 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
648 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
648 | WARNING | [x] Loose comparisons are not allowed. Expected: "==="; Found: "==" (Universal.Operators.StrictComparisons.LooseEqual)
648 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
662 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
662 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
671 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
695 | ERROR | [ ] Doc comment for parameter "$from" missing (Squiz.Commenting.FunctionComment.MissingParamTag)
695 | ERROR | [ ] Doc comment for parameter "$date_cap" missing (Squiz.Commenting.FunctionComment.MissingParamTag)
699 | WARNING | [x] Loose comparisons are not allowed. Expected: "==="; Found: "==" (Universal.Operators.StrictComparisons.LooseEqual)
699 | ERROR | [ ] Use Yoda Condition checks, you must. (WordPress.PHP.YodaConditions.NotYoda)
804 | ERROR | [x] Expected a new line after the array opener in a multi line array. Found: 1 space (NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceAfterArrayOpenerMultiLine)
804 | ERROR | [x] Each item in a multi-line array must be on a new line. Found: 1 space (WordPress.Arrays.ArrayDeclarationSpacing.ArrayItemNoNewLine)
807 | ERROR | [x] There should be a comma after the last array item in a multi-line array. (NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLineCloserSameLine)
807 | ERROR | [ ] Array closer not aligned correctly; expected 12 space(s) but found 14 (WordPress.Arrays.ArrayIndentation.CloseBraceNotAligned)
807 | ERROR | [x] Expected a new line before the array closer in a multi line array. Found: 1 space (NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceBeforeArrayCloserMultiLine)
835 | ERROR | [x] Must use "self::" for local static member reference (Squiz.Classes.SelfMemberReference.NotUsed)
842 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment (Generic.Commenting.DocComment.SpacingBeforeTags)
845 | ERROR | [x] Expected 5 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
847 | ERROR | [ ] Method name "logExceptionImmediatelyToMeta" in class WC_Facebookcommerce_Utils is not in snake case format, try "log_exception_immediately_to_meta"
| | (WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid)
847 | ERROR | [x] Expected 1 spaces after opening parenthesis; 0 found (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterOpen)
847 | ERROR | [x] Expected 1 spaces before closing parenthesis; 0 found (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose)
848 | ERROR | [x] Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket)
848 | ERROR | [x] Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket)
853 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment (Generic.Commenting.DocComment.SpacingBeforeTags)
856 | ERROR | [x] Expected 2 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
858 | ERROR | [ ] Method name "logToMeta" in class WC_Facebookcommerce_Utils is not in snake case format, try "log_to_meta"
| | (WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid)
858 | ERROR | [x] Expected 1 spaces after opening parenthesis; 0 found (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterOpen)
858 | ERROR | [x] Expected 1 spaces before closing parenthesis; 0 found (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose)
859 | WARNING | [x] Equals sign not aligned with surrounding assignments; expected 12 spaces but found 1 space (Generic.Formatting.MultipleStatementAlignment.NotSameWarning)
864 | WARNING | [x] Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space (Generic.Formatting.MultipleStatementAlignment.NotSameWarning)
889 | WARNING | [x] Found precision alignment of 1 spaces. (Universal.WhiteSpace.PrecisionAlignment.Found)
890 | ERROR | [x] Expected 10 spaces before asterisk; 9 found (Squiz.Commenting.DocCommentAlignment.SpaceBeforeStar)
891 | ERROR | [x] Expected 10 spaces before asterisk; 9 found (Squiz.Commenting.DocCommentAlignment.SpaceBeforeStar)
892 | ERROR | [x] Expected 10 spaces before asterisk; 9 found (Squiz.Commenting.DocCommentAlignment.SpaceBeforeStar)
892 | ERROR | [x] Expected 2 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
893 | ERROR | [x] Expected 10 spaces before asterisk; 9 found (Squiz.Commenting.DocCommentAlignment.SpaceBeforeStar)
894 | ERROR | [x] Expected 10 spaces before asterisk; 9 found (Squiz.Commenting.DocCommentAlignment.SpaceBeforeStar)
894 | ERROR | [x] Expected 2 spaces after parameter type; 1 found (Squiz.Commenting.FunctionComment.SpacingAfterParamType)
895 | ERROR | [x] Expected 10 spaces before asterisk; 9 found (Squiz.Commenting.DocCommentAlignment.SpaceBeforeStar)
896 | ERROR | [x] Expected 10 spaces before asterisk; 9 found (Squiz.Commenting.DocCommentAlignment.SpaceBeforeStar)
897 | ERROR | [ ] Method name "getContextData" in class WC_Facebookcommerce_Utils is not in snake case format, try "get_context_data"
| | (WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid)
897 | ERROR | [x] Expected 1 spaces after opening parenthesis; 0 found (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterOpen)
897 | WARNING | [ ] It is recommended not to use reserved keyword "default" as function parameter name. Found: $default
| | (Universal.NamingConventions.NoReservedKeywordParameterNames.defaultFound)
897 | ERROR | [x] Expected 1 spaces before closing parenthesis; 0 found (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose)
898 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)
899 | ERROR | [x] Array keys must be surrounded by spaces unless they contain a string or an integer. (WordPress.Arrays.ArrayKeySpacingRestrictions.NoSpacesAroundArrayKeys)
902 | ERROR | [ ] Doc comment for parameter "$message" missing (Squiz.Commenting.FunctionComment.MissingParamTag)
902 | ERROR | [ ] Doc comment for parameter "$level" missing (Squiz.Commenting.FunctionComment.MissingParamTag)
906 | ERROR | [ ] Method name "logWithDebugModeEnabled" in class WC_Facebookcommerce_Utils is not in snake case format, try "log_with_debug_mode_enabled"
| | (WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid)
914 | WARNING | [ ] json_encode() is discouraged. Use wp_json_encode() instead. (WordPress.WP.AlternativeFunctions.json_encode_json_encode)
922 | ERROR | [x] The closing brace for the class must go on the next line after the body (PSR2.Classes.ClassDeclaration.CloseBraceAfterBody)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 72 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
```
### Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Syntax change (non-breaking change which fixes code modularity, linting or phpcs issues)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected
Pull Request resolved: #3075
Test Plan:
1. Run `./vendor/bin/phpcs`, you should get:
```
FILE: /Users/angeloou/Local Sites/test-site-i/app/public/wp-content/plugins/facebook-for-woocommerce/includes/fbutils.php
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 8 WARNINGS AFFECTING 8 LINES
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
360 | WARNING | Not using strict comparison for in_array; supply true for $strict argument. (WordPress.PHP.StrictInArray.MissingTrueStrict)
397 | WARNING | json_encode() is discouraged. Use wp_json_encode() instead. (WordPress.WP.AlternativeFunctions.json_encode_json_encode)
414 | WARNING | error_log() found. Debug code should not normally be used in production. (WordPress.PHP.DevelopmentFunctions.error_log_error_log)
440 | WARNING | error_log() found. Debug code should not normally be used in production. (WordPress.PHP.DevelopmentFunctions.error_log_error_log)
507 | WARNING | Detected usage of meta_query, possible slow query. (WordPress.DB.SlowDBQuery.slow_db_query_meta_query)
553 | WARNING | parse_url() is discouraged because of inconsistency in the output across PHP versions; use wp_parse_url() instead. (WordPress.WP.AlternativeFunctions.parse_url_parse_url)
624 | WARNING | Not using strict comparison for in_array; supply true for $strict argument. (WordPress.PHP.StrictInArray.MissingTrueStrict)
1018 | WARNING | json_encode() is discouraged. Use wp_json_encode() instead. (WordPress.WP.AlternativeFunctions.json_encode_json_encode)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
```
2. Run extension and test the basic functionality to ensure everything still works as intended.
**!---- (auto-generated) DO NOT EDIT OR PUT ANYTHING AFTER THIS LINE ----!**
MFTRunTestsScript Run / Test Suite: sa_checkout / Test Collection: bloks / Diff Version V2
https://internalfb.com/intern/testinfra/testrun/16044073752117332
MFTRunTestsScript Run / Test Suite: sa_checkout / Test Collection: www / Diff Version V2
https://internalfb.com/intern/testinfra/testrun/16607023705525620
Reviewed By: carterbuce
Differential Revision: D73451039
Pulled By: ajello-meta
fbshipit-source-id: 1cbd23ad296b7c482e580f5def7d24e1806e70b0
0 commit comments