code: private function getPayload($command)
      {
          if (!($command instanceof CommandInterface) && !($command instanceof QueryInterface)) {
              return [];
          }
  
          $payload = $command->toArray();
  
          return $this->preparePayload($payload);
      }
docs: @param mixed $command
  
  @return array