code: public function jsonSerialize()
      {
          $json = [];
  
          if (null !== $this->section) {
              $json['section'] = $this->section;
          }
          if (null !== $this->data) {
              $json['data'] = $this->data;
          }
  
          return $json;
      }
docs: Gets all data that should be available in a json representation.
  
  @return array an associative array of the available variables