Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
PayloadValidator Class Reference

Public Member Functions

 __construct (\Magento\Framework\Module\FullModuleList $moduleList)
 
 validatePayload (array $postPayload)
 

Detailed Description

Validates payloads for updater tasks

Definition at line 12 of file PayloadValidator.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\Module\FullModuleList  $moduleList)
Parameters
\Magento\Framework\Module\FullModuleList$moduleList

Definition at line 22 of file PayloadValidator.php.

23  {
24  $this->moduleList = $moduleList;
25  }

Member Function Documentation

◆ validatePayload()

validatePayload ( array  $postPayload)

Validate POST request payload

Parameters
array$postPayload
Returns
string

Definition at line 33 of file PayloadValidator.php.

34  {
35  $jobType = $postPayload[UpdaterTaskCreator::KEY_POST_JOB_TYPE];
36  $errorMessage = '';
37  switch ($jobType) {
38  case 'uninstall':
39  $errorMessage = $this->validateUninstallPayload($postPayload);
40  break;
41 
42  case 'update':
43  $errorMessage = $this->validateUpdatePayload($postPayload);
44  break;
45 
46  case 'enable':
47  case 'disable':
48  $errorMessage = $this->validateEnableDisablePayload($postPayload);
49  break;
50  }
51  return $errorMessage;
52  }

The documentation for this class was generated from the following file: