php-spark/plugins/com.noccy.apiclient/Api/Method.php
Christopher Vagnetoft 8cc1eac7a4 Multiple fixes
* Implemented ScriptRunner with environment expansion and cleaner
  code.
* Added ApiClient plugin (com.noccy.apiclient)
* Renamed CHANGELOG.md to VERSIONS.md
* Shuffled buildtools
* Added first unittests
2021-12-11 01:44:01 +01:00

37 lines
718 B
PHP

<?php // "name":"Call on web APIs", "author":"Noccy"
namespace SparkPlug\Com\Noccy\ApiClient\Api;
use JsonSerializable;
class Method implements JsonSerializable
{
private array $properties = [];
private ?string $info;
public function __construct(array $method)
{
$this->properties = $method['props']??[];
$this->info = $method['info']??null;
}
public function getProperties(): array
{
return $this->properties;
}
public function getInfo(): ?string
{
return $this->info;
}
public function jsonSerialize(): mixed
{
return [
'info' => $this->info,
'props' => $this->properties,
];
}
}