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,
							 | 
						||
| 
								 | 
							
								        ];
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								}
							 |