Christopher Vagnetoft
8cc1eac7a4
* 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
37 lines
718 B
PHP
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,
|
|
];
|
|
}
|
|
}
|