diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/File/RequestAwareValidatorFile.php b/app/code/Magento/Catalog/Model/Product/Option/Type/File/RequestAwareValidatorFile.php index dbe84c1dcac61..609d02e33757a 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/File/RequestAwareValidatorFile.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/File/RequestAwareValidatorFile.php @@ -7,9 +7,15 @@ namespace Magento\Catalog\Model\Product\Option\Type\File; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\ObjectManager; use Magento\Framework\App\Request\Http as Request; +use Magento\Framework\Exception\FileSystemException; +use Magento\Framework\File\Size; +use Magento\Framework\Filesystem; +use Magento\Framework\HTTP\Adapter\FileTransferFactory; use Magento\Framework\Math\Random; +use Magento\Framework\Validator\File\IsImage; /** * Request Aware Validator to replace use of $_SERVER super global. @@ -24,21 +30,21 @@ class RequestAwareValidatorFile extends ValidatorFile /** * Constructor method * - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Filesystem $filesystem - * @param \Magento\Framework\File\Size $fileSize - * @param \Magento\Framework\HTTP\Adapter\FileTransferFactory $httpFactory - * @param \Magento\Framework\Validator\File\IsImage $isImageValidator + * @param ScopeConfigInterface $scopeConfig + * @param Filesystem $filesystem + * @param Size $fileSize + * @param FileTransferFactory $httpFactory + * @param IsImage $isImageValidator * @param Random|null $random * @param Request|null $request - * @throws \Magento\Framework\Exception\FileSystemException + * @throws FileSystemException */ public function __construct( - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Filesystem $filesystem, - \Magento\Framework\File\Size $fileSize, - \Magento\Framework\HTTP\Adapter\FileTransferFactory $httpFactory, - \Magento\Framework\Validator\File\IsImage $isImageValidator, + ScopeConfigInterface $scopeConfig, + Filesystem $filesystem, + Size $fileSize, + FileTransferFactory $httpFactory, + IsImage $isImageValidator, Random $random = null, Request $request = null ) { diff --git a/lib/internal/Magento/Framework/ContextInterface.php b/lib/internal/Magento/Framework/ContextInterface.php deleted file mode 100644 index ace0784180798..0000000000000 --- a/lib/internal/Magento/Framework/ContextInterface.php +++ /dev/null @@ -1,23 +0,0 @@ -_config = $config; $this->_factory = $factory; diff --git a/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php b/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php index 40e367e88a912..6419295753051 100644 --- a/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php +++ b/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php @@ -97,6 +97,7 @@ public function __construct( $this->_filesystem = $filesystem; $this->directoryWrite = $this->_filesystem->getDirectoryWrite(DirectoryList::VAR_DIR); $this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class); + $this->registerShutdownFunction(); } /** @@ -283,7 +284,7 @@ protected function _formatError($errorMessage, $trace, $httpCode, $format) * * @return $this */ - public function __destruct() + public function registerShutdownFunction() { register_shutdown_function([$this, self::DEFAULT_SHUTDOWN_FUNCTION]); return $this;