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
This commit is contained in:
36
plugins/com.noccy.apiclient/Api/Method.php
Normal file
36
plugins/com.noccy.apiclient/Api/Method.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?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,
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user