public function parseDocblockType($type) { $types = explode('|', $type); $finalTypes = []; foreach ($types as $type) { $isArray = strpos($type, '[]') !== false; $typeWithoutArray = str_replace('[]', '', $type); if (\Phint\Context\Variable::isClassType($typeWithoutArray)) { $type = $this->getClassName($typeWithoutArray); if ($isArray) { $type .= '[]'; } } $finalTypes[] = $type; } return $finalTypes; }
private function updateType(array $types) { $reflClass = []; foreach ($types as $key => $type) { $arrayOf = substr($type, -2) == '[]'; $typeWithoutArray = str_replace('[]', '', $type); if (\Phint\Context\Variable::isClassType($typeWithoutArray)) { if (!$this->classExists($typeWithoutArray)) { $currentClass = $this->getCurrentReflectionClass(); $currentClass = $currentClass ? $currentClass->getName() : null; $this->addClassNotFoundError($typeWithoutArray, $currentClass, $this->currentLink); return false; } if (!$arrayOf) { $reflClass[] = new ReflectionClass($type); } } } $this->currentReflClass = $reflClass; $this->currentType = $types; return true; }