Yaffs site version 1.1
[yaffs-website] / vendor / phpdocumentor / reflection-docblock / src / phpDocumentor / Reflection / DocBlock / Type / Collection.php
index 90ead3ff4e86b3e6aa96118593a4b1f00a09be30..327819c2c376579577d4a2a6c8eaf67141678479 100644 (file)
@@ -161,7 +161,8 @@ class Collection extends \ArrayObject
             $namespace_aliases = $this->context->getNamespaceAliases();
             // if the first segment is not an alias; prepend namespace name and
             // return
-            if (!isset($namespace_aliases[$type_parts[0]])) {
+            if (!isset($namespace_aliases[$type_parts[0]]) &&
+                !isset($namespace_aliases[strstr($type_parts[0], '::', true)])) {
                 $namespace = $this->context->getNamespace();
                 if ('' !== $namespace) {
                     $namespace .= self::OPERATOR_NAMESPACE;
@@ -169,6 +170,12 @@ class Collection extends \ArrayObject
                 return self::OPERATOR_NAMESPACE . $namespace . $type;
             }
 
+            if (strpos($type_parts[0], '::')) {
+                $type_parts[] = strstr($type_parts[0], '::');
+                $type_parts[0] = $namespace_aliases[strstr($type_parts[0], '::', true)];
+                return implode('', $type_parts);
+            }
+
             $type_parts[0] = $namespace_aliases[$type_parts[0]];
             $type = implode(self::OPERATOR_NAMESPACE, $type_parts);
         }