Lines Matching refs:type

80      * @param string $type     The relative or absolute type.
89 public function resolve($type, Context $context = null) argument
91 if (!is_string($type)) {
93 …Attempted to resolve type but it appeared not to be a string, received: ' . var_export($type, true)
97 $type = trim($type);
98 if (!$type) {
99 …throw new \InvalidArgumentException('Attempted to resolve "' . $type . '" but it appears to be emp…
107 case $this->isNullableType($type):
108 return $this->resolveNullableType($type, $context);
109 case $this->isKeyword($type):
110 return $this->resolveKeyword($type);
111 case ($this->isCompoundType($type)):
112 return $this->resolveCompoundType($type, $context);
113 case $this->isTypedArray($type):
114 return $this->resolveTypedArray($type, $context);
115 case $this->isFqsen($type):
116 return $this->resolveTypedObject($type);
117 case $this->isPartialStructuralElementName($type):
118 return $this->resolveTypedObject($type, $context);
123 'Unable to resolve type "' . $type . '", there is no known method to resolve it'
158 … * @param string $type A relative or absolute type as defined in the phpDocumentor documentation.
162 private function isTypedArray($type) argument
164 return substr($type, -2) === self::OPERATOR_ARRAY;
170 … * @param string $type A relative or absolute type as defined in the phpDocumentor documentation.
174 private function isKeyword($type) argument
176 return in_array(strtolower($type), array_keys($this->keywords), true);
182 … * @param string $type A relative or absolute type as defined in the phpDocumentor documentation.
186 private function isPartialStructuralElementName($type) argument
188 return ($type[0] !== self::OPERATOR_NAMESPACE) && !$this->isKeyword($type);
194 * @param string $type
198 private function isFqsen($type) argument
200 return strpos($type, self::OPERATOR_NAMESPACE) === 0;
206 * @param string $type
210 private function isCompoundType($type) argument
212 return strpos($type, '|') !== false;
218 * @param string $type
222 private function isNullableType($type) argument
224 return $type[0] === '?';
230 * @param string $type
235 private function resolveTypedArray($type, Context $context) argument
237 return new Array_($this->resolve(substr($type, 0, -2), $context));
243 * @param string $type
247 private function resolveKeyword($type) argument
249 $className = $this->keywords[strtolower($type)];
257 * @param string $type
262 private function resolveTypedObject($type, Context $context = null) argument
264 return new Object_($this->fqsenResolver->resolve($type, $context));
270 * @param string $type
275 private function resolveCompoundType($type, Context $context) argument
279 foreach (explode('|', $type) as $part) {
289 * @param string $type
294 private function resolveNullableType($type, Context $context) argument
296 return new Nullable($this->resolve(ltrim($type, '?'), $context));