Ran Magento's coding standard checking tool. Found and fixed the following issues:
Indentation - must use spaces not tabs.
Direct usage of $_POST and $_SERVER - shouldn't directly use them but instead use Magento's built-in classes to retrieve those. RequestInterface class.
Direct accessing of ObjectManager Class - shouldn't directly create an ObjectManager class but use the Factory classes available in Magento. The same thing applies to the model created by the module. Magento creates a factory class for that model.
Ran Magento's coding standard checking tool. Found and fixed the following issues:
$_POST
and$_SERVER
- shouldn't directly use them but instead use Magento's built-in classes to retrieve those.RequestInterface
class.ObjectManager
Class - shouldn't directly create an ObjectManager class but use the Factory classes available in Magento. The same thing applies to the model created by the module. Magento creates a factory class for that model.