How to Ignore Line exceeds maximum limit of characters PHP_CodeSniffer in Magento 2?

You can suppress the warning of PHP Code sniffer either by
phpcs:ignore or phpcs:disable and phpcs:enable.

Warning,  Line exceeds the maximum limit of 120 characters; contains 230 characters Continue reading “How to Ignore Line exceeds maximum limit of characters PHP_CodeSniffer in Magento 2?”

How to prevent error: Use of $_FILES is discouraged in Magento 2?

How to prevent the use of global variable $_FILES in code?

Magento application does not directly use any PHP superglobals variable like $GLOBALS, $_SERVER, $_GET, $_POST, $_FILES, $_COOKIE, $_SESSION, $_REQUEST.

You don’t need to directly use $_FILES in your code for file/images save. This may be lead to security vulnerabilities. Continue reading “How to prevent error: Use of $_FILES is discouraged in Magento 2?”

How to attached Download sample file at Import functionality in Magento 2?

Magento 2, Out of the Box provides Import functionality for Catalog and Customer entity from admin panel via System -> Data Transfer
-> Import link.

You can create your own new entity type for import data using the Import link. When you create your own module you need to attached Download sample file for new user to easily manage Import data. Continue reading “How to attached Download sample file at Import functionality in Magento 2?”