Google\Cloud\Dev\DocGenerator\Parser\CodeParser::buildNestedParams PHP Method

buildNestedParams() private method

PHPDoc has no support for nested params currently. this is a workaround until it is implemented.
private buildNestedParams ( $nestedParams, $origParam )
    private function buildNestedParams($nestedParams, $origParam)
    {
        $paramsArray = [];
        foreach ($nestedParams as $param) {
            $nestedParam = explode(' ', trim($param), 3);
            if (count($nestedParam) < 3) {
                throw new \Exception('nested param is in an invalid format: ' . $param);
            }
            list($type, $name, $description) = $nestedParam;
            $name = substr($name, 1);
            $description = preg_replace('/\\s+/', ' ', $description);
            $types = explode('|', $type);
            $paramsArray[] = ['name' => substr($origParam->getVariableName(), 1) . '.' . $name, 'description' => $this->buildDescription($origParam->getDocBlock(), $description), 'types' => $this->handleTypes($types), 'optional' => null, 'nullable' => null];
        }
        return $paramsArray;
    }