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


PHP Call::getResolvedParams方法代码示例

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


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

示例1: optimize

 /**
  * @param array $expression
  * @param Call $call
  * @param CompilationContext $context
  * @return bool|CompiledExpression
  * @throws CompilerException
  */
 public function optimize(array $expression, Call $call, CompilationContext $context)
 {
     if (!isset($expression['parameters'])) {
         return false;
     }
     if (count($expression['parameters']) != 1) {
         throw new CompilerException("phalcon_get_uri only accepts three parameter", $expression);
     }
     /**
      * Process the expected symbol to be returned
      */
     $call->processExpectedReturn($context);
     $symbolVariable = $call->getSymbolVariable();
     if ($symbolVariable->getType() != 'variable') {
         throw new CompilerException("Returned values by functions can only be assigned to variant variables", $expression);
     }
     if ($call->mustInitSymbolVariable()) {
         $symbolVariable->initVariant($context);
     }
     $context->headersManager->add('phalcon/mvc/url/utils', HeadersManager::POSITION_LAST);
     $resolvedParams = $call->getResolvedParams($expression['parameters'], $context, $expression);
     $symbol = $context->backend->getVariableCode($symbolVariable);
     $context->codePrinter->output('phalcon_get_uri(' . $symbol . ', ' . $resolvedParams[0] . ');');
     return new CompiledExpression('variable', $symbolVariable->getRealName(), $expression);
 }
开发者ID:mattvb91,项目名称:cphalcon,代码行数:32,代码来源:PhalconGetUriOptimizer.php

示例2: optimize

 /**
  * @param array $expression
  * @param Call $call
  * @param CompilationContext $context
  * @return bool|CompiledExpression
  * @throws CompilerException
  */
 public function optimize(array $expression, Call $call, CompilationContext $context)
 {
     if (!isset($expression['parameters'])) {
         return false;
     }
     if (count($expression['parameters']) != 3) {
         throw new CompilerException("phannot_parse_annotations only accepts three parameter", $expression);
     }
     /**
      * Process the expected symbol to be returned
      */
     $call->processExpectedReturn($context);
     $symbolVariable = $call->getSymbolVariable();
     if ($symbolVariable->getType() != 'variable') {
         throw new CompilerException("Returned values by functions can only be assigned to variant variables", $expression);
     }
     if ($call->mustInitSymbolVariable()) {
         $symbolVariable->initVariant($context);
     }
     $context->headersManager->add('phalcon/annotations/scanner', HeadersManager::POSITION_LAST);
     $context->headersManager->add('phalcon/annotations/annot', HeadersManager::POSITION_LAST);
     $symbolVariable->setDynamicTypes('array');
     $resolvedParams = $call->getResolvedParams($expression['parameters'], $context, $expression);
     $call->addCallStatusFlag($context);
     $symbol = $context->backend->getVariableCode($symbolVariable);
     $context->codePrinter->output('ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(' . $symbol . ', ' . $resolvedParams[0] . ', ' . $resolvedParams[1] . ', ' . $resolvedParams[2] . ' TSRMLS_CC);');
     $call->checkTempParameters($context);
     $call->addCallStatusOrJump($context);
     return new CompiledExpression('variable', $symbolVariable->getRealName(), $expression);
 }
开发者ID:mattvb91,项目名称:cphalcon,代码行数:37,代码来源:PhannotParseAnnotationsOptimizer.php

示例3: optimize

 /**
  * @param array $expression
  * @param Call $call
  * @param CompilationContext $context
  * @return bool|CompiledExpression|mixed
  * @throws CompilerException
  */
 public function optimize(array $expression, Call $call, CompilationContext $context)
 {
     if (!isset($expression['parameters'])) {
         return false;
     }
     if (count($expression['parameters']) != 1) {
         throw new CompilerException("phalcon_jsmin only accepts one parameter", $expression);
     }
     /**
      * Process the expected symbol to be returned
      */
     $call->processExpectedReturn($context);
     $symbolVariable = $call->getSymbolVariable();
     if ($symbolVariable->getType() != 'variable') {
         throw new CompilerException("Returned values by functions can only be assigned to variant variables", $expression);
     }
     if ($call->mustInitSymbolVariable()) {
         $symbolVariable->initVariant($context);
     }
     $context->headersManager->add('phalcon/assets/filters/jsminifier');
     $symbolVariable->setDynamicTypes('string');
     $resolvedParams = $call->getResolvedParams($expression['parameters'], $context, $expression);
     $context->codePrinter->output('phalcon_jsmin(' . $symbolVariable->getName() . ', ' . $resolvedParams[0] . ' TSRMLS_CC);');
     return new CompiledExpression('variable', $symbolVariable->getRealName(), $expression);
 }
开发者ID:lisong,项目名称:cphalcon,代码行数:32,代码来源:PhalconJsminOptimizer.php

示例4: optimize

 /**
  * @param array $expression
  * @param Call $call
  * @param CompilationContext $context
  * @return bool|CompiledExpression|mixed
  */
 public function optimize(array $expression, Call $call, CompilationContext $context)
 {
     if (!isset($expression['parameters'])) {
         return false;
     }
     /**
      * Process the expected symbol to be returned
      */
     $call->processExpectedReturn($context);
     $symbolVariable = $call->getSymbolVariable();
     if ($symbolVariable) {
         if ($symbolVariable->getType() != 'variable') {
             throw new CompilerException("Returned values by functions can only be assigned to variant variables", $expression);
         }
         if ($call->mustInitSymbolVariable()) {
             $symbolVariable->initVariant($context);
         }
     }
     $context->headersManager->add('kernel/variables');
     $resolvedParams = $call->getResolvedParams($expression['parameters'], $context, $expression);
     if ($symbolVariable) {
         $context->codePrinter->output('zephir_var_export_ex(' . $symbolVariable->getName() . ', &(' . $resolvedParams[0] . ') TSRMLS_CC);');
         return new CompiledExpression('variable', $symbolVariable->getRealName(), $expression);
     }
     $context->codePrinter->output('zephir_var_export(&' . $resolvedParams[0] . ' TSRMLS_CC);');
     return new CompiledExpression('null', 'null', $expression);
 }
开发者ID:NumbDai,项目名称:zephir,代码行数:33,代码来源:VarExportOptimizer.php

示例5: optimize

 /**
  * @param array $expression
  * @param Call $call
  * @param CompilationContext $context
  * @return bool|CompiledExpression|mixed
  * @throws CompilerException
  */
 public function optimize(array $expression, Call $call, CompilationContext $context)
 {
     if (!isset($expression['parameters'])) {
         return false;
     }
     if (count($expression['parameters']) > 1) {
         return false;
     }
     /**
      * Resolve parameters as vars
      */
     $call->getResolvedParams($expression['parameters'], $context, $expression);
     /**
      * Get CompiledExpression(s) for resolved var(s)
      */
     $resolvedParams = $call->getResolvedParamsAsExpr($expression['parameters'], $context, $expression);
     $compiledExpression = $resolvedParams[0];
     switch ($compiledExpression->getType()) {
         case 'int':
         case 'float':
         case 'long':
         case 'ulong':
         case 'double':
             $context->headersManager->add('math');
             return $this->passNativeFCall($compiledExpression, $expression);
             break;
         case 'variable':
             $variable = $context->symbolTable->getVariable($compiledExpression->getCode());
             switch ($variable->getType()) {
                 case 'int':
                 case 'float':
                 case 'long':
                 case 'ulong':
                 case 'double':
                     $context->headersManager->add('math');
                     return $this->passNativeFCall($compiledExpression, $expression);
                     break;
                 case 'variable':
                     $context->headersManager->add('kernel/math');
                     return new CompiledExpression('double', 'zephir_' . $this->getFunctionName() . '(' . $context->backend->getVariableCode($variable) . ' TSRMLS_CC)', $expression);
                     break;
             }
             break;
     }
     return false;
 }
开发者ID:WalterShe,项目名称:zephir,代码行数:53,代码来源:MathOptimizer.php


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