Magento Coding Standard (PHPCS) report for prakash282/orderattachment ===================================================================== Package version: 1.2.0 | Magento: 2.4.9 | Tested: 2026-05-27 6 errors, 270 warnings in 35 files Helper/Upload.php 40:5 warning Missing short description (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 41:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) Helper/Data.php 6:1 warning There must be one blank line after the last USE statement; 2 found; (PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse) 25:12 warning @param is not found for one or more params in method annotation (Magento2.Annotation.MethodArguments.ParamMissing) 37:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 37:23 warning Short description should not be in multi lines (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 45:1 warning Code must not contain multiple empty lines in a row; found 2 empty lines. (Magento2.Whitespace.MultipleEmptyLines.MultipleEmptyLines) 52:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 52:23 warning Short description should not be in multi lines (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 64:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 71:1 warning Multi-line function call not indented correctly; expected 12 spaces but found 16 (PSR2.Methods.FunctionCallSignature.Indent) 72:1 warning Multi-line function call not indented correctly; expected 12 spaces but found 16 (PSR2.Methods.FunctionCallSignature.Indent) 73:1 warning Multi-line function call not indented correctly; expected 8 spaces but found 12 (PSR2.Methods.FunctionCallSignature.Indent) 74:1 warning Code must not contain multiple empty lines in a row; found 2 empty lines. (Magento2.Whitespace.MultipleEmptyLines.MultipleEmptyLines) 96:62 warning Space after opening parenthesis of function call prohibited (PSR2.Methods.FunctionCallSignature.SpaceAfterOpenBracket) 96:159 warning Expected 0 spaces before closing parenthesis; 1 found (PSR2.Methods.FunctionCallSignature.SpaceBeforeCloseBracket) 96:160 warning Line exceeds 120 characters; contains 160 characters (Generic.Files.LineLength.TooLong) Helper/Attachment.php 70:12 warning @param is not found for one or more params in method annotation (Magento2.Annotation.MethodArguments.ParamMissing) 98:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 139:1 warning Code must not contain multiple empty lines in a row; found 2 empty lines. (Magento2.Whitespace.MultipleEmptyLines.MultipleEmptyLines) 167:1 warning Multi-line function call not indented correctly; expected 12 spaces but found 20 (PSR2.Methods.FunctionCallSignature.Indent) 167:68 warning Closing parenthesis of a multi-line function call must be on a line by itself (PSR2.Methods.FunctionCallSignature.CloseBracketLine) 174:31 warning The use of function basename() is discouraged (Magento2.Functions.DiscouragedFunction.Discouraged) 197:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 231:17 warning The use of function file_exists() is discouraged (Magento2.Functions.DiscouragedFunction.Discouraged) 232:17 warning The use of function unlink() is discouraged (Magento2.Functions.DiscouragedFunction.Discouraged) 259:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 314:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 357:23 warning The use of function fopen() is discouraged; use Magento\Framework\Filesystem\DriverInterface::fileOpen() instead (Magento2.Functions.DiscouragedFunction.DiscouragedWithAlternative) 363:52 warning The use of function basename() is discouraged (Magento2.Functions.DiscouragedFunction.Discouraged) 369:36 warning The use of function fread() is discouraged (Magento2.Functions.DiscouragedFunction.Discouraged) 369:51 warning The use of function filesize() is discouraged (Magento2.Functions.DiscouragedFunction.Discouraged) 370:13 warning The use of function fclose() is discouraged; use Magento\Framework\Filesystem\DriverInterface::fileClose() instead (Magento2.Functions.DiscouragedFunction.DiscouragedWithAlternative) 382:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 392:1 warning Multi-line function call not indented correctly; expected 12 spaces but found 20 (PSR2.Methods.FunctionCallSignature.Indent) 392:68 warning Closing parenthesis of a multi-line function call must be on a line by itself (PSR2.Methods.FunctionCallSignature.CloseBracketLine) Model/AttachmentRepository.php 79:16 warning Creation of dynamic property Sp\Orderattachment\Model\AttachmentRepository::$blockFactory is deprecated since PHP 8.2 (PHPCompatibility.Classes.RemovedDynamicProperties.Deprecated) 80:16 warning Creation of dynamic property Sp\Orderattachment\Model\AttachmentRepository::$blockCollectionFactory is deprecated since PHP 8.2 (PHPCompatibility.Classes.RemovedDynamicProperties.Deprecated) 83:16 warning Creation of dynamic property Sp\Orderattachment\Model\AttachmentRepository::$dataBlockFactory is deprecated since PHP 8.2 (PHPCompatibility.Classes.RemovedDynamicProperties.Deprecated) 88:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 100:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 110:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 145:17 warning Use ::class notation instead. (Magento2.PHP.LiteralNamespaces.LiteralClassUsage) 149:17 warning Use ::class notation instead. (Magento2.PHP.LiteralNamespaces.LiteralClassUsage) 156:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 166:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) Model/AttachmentConfigProvider.php 50:12 warning @param is not found for one or more params in method annotation (Magento2.Annotation.MethodArguments.ParamMissing) 66:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 85:62 warning Space after opening parenthesis of function call prohibited (PSR2.Methods.FunctionCallSignature.SpaceAfterOpenBracket) 85:159 warning Expected 0 spaces before closing parenthesis; 1 found (PSR2.Methods.FunctionCallSignature.SpaceBeforeCloseBracket) 85:160 warning Line exceeds 120 characters; contains 160 characters (Generic.Files.LineLength.TooLong) 90:13 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 100:1 warning Multi-line function call not indented correctly; expected 16 spaces but found 20 (PSR2.Methods.FunctionCallSignature.Indent) 100:68 warning Closing parenthesis of a multi-line function call must be on a line by itself (PSR2.Methods.FunctionCallSignature.CloseBracketLine) 110:38 warning The use of function basename() is discouraged (Magento2.Functions.DiscouragedFunction.Discouraged) 122:20 warning Short array syntax must be used to define arrays (Generic.Arrays.DisallowLongArraySyntax.Found) 128:13 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 138:13 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 146:13 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 154:13 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 162:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 167:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 172:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) Model/ResourceModel/Attachment/Grid/Collection.php 16:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 25:18 warning Use ::class notation instead. (Magento2.PHP.LiteralNamespaces.LiteralClassUsage) 43:5 warning Missing short description (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 44:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 51:5 warning Missing short description (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 52:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 59:1 warning Code must not contain multiple empty lines in a row; found 2 empty lines. (Magento2.Whitespace.MultipleEmptyLines.MultipleEmptyLines) 63:50 warning There must be exactly one blank line between lines short and long descriptions (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) Model/ResourceModel/Attachment/Collection.php 9:15 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 11:22 warning Use ::class notation instead. (Magento2.PHP.LiteralNamespaces.LiteralClassUsage) 11:61 warning Use ::class notation instead. (Magento2.PHP.LiteralNamespaces.LiteralClassUsage) Model/ResourceModel/Attachment.php 19:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 28:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) Model/Attachment.php 13:5 warning Visibility must be declared on all constants if your project supports PHP 7.1 or later (PSR12.Properties.ConstantVisibility.NotFound) 18:5 warning Visibility must be declared on all constants if your project supports PHP 7.1 or later (PSR12.Properties.ConstantVisibility.NotFound) 23:5 warning Visibility must be declared on all constants if your project supports PHP 7.1 or later (PSR12.Properties.ConstantVisibility.NotFound) 27: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) 36:5 warning Visibility must be declared on all constants if your project supports PHP 7.1 or later (PSR12.Properties.ConstantVisibility.NotFound) 40:5 warning Visibility must be declared on all constants if your project supports PHP 7.1 or later (PSR12.Properties.ConstantVisibility.NotFound) 44:5 warning Visibility must be declared on all constants if your project supports PHP 7.1 or later (PSR12.Properties.ConstantVisibility.NotFound) 48:5 warning Constants must have short description if they add information beyond what the constant name supplies. (Magento2.Commenting.ConstantsPHPDocFormatting.MissingConstantPHPDoc) 48:5 warning Visibility must be declared on all constants if your project supports PHP 7.1 or later (PSR12.Properties.ConstantVisibility.NotFound) 69:22 warning Use ::class notation instead. (Magento2.PHP.LiteralNamespaces.LiteralClassUsage) 72:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 77:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 95:8 warning Long description must start with a capital letter (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 105:8 warning Long description must start with a capital letter (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 115:8 warning Long description must start with a capital letter (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 125:8 warning Long description must start with a capital letter (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 135:8 warning Long description must start with a capital letter (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 145:8 warning Long description must start with a capital letter (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 155:8 warning Long description must start with a capital letter (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 165:8 warning Long description must start with a capital letter (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 175:8 warning Long description must start with a capital letter (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 182:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 187:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 192:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 197:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 202:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 207:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 212:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 217:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 222:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) Observer/AttachmentOrderAfterPlaceObserver.php 9:15 warning Missing PHP DocBlock for class property. (Magento2.Commenting.ClassPropertyPHPDocFormatting.Missing) 11:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 16:16 warning Creation of dynamic property Sp\Orderattachment\Observer\AttachmentOrderAfterPlaceObserver::$logger is deprecated since PHP 8.2 (PHPCompatibility.Classes.RemovedDynamicProperties.Deprecated) 19:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) 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) 28:1 warning Multi-line function call not indented correctly; expected 13 spaces but found 17 (PSR2.Methods.FunctionCallSignature.Indent) 29:1 warning Multi-line function call not indented correctly; expected 9 spaces but found 13 (PSR2.Methods.FunctionCallSignature.Indent) 45:73 warning TRUE, FALSE and NULL must be lowercase; expected "null" but found "NULL" (Generic.PHP.LowerCaseConstant.Found) 48:1 warning Multi-line function call not indented correctly; expected 17 spaces but found 16 (PSR2.Methods.FunctionCallSignature.Indent) 49:1 warning Multi-line function call not indented correctly; expected 17 spaces but found 16 (PSR2.Methods.FunctionCallSignature.Indent) 50:1 warning Multi-line function call not indented correctly; expected 17 spaces but found 16 (PSR2.Methods.FunctionCallSignature.Indent) 51:1 warning Multi-line function call not indented correctly; expected 17 spaces but found 16 (PSR2.Methods.FunctionCallSignature.Indent) 52:1 warning Multi-line function call not indented correctly; expected 17 spaces but found 16 (PSR2.Methods.FunctionCallSignature.Indent) 54:1 warning Multi-line function call not indented correctly; expected 17 spaces but found 16 (PSR2.Methods.FunctionCallSignature.Indent) 55:1 warning Multi-line function call not indented correctly; expected 17 spaces but found 16 (PSR2.Methods.FunctionCallSignature.Indent) 56:1 warning Multi-line function call not indented correctly; expected 17 spaces but found 16 (PSR2.Methods.FunctionCallSignature.Indent) 57:1 warning Multi-line function call not indented correctly; expected 17 spaces but found 16 (PSR2.Methods.FunctionCallSignature.Indent) 58:1 warning Multi-line function call not indented correctly; expected 17 spaces but found 16 (PSR2.Methods.FunctionCallSignature.Indent) 59:1 warning Multi-line function call not indented correctly; expected 13 spaces but found 12 (PSR2.Methods.FunctionCallSignature.Indent) 83:1 warning Multi-line function call not indented correctly; expected 12 spaces but found 13 (PSR2.Methods.FunctionCallSignature.Indent) etc/module.xml 5:1 warning Spaces must be used to indent lines; tabs are not allowed (Generic.WhiteSpace.DisallowTabIndent.TabsUsed) Controller/Attachment/Upload.php 31:5 warning Missing short description (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 32:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) Controller/Attachment/Update.php 31:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) Controller/Attachment/Preview.php 31:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) Controller/Attachment/Delete.php 31:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) Controller/Adminhtml/Attachment/Index.php 9:5 warning Visibility must be declared on all constants if your project supports PHP 7.1 or later (PSR12.Properties.ConstantVisibility.NotFound) Controller/Adminhtml/Attachment/Upload.php 9:5 warning Visibility must be declared on all constants if your project supports PHP 7.1 or later (PSR12.Properties.ConstantVisibility.NotFound) 36:5 warning Missing short description (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 37:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) Controller/Adminhtml/Attachment/Update.php 9:5 warning Visibility must be declared on all constants if your project supports PHP 7.1 or later (PSR12.Properties.ConstantVisibility.NotFound) 36:5 warning Missing short description (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 37:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) Controller/Adminhtml/Attachment/Preview.php 31:12 warning Comment block is missing (Magento2.Annotation.MethodAnnotationStructure.NoCommentBlock) Controller/Adminhtml/Attachment/Delete.php 9:5 warning Visibility must be declared on all constants if your project supports PHP 7.1 or later (PSR12.Properties.ConstantVisibility.NotFound) 36:5 warning Missing short description (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) 37:8 warning There must be exactly one blank line before tags (Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation) view/frontend/templates/email/order/attachments.phtml 1:17 warning The use of $this in templates is deprecated. Use $block instead. (Magento2.Templates.ThisInTemplate.FoundThis) 3:21 warning The use of $this in templates is deprecated. Use $block instead. (Magento2.Templates.ThisInTemplate.FoundThis) 7:21 warning Short echo tag syntax must be used; expected "=" but found "" (Magento2.Html.HtmlClosingVoidTags.HtmlClosingVoidElements) view/frontend/web/template/order/shipment/attachment-markup.html 1:1 warning Avoid using closing slash with void tags, this can lead to unexpected behavior - "