PHP code example of altessa-s / proto-gen-php-rr

1. Go to this page and download the library: Download altessa-s/proto-gen-php-rr library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

altessa-s / proto-gen-php-rr example snippets


use Io\Altessa\Serviceinfo\V1\ServiceInfoServiceInterface;
use Io\Altessa\Serviceinfo\V1\GetServiceInfoRequest;
use Io\Altessa\Serviceinfo\V1\GetServiceInfoResponse;
use Io\Altessa\Serviceinfo\V1\ServiceInfo;
use Spiral\RoadRunner\GRPC\ContextInterface;

final class ServiceInfoService implements ServiceInfoServiceInterface
{
    public function GetServiceInfo(
        ContextInterface $ctx,
        GetServiceInfoRequest $in,
    ): GetServiceInfoResponse {
        $info = (new ServiceInfo())
            ->setServiceName('billing-api')
            ->setFullVersion('1.4.2+build.873');

        return (new GetServiceInfoResponse())->setServiceInfo($info);
    }
}