Magento Coding Standard (PHPCS) report for code4business/freeproduct2 ===================================================================== Package version: 1.4.0 | Magento: 2.4.9 | Tested: 2026-05-27 1 error, 135 warnings in 13 files Plugin/Quote/Model/QuoteManagement.php 10:4 warning Line exceeds 120 characters; contains 127 characters (Generic.Files.LineLength.TooLong) 14:4 warning Tag @package MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 15:4 warning Tag @author MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 34:5 warning Missing short description (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 35:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 39:8 warning Type is not specified (Magento2.Annotation.MethodArguments.NoTypeSpecified) 44:9 warning Expected "foreach (...) {\n"; found "foreach (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 44:60 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 46:13 warning Expected "if (...) {\n"; found "if (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 48:108 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 57:1 warning Expected 1 newline at end of file; 0 found (PSR2.Files.EndFileNewline.NoneFound) Plugin/Quote/ResetProductType.php 10:4 warning Tag @package MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 11:4 warning Tag @author MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 17:5 warning Missing short description (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 18:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 28:9 warning Expected "if (...) {\n"; found "if (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 28:87 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 35:1 warning Expected 1 newline at end of file; 0 found (PSR2.Files.EndFileNewline.NoneFound) Plugin/Model/Quote/Item/AbstractItem.php 15:4 warning Tag @package MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 19:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 27:1 warning Expected 1 newline at end of file; 0 found (PSR2.Files.EndFileNewline.NoneFound) Plugin/KlarnaPayments/Api/Builder.php 10:4 warning Line exceeds 120 characters; contains 121 characters (Generic.Files.LineLength.TooLong) 12:4 warning Tag @package MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 13:4 warning Tag @author MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 32:5 warning Missing short description (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 33:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 33:8 warning Tags visual alignment must be consistent (Magento2.Annotation.MethodAnnotationStructure.MethodArguments) 44:9 warning Expected "if (...) {\n"; found "if (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 45:42 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 47:13 warning Expected "foreach (...) {\n"; found "foreach (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 47:70 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 49:17 warning Expected "if (...) {\n"; found "if (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 51:112 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 61:1 warning Expected 1 newline at end of file; 0 found (PSR2.Files.EndFileNewline.NoneFound) Plugin/SalesRule/Model/MetadataValueProvider.php 11:4 warning Tag @category MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 12:4 warning Tag @package MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 13:4 warning Tag @author MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 39:1 warning Expected 1 newline at end of file; 0 found (PSR2.Files.EndFileNewline.NoneFound) Observer/RemoveGiftItems.php 15:4 warning Tag @category MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 16:4 warning Tag @package MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 17:4 warning Tag @author MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 54:24 warning Line exceeds 120 characters; contains 127 characters (Generic.Files.LineLength.TooLong) Observer/ResetGiftItems.php 22:4 warning Line exceeds 120 characters; contains 134 characters (Generic.Files.LineLength.TooLong) 27:4 warning Tag @package MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 28:4 warning Tag @author MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 44:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 49:5 warning Missing short description (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 50:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 70:9 warning Expected "if (...) {\n"; found "if (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 70:68 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 75:9 warning Expected "if (...) {\n"; found "if (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 75:71 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 80:13 warning Expected "if (...) {\n"; found "if (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 81:113 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 85:11 warning Expected "} else {\n"; found "} else\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 85:11 warning Expected 1 space after ELSE keyword; newline found (Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword) 100:9 warning Expected "if (...) {\n"; found "if (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 100:71 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 117:5 warning Missing short description (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 118:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 127:9 warning Expected "foreach (...) {\n"; found "foreach (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 127:80 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 129:13 warning Expected "if (...) {\n"; found "if (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 129:40 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 132:15 warning Expected "} else if (...) {\n"; found "} else if (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 132:15 warning Usage of ELSE IF is discouraged; use ELSEIF instead (PSR2.ControlStructures.ElseIfDeclaration.NotAllowed) 132:20 warning Expected "if (...) {\n"; found "if (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 132:115 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 138:20 warning Line exceeds 120 characters; contains 123 characters (Generic.Files.LineLength.TooLong) 141:17 warning Expected "foreach (...) {\n"; found "foreach (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 141:61 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 145:15 warning Expected "} else {\n"; found "} else\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 145:15 warning Expected 1 space after ELSE keyword; newline found (Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword) 166:9 warning Expected "if (...) {\n"; found "if (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 166:54 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 170:13 warning Expected "if (...) {\n"; found "if (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 170:55 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 180:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 185:6 warning Additional blank lines found at end of the annotation block (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 198:48 warning There must be exactly one blank line between lines short and long descriptions (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 208:9 warning Expected "if (...) {\n"; found "if (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 208:107 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 232:9 warning Expected "foreach (...) {\n"; found "foreach (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 232:38 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 234:13 warning Expected "if (...) {\n"; found "if (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 234:64 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 242:1 warning Expected 1 newline at end of file; 0 found (PSR2.Files.EndFileNewline.NoneFound) Setup/InstallSchema.php 1:1 error InstallSchema scripts are obsolete. Please use declarative schema approach in module's etc/db_schema.xml file (Magento2.Legacy.InstallUpgrade.ObsoleteInstallSchemaScript) 15:4 warning Tag @category MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 16:4 warning Tag @package MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 17:4 warning Tag @author MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 24:8 warning If the @inheritdoc not inline it shouldn’t have braces (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 26:12 warning {@inheritdoc} does not import parameter annotation (Magento2.Annotation.MethodArguments.InheritDoc) view/frontend/web/template/minicart/item/freeproduct.html 1:1 warning Avoid using closing slash with void tags, this can lead to unexpected behavior - "" (Magento2.Html.HtmlClosingVoidTags.HtmlClosingVoidElements) SalesRule/Action/ForeachGiftAction.php 13:4 warning Tag @package MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 14:4 warning Tag @author MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 20:5 warning Visibility must be declared on all constants if your project supports PHP 7.1 or later (PSR12.Properties.ConstantVisibility.NotFound) 37:1 warning Expected 1 newline at end of file; 0 found (PSR2.Files.EndFileNewline.NoneFound) SalesRule/Action/GiftAction.php 12:4 warning Tag @package MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 13:4 warning Tag @author MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 34:1 warning Expected 1 newline at end of file; 0 found (PSR2.Files.EndFileNewline.NoneFound) SalesRule/Action/AbstractGiftAction.php 28:5 warning Visibility must be declared on all constants if your project supports PHP 7.1 or later (PSR12.Properties.ConstantVisibility.NotFound) 30:5 warning Visibility must be declared on all constants if your project supports PHP 7.1 or later (PSR12.Properties.ConstantVisibility.NotFound) 31:5 warning Visibility must be declared on all constants if your project supports PHP 7.1 or later (PSR12.Properties.ConstantVisibility.NotFound) 32:5 warning Visibility must be declared on all constants if your project supports PHP 7.1 or later (PSR12.Properties.ConstantVisibility.NotFound) 33:5 warning Visibility must be declared on all constants if your project supports PHP 7.1 or later (PSR12.Properties.ConstantVisibility.NotFound) 50:1 warning Code must not contain multiple empty lines in a row; found 2 empty lines. (Magento2.Whitespace.MultipleEmptyLines.MultipleEmptyLines) 58:33 warning The first parameter of a multi-line function declaration must be on the line after the opening bracket (Squiz.Functions.MultiLineFunctionDeclaration.FirstParamSpacing) 59:1 warning Multi-line function declaration not indented correctly; expected 8 spaces but found 32 (Squiz.Functions.MultiLineFunctionDeclaration.Indent) 60:1 warning Multi-line function declaration not indented correctly; expected 8 spaces but found 32 (Squiz.Functions.MultiLineFunctionDeclaration.Indent) 61:1 warning Multi-line function declaration not indented correctly; expected 8 spaces but found 32 (Squiz.Functions.MultiLineFunctionDeclaration.Indent) 61:56 warning The closing parenthesis of a multi-line function declaration must be on a new line (Squiz.Functions.MultiLineFunctionDeclaration.CloseBracketLine) 62:5 warning The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line (Squiz.Functions.MultiLineFunctionDeclaration.NewlineBeforeOpenBrace) 81:9 warning Expected "if (...) {\n"; found "if (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 81:61 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 89:9 warning Expected "foreach (...) {\n"; found "foreach (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 89:31 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 91:13 warning Expected 1 space after TRY keyword; newline found (Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword) 99:17 warning Expected "if (...) {\n"; found "if (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 99:42 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 101:21 warning Direct throw of generic Exception is discouraged. Use context specific instead. (Magento2.Exceptions.DirectThrow.FoundDirectThrow) 105:15 warning Exceptions must not be handled in the same function where they are thrown. (Magento2.Exceptions.ThrowCatch.ThrowCatch) 105:35 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 108:167 warning Line exceeds 120 characters; contains 167 characters (Generic.Files.LineLength.TooLong) 114:9 warning Expected "if (...) {\n"; found "if (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 114:25 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 136:15 warning The abstract declaration must precede the visibility declaration (PSR2.Methods.MethodDeclaration.AbstractAfterVisibility) 156:5 warning Missing short description (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 157:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 177:15 warning The abstract declaration must precede the visibility declaration (PSR2.Methods.MethodDeclaration.AbstractAfterVisibility) 189:9 warning Expected "if (...) {\n"; found "if (...)\n {\n" (PEAR.ControlStructures.ControlSignature.Found) 189:35 warning Expected 1 space after closing parenthesis; found newline (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis) 235:1 warning Expected 1 newline at end of file; 0 found (PSR2.Files.EndFileNewline.NoneFound) SalesRule/Validator/GiftItemExcluder.php 10:4 warning Tag @category MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 11:4 warning Tag @package MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags) 12:4 warning Tag @author MUST NOT be used. (Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags)