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


PHP Node::isPublic方法代码示例

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


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

示例1: enterNode

 function enterNode(\PhpParser\Node $node)
 {
     if ($node instanceof \PhpParser\Node\Stmt\Namespace_) {
         $this->addNamespace(array('namespace' => $node->name->toString(), 'line' => $node->getLine(), 'file' => $this->file));
     }
     if ($node instanceof \PhpParser\Node\Stmt\Use_) {
         foreach ($node->uses as $use) {
             $this->addUse(array('name' => $use->name, 'alias' => $use->alias));
         }
     }
     if ($node instanceof \PhpParser\Node\Stmt\Class_) {
         $this->addClass(array('name' => $node->name, 'extends' => $node->extends, 'implements' => $node->implements, 'abstract' => $node->isAbstract(), 'final' => $node->isFinal(), 'comment' => $node->getDocComment(), 'doc' => $this->doc_comment_parser->parse($node->getDocComment()), 'line' => $node->getLine(), 'file' => $this->file));
     }
     if ($node instanceof \PhpParser\Node\Stmt\Interface_) {
         $this->addInterface(array('name' => $node->name, 'extends' => $node->extends, 'comment' => $node->getDocComment(), 'doc' => $this->doc_comment_parser->parse($node->getDocComment()), 'line' => $node->getLine(), 'file' => $this->file));
     }
     if ($node instanceof \PhpParser\Node\Stmt\ClassMethod) {
         $this->addClassMethod(array('byRef' => $node->byRef, 'name' => $node->name, 'params' => $node->params, 'returnType' => $node->returnType, 'public' => $node->isPublic(), 'protected' => $node->isProtected(), 'private' => $node->isPrivate(), 'abstract' => $node->isAbstract(), 'final' => $node->isFinal(), 'static' => $node->isStatic(), 'comment' => $node->getDocComment(), 'doc' => $this->doc_comment_parser->parse($node->getDocComment()), 'line' => $node->getLine(), 'file' => $this->file));
     }
     if ($node instanceof \PhpParser\Node\Stmt\Property) {
         $this->last_property = $node;
     }
     if ($node instanceof \PhpParser\Node\Stmt\PropertyProperty) {
         $this->addClassProperty(array('name' => $node->name, 'default' => $node->default, 'public' => $this->last_property->isPublic(), 'protected' => $this->last_property->isProtected(), 'private' => $this->last_property->isPrivate(), 'static' => $this->last_property->isStatic(), 'comment' => $node->getDocComment(), 'doc' => $this->doc_comment_parser->parse($node->getDocComment()), 'line' => $node->getLine(), 'file' => $this->file));
     }
     // $this->logger->info(get_class($node));
 }
开发者ID:soundasleep,项目名称:phpdoc2,代码行数:27,代码来源:Parser.php

示例2: enter

 public final function enter(Node $node)
 {
     if ($node->getType() == 'Stmt_ClassMethod' && $node->isPublic()) {
         $fqcn = $this->getCurrentFqcn();
         $this->enterPublicMethod($fqcn, $node);
     }
 }
开发者ID:trismegiste,项目名称:mondrian,代码行数:7,代码来源:ObjectLevelHelper.php

示例3: enter

 protected function enter(Node $node)
 {
     if ($node instanceof Property) {
         if ($node->isPublic()) {
             foreach ($node->props as $property) {
                 $this->dispatch(new \Solidifier\Defects\PublicAttribute($this->currentObjectType, $property->name, $node));
             }
         }
     }
 }
开发者ID:niktux,项目名称:solidifier,代码行数:10,代码来源:PublicAttributes.php

示例4: enter

 public function enter(Node $node)
 {
     switch ($node->getType()) {
         case 'Stmt_ClassMethod':
             if ($node->isPublic()) {
                 $fqcn = $this->getCurrentFqcn();
                 $this->getReflectionContext()->addMethodToClass($fqcn, $node->name);
             }
             break;
     }
 }
开发者ID:trismegiste,项目名称:mondrian,代码行数:11,代码来源:InterfaceLevel.php

示例5: enter

 public function enter(Node $node)
 {
     switch ($node->getType()) {
         case 'Stmt_ClassMethod':
             if ($node->isPublic()) {
                 $this->context->pushState('trait-method', $node);
                 $this->enterPublicMethod($node);
             }
             break;
         case 'Stmt_TraitUse':
             $fqcn = $this->getCurrentFqcn();
             $currentVertex = $this->findVertex('trait', $fqcn);
             $this->enterTraitUse($node, $currentVertex);
             break;
     }
 }
开发者ID:trismegiste,项目名称:mondrian,代码行数:16,代码来源:TraitLevel.php

示例6: extractMethod

 /**
  * Ищвлекает тело метода из текущего узла
  *
  * @param Node|ClassMethod $stmt    Узел
  * @param Method[]         $methods Список методов
  *
  * @return void
  */
 private function extractMethod($stmt, array &$methods)
 {
     if (!$stmt instanceof ClassMethod) {
         return;
     }
     $skip = $this->isPublicOnly && $stmt->isPublic() === false;
     if (!$skip) {
         $methods[] = new Method(new MethodContext($this->context->namespace, $this->context->class), $stmt->name, $this->printer->prettyPrint([$stmt]));
     }
 }
开发者ID:itmh,项目名称:cyclophp,代码行数:18,代码来源:SourceExtractor.php

示例7: detectNewMagicDefinitions

 /**
  * @param \PhpParser\Node $node
  */
 private function detectNewMagicDefinitions(Node $node)
 {
     if ($node instanceof Node\Stmt\ClassMethod && $node->isPublic() || ($node instanceof Node\Expr\MethodCall || $node instanceof Node\Expr\StaticCall) && is_string($node->name)) {
         if (strcasecmp($node->name, '__callStatic') === 0) {
             $this->getResult()->addRequirement(Reason::CALLSTATIC_MAGIC_METHOD, $node->getLine());
         } elseif (strcasecmp($node->name, '__invoke') === 0) {
             $this->getResult()->addRequirement(Reason::INVOKE_MAGIC_METHOD, $node->getLine());
         }
     } elseif ($node instanceof Node\Scalar\MagicConst\Dir) {
         $this->getResult()->addRequirement(Reason::DIR_MAGIC_CONSTANT, $node->getLine());
     }
 }
开发者ID:suralc,项目名称:pvra,代码行数:15,代码来源:Php53Features.php


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