ZF\Apigility\Admin\Model\ModulePathSpec::getRpcPath PHP Method

getRpcPath() public method

public getRpcPath ( string $moduleName, integer $version = 1, string $serviceName = null ) : string
$moduleName string
$version integer
$serviceName string
return string
    public function getRpcPath($moduleName, $version = 1, $serviceName = null)
    {
        $find = ["\\", "%version%"];
        $replace = ["/", $version];
        $path = $this->getModuleSourcePath($moduleName);
        $path .= str_replace($find, $replace, $this->rpcPathSpec);
        if (substr($path, -1) != "/") {
            $path .= "/";
        }
        if (!empty($serviceName)) {
            $path .= $serviceName;
        }
        return $this->normalizePath($path);
    }

Usage Example

 /**
  * @group pathspec
  */
 public function testApiPathsPsr4()
 {
     $pathSpec = new ModulePathSpec($this->getModuleUtils(), 'psr-4');
     $basePath = '/app/ModuleName/src/V2/';
     $this->assertEquals($basePath . 'Rest/', $pathSpec->getRestPath('ModuleName', 2));
     $this->assertEquals($basePath . 'Rest/ServiceName', $pathSpec->getRestPath('ModuleName', 2, 'ServiceName'));
     $this->assertEquals($basePath . 'Rpc/', $pathSpec->getRpcPath('ModuleName', 2));
     $this->assertEquals($basePath . 'Rpc/ServiceName', $pathSpec->getRpcPath('ModuleName', 2, 'ServiceName'));
 }
All Usage Examples Of ZF\Apigility\Admin\Model\ModulePathSpec::getRpcPath