Webiny\Component\Rest\Parser\ParameterParser::getType PHP Method

getType() private method

If type is not detected, "string" is returned as the default type.
private getType ( string $pName, ConfigObject $annotations ) : string
$pName string Name of the parameter.
$annotations Webiny\Component\Config\ConfigObject Parameter annotations.
return string Name of the parameter type, based on keys in static::$paramTypes.
    private function getType($pName, $annotations)
    {
        $type = 'string';
        foreach ($annotations as $a) {
            if (strpos($a, '$' . $pName)) {
                foreach (self::$paramTypes as $typeKey => $typeList) {
                    foreach ($typeList as $t) {
                        if (strpos(trim($a), $t) === 0) {
                            $type = $typeKey;
                        }
                    }
                }
            }
        }
        return $type;
    }