当前位置: 首页>>代码示例>>PHP>>正文


PHP Link::getDestination方法代码示例

本文整理汇总了PHP中Link::getDestination方法的典型用法代码示例。如果您正苦于以下问题:PHP Link::getDestination方法的具体用法?PHP Link::getDestination怎么用?PHP Link::getDestination使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Link的用法示例。


在下文中一共展示了Link::getDestination方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: isPhpClass

 private function isPhpClass(Link $link)
 {
     $className = $link->getDestination();
     if (!class_exists($className, false)) {
         return false;
     }
     $classReflection = new \ReflectionClass($link->getDestination());
     return $classReflection->isInternal();
 }
开发者ID:ashleighpearson,项目名称:developer-documentation,代码行数:9,代码来源:PhpInternalFormatter.php

示例2: formatInternalMethod

 private function formatInternalMethod(Link $link)
 {
     if (empty($this->scope->class)) {
         return;
     }
     $methodName = substr($link->getDestination(), 0, strlen($link->getDestination()) - 2);
     $methods = $this->scope->class->getMethods(true);
     if (empty($methodName) || !array_key_exists($methodName, $methods)) {
         return;
     }
     $linkToClass = $this->getLinkToApiClass($this->scope->class->getName());
     return sprintf('[%s](%s#%s)', $link->getDescription(), $linkToClass, strtolower($methodName));
 }
开发者ID:ashleighpearson,项目名称:developer-documentation,代码行数:13,代码来源:InternalMethodFormatter.php

示例3: logUnresolvedLink

 private function logUnresolvedLink(Link $link)
 {
     $blacklist = array('array', 'string', 'mixed', 'int', 'integer', 'bool');
     if (in_array($link->getDestination(), $blacklist)) {
         return;
     }
     $message = 'Unresolved link: "' . $link->getDestination() . '"';
     if (empty($this->scope->class) && $this->scope->namespace) {
         $message .= ' in Namespace ' . $this->scope->namespace;
     } elseif (!empty($this->scope->class)) {
         $message .= ' in Class ' . $this->scope->class;
     }
     error_log($message);
 }
开发者ID:ashleighpearson,项目名称:developer-documentation,代码行数:14,代码来源:DefaultFormatter.php

示例4: formatApiClass

 private function formatApiClass(Link $link)
 {
     $linkToClass = $this->getLinkToApiClass($link->getDestination());
     if (empty($linkToClass)) {
         return;
     }
     $description = $link->getDescription();
     $parts = explode("\\", $description);
     $description = end($parts);
     $link = sprintf('[%s](%s)', $description, $linkToClass);
     return $link;
 }
开发者ID:ashleighpearson,项目名称:developer-documentation,代码行数:12,代码来源:ApiClassFormatter.php

示例5: formatInternalProperty

 private function formatInternalProperty(Link $link)
 {
     if (empty($this->scope->class)) {
         return;
     }
     $properties = $this->scope->class->getProperties(true);
     $propertyName = substr($link->getDestination(), 1);
     if (!$propertyName || !array_key_exists($propertyName, $properties)) {
         return;
     }
     $linkToClass = $this->getLinkToApiClass($this->scope->class->getName());
     return sprintf('[%s](%s#$%s)', $link->getDescription(), $linkToClass, strtolower($propertyName));
 }
开发者ID:ashleighpearson,项目名称:developer-documentation,代码行数:13,代码来源:InternalPropertyFormatter.php

示例6: parse

 public function parse($comment)
 {
     if (preg_match_all('/{\\@link(.*?)}/', $comment, $matches)) {
         foreach ($matches[0] as $key => $rawLink) {
             $linkParser = new LinkParser($this->scope);
             $linkFormatted = $linkParser->parse($matches[1][$key]);
             $comment = str_replace($rawLink, $linkFormatted, $comment);
         }
     }
     if (preg_match_all('/{\\@hook(.*?)}/', $comment, $matches)) {
         foreach ($matches[0] as $key => $rawLink) {
             $link = new Link($matches[1][$key]);
             $anchor = strtolower(str_replace('.', '', $link->getDestination()));
             $linkFormatted = sprintf('[%s](/api-reference/events#%s)', $link->getDescription(), $anchor);
             $comment = str_replace($rawLink, $linkFormatted, $comment);
         }
     }
     return $comment;
 }
开发者ID:ashleighpearson,项目名称:developer-documentation,代码行数:19,代码来源:InlineLinkParser.php

示例7: formatInternalConstant

 private function formatInternalConstant(Link $link)
 {
     $constName = $link->getDestination();
     if (empty($this->scope->class) || empty($constName)) {
         return;
     }
     $constants = $this->scope->class->getConstants(true);
     if (!array_key_exists($constName, $constants)) {
         return;
     }
     $constant = $constants[$constName];
     if (!$constant) {
         return;
     }
     $description = $link->getDescription();
     if ($constant->getLongDesc()) {
         // we are displaying a link only to constants having a long description.
         $linkToClass = $this->getLinkToApiClass($this->scope->class->getName());
         return sprintf('`[%s](%s#%s)`', $description, $linkToClass, strtolower($constant));
     }
     return sprintf('`%s`', $description);
 }
开发者ID:ashleighpearson,项目名称:developer-documentation,代码行数:22,代码来源:InternalConstantFormatter.php

示例8: parseLinkToExternalClass

 protected function parseLinkToExternalClass(Link $link)
 {
     return explode('::', $link->getDestination());
 }
开发者ID:ashleighpearson,项目名称:developer-documentation,代码行数:4,代码来源:ApiReferenceFormatter.php

示例9: formatting

 public function formatting(Link $link)
 {
     return $this->formatExternalLink($link->getDestination(), $link->getDescription());
 }
开发者ID:ashleighpearson,项目名称:developer-documentation,代码行数:4,代码来源:ExternalLinkFormatter.php

示例10: addLink

 public function addLink(Link $link)
 {
     $linkID = $this->getLinkID($link->getSource(), $link->getDestination());
     $this->links[$linkID] = $link;
 }
开发者ID:AlexKex,项目名称:php-a-star,代码行数:5,代码来源:Graph.php


注:本文中的Link::getDestination方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。