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