/** * Creates a new Descriptor from the given Reflector. * * @param SeeTag $data * * @return SeeDescriptor */ public function create($data) { $descriptor = new SeeDescriptor($data->getName()); $descriptor->setDescription($data->getDescription()); // TODO: move this to the ReflectionDocBlock component // Expand FQCN part of the FQSEN $referenceParts = explode('::', $data->getReference()); $type = current($referenceParts); $type = new Collection(array($type), $data->getDocBlock() ? $data->getDocBlock()->getContext() : null); $referenceParts[0] = $type; $descriptor->setReference(implode('::', $referenceParts)); return $descriptor; }
/** * Creates a new Descriptor from the given Reflector. * * @param SeeTag $data * * @return SeeDescriptor */ public function create($data) { $descriptor = new SeeDescriptor($data->getName()); $descriptor->setDescription($data->getDescription()); $reference = $data->getReference(); if (substr($reference, 0, 7) !== 'http://' && substr($reference, 0, 8) !== 'https://' && $reference !== 'self' && $reference !== '$this') { // TODO: move this to the ReflectionDocBlock component // Expand FQCN part of the FQSEN $referenceParts = explode('::', $reference); if (count($referenceParts) > 1 && $reference[0] != '\\') { $type = current($referenceParts); $type = new Collection(array($type), $data->getDocBlock() ? $data->getDocBlock()->getContext() : null); $referenceParts[0] = $type; } elseif (isset($reference[0]) && $reference[0] != '\\') { array_unshift($referenceParts, Linker::CONTEXT_MARKER); } $reference = implode('::', $referenceParts); } $descriptor->setReference($reference); return $descriptor; }