for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Service specification
* User: moyo
* Date: 21/09/2017
* Time: 10:50 AM
*/
namespace Carno\RPC\Service;
class Specification
{
* @var string
private $server = null;
private $service = null;
* @var array
private $methodRequests = [];
private $methodResponses = [];
* Specification constructor.
* @param string $server
* @param string $service
public function __construct(string $server, string $service)
$this->server = $server;
$this->service = $service;
}
* @return string
public function getServer() : string
return $this->server;
public function getService() : string
return $this->service;
* @param array $methodRRs
* @return static
public function setMethods(array $methodRRs) : self
foreach ($methodRRs as $methodName => $rrs) {
isset($rrs['in']) && $this->methodRequests[$methodName] = $rrs['in'];
isset($rrs['out']) && $this->methodResponses[$methodName] = $rrs['out'];
return $this;
* @param string $method
public function getMethodRequest(string $method) : string
return $this->methodRequests[$method] ?? '';
public function getMethodResponse(string $method) : string
return $this->methodResponses[$method] ?? '';