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


PHP Context::addSymbol方法代码示例

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


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

示例1: compile

 /**
  * @param Context $context
  * @return boolean|null
  */
 public function compile(Context $context)
 {
     $this->compiled = true;
     $context->scopePointer = $this->getPointer();
     if ($this->statement->getDocComment() === null) {
         $context->notice('missing-docblock', sprintf('Missing docblock for %s() method', $this->name), $this->statement);
     }
     /**
      * It's not needed to compile empty method via it's abstract
      */
     if ($this->isAbstract()) {
         /** @var ClassDefinition $scope */
         $scope = $context->scope;
         if (!$scope->isAbstract()) {
             $context->notice('not-abstract-class-with-abstract-method', 'Class must be an abstract', $this->statement);
         }
         return true;
     }
     if (count($this->statement->stmts) == 0) {
         return $context->notice('not-implemented-method', sprintf('Method %s() is not implemented', $this->name), $this->statement);
     }
     if (count($this->statement->params) > 0) {
         /** @var  Node\Param $parameter */
         foreach ($this->statement->params as $parameter) {
             $context->addSymbol($parameter->name);
         }
     }
     foreach ($this->statement->stmts as $st) {
         \PHPSA\nodeVisitorFactory($st, $context);
     }
 }
开发者ID:krakjoe,项目名称:phpsa,代码行数:35,代码来源:ClassMethod.php

示例2: compile

 /**
  * @param Context $context
  * @return bool
  */
 public function compile(Context $context)
 {
     if ($this->st->getDocComment() === null) {
         return $context->notice('missing-docblock', sprintf('Missing docblock for %s() method', $this->name), $this->st);
     }
     if (count($this->ast) == 0) {
         return $context->notice('not-implemented-method', sprintf('Method %s() is not implemented', $this->name), $this->st);
     }
     if (count($this->st->params) > 0) {
         /** @var  Node\Param $parameter */
         foreach ($this->st->params as $parameter) {
             $context->addSymbol($parameter->name);
         }
     }
     foreach ($this->ast as $st) {
         $result = \PHPSA\nodeVisitorFactory($st, $context);
     }
 }
开发者ID:necromant2005,项目名称:phpsa,代码行数:22,代码来源:ClassMethod.php

示例3: compile

 /**
  * Compile function to check it
  *
  * @param Context $context
  * @return bool
  */
 public function compile(Context $context)
 {
     $this->compiled = true;
     $context->scopePointer = $this->getPointer();
     $context->setScope(null);
     if (count($this->statement->stmts) == 0) {
         return $context->notice('not-implemented-function', sprintf('Function %s() is not implemented', $this->name), $this->statement);
     }
     if (count($this->statement->params) > 0) {
         /** @var  Node\Param $parameter */
         foreach ($this->statement->params as $parameter) {
             $context->addSymbol($parameter->name);
         }
     }
     foreach ($this->statement->stmts as $st) {
         \PHPSA\nodeVisitorFactory($st, $context);
     }
     return true;
 }
开发者ID:krakjoe,项目名称:phpsa,代码行数:25,代码来源:FunctionDefinition.php


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