dev/src/DocGenerator/Parser/CodeParser.php
private function buildNestedParams($nestedParams, $origParam, $isProto = false)
    {
        $paramsArray = [];

        foreach ($nestedParams as $param) {
            $nestedParam = explode(' ', trim($param), 3);

            // START proto nested arg missing description workaround
            if (count($nestedParam) < 3 && !$isProto) {
                throw new \Exception('nested param is in an invalid format: '. $param);
            }
            // END proto nested arg missing description workaround

            list($type, $name, $description) = $nestedParam;
            $name = substr($name, 1);
            $description = preg_replace('/\s+/', ' ', $description);

            $types = new Collection(
                array($type),
                $origParam->getDocBlock() ? $origParam->getDocBlock()->getContext() : null
            );

            $paramsArray[] = [
                'name' => substr($origParam->getVariableName(), 1) . '.' . $name,
                'description' => $this->buildDescription($origParam->getDocBlock(), $description, $origParam),
                'types' => $this->handleTypes($types),
                'optional' => null, // @todo
                'nullable' => null //@todo
            ];
        }

        return $paramsArray;
    }
private function buildNestedParams($nestedParams, $origParam, $isProto = false)
    {
        $paramsArray = [];

        foreach ($nestedParams as $param) {
            $nestedParam = explode(' ', trim($param), 3);

            // START proto nested arg missing description workaround
            if (count($nestedParam) < 3 && !$isProto) {
                throw new \Exception('nested param is in an invalid format: '. $param);
            }
            // END proto nested arg missing description workaround

            list($type, $name, $description) = $nestedParam;
            $name = substr($name, 1);
            $description = preg_replace('/\s+/', ' ', $description);

            $types = new Collection(
                array($type),
                $origParam->getDocBlock() ? $origParam->getDocBlock()->getContext() : null
            );

            $paramsArray[] = [
                'name' => substr($origParam->getVariableName(), 1) . '.' . $name,
                'description' => $this->buildDescription($origParam->getDocBlock(), $description, $origParam),
                'types' => $this->handleTypes($types),
                'optional' => null, // @todo
                'nullable' => null //@todo
            ];
        }

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