UNPKG

@rightcapital/phpdoc-parser

Version:

TypeScript version of PHPDoc parser with support for intersection types and generics

28 lines (27 loc) 1.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MethodTagValueParameterNode = void 0; const php_doc_tag_value_node_1 = require("./php-doc-tag-value-node"); class MethodTagValueParameterNode extends php_doc_tag_value_node_1.PhpDocTagValueNode { constructor(type, isReference, isVariadic, parameterName, defaultValue) { super(); this.type = type; this.isReference = isReference; this.isVariadic = isVariadic; this.parameterName = parameterName; this.defaultValue = defaultValue; } toString() { const type = this.type ? `${this.type.toString()} ` : ''; const isReference = this.isReference ? '&' : ''; const isVariadic = this.isVariadic ? '...' : ''; const defaultVal = this.defaultValue !== undefined ? ` = ${this.defaultValue.toString()}` : ''; return `${type}${isReference}${isVariadic}${this.parameterName}${defaultVal}`; } getNodeType() { return 'MethodTagValueParameterNode'; } } exports.MethodTagValueParameterNode = MethodTagValueParameterNode;