Esempio n. 1
0
 /**
  * @param PlatformEvent|array $event
  *
  * @return array
  */
 public static function buildRequestArray($event = null)
 {
     $reqObj = Pii::request(false);
     $data = $event ? is_array($event) ? $event : $event->getRequestData() : null;
     $request = ['method' => strtoupper($reqObj->getMethod()), 'headers' => $reqObj->headers->all(), 'cookies' => $reqObj->cookies->all(), 'query' => $reqObj->query->all(), 'body' => $data, 'files' => false];
     $files = $reqObj->files->all();
     if (!empty($files)) {
         $request['files'] = $files;
     }
     return $request;
 }