本文整理汇总了PHP中Expression::compileCode方法的典型用法代码示例。如果您正苦于以下问题:PHP Expression::compileCode方法的具体用法?PHP Expression::compileCode怎么用?PHP Expression::compileCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Expression
的用法示例。
在下文中一共展示了Expression::compileCode方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: compileCode
protected function compileCode(&$code)
{
$code .= 'return ';
if ($this->value !== null) {
$this->value->compileCode($code);
}
}
示例2: compileCode
protected function compileCode(&$code)
{
if ($this->isUnpacked) {
$code .= '...';
}
$this->value->compileCode($code);
}
示例3: compileCode
protected function compileCode(&$code)
{
$this->value->compileCode($code);
$code .= '[';
if ($this->index !== null) {
$this->index->compileCode($code);
}
$code .= ']';
}
示例4: compileCode
protected function compileCode(&$code)
{
if ($this->name instanceof ValueExpression && self::isNormalSyntaxName($this->name->getValue())) {
$code .= '$' . $this->name->getValue();
} else {
$code .= '${';
$this->name->compileCode($code);
$code .= '}';
}
}
示例5: compileCode
protected function compileCode(&$code)
{
if ($this->name instanceof ValueExpression) {
$code .= $this->name->getValue();
} else {
$this->name->compileCode($code);
}
$code .= '(';
$code .= implode(',', self::compileAll($this->arguments));
$code .= ')';
}
示例6: compileCode
protected function compileCode(&$code)
{
$code .= '(';
$this->leftOperand->compileCode($code);
$code .= ' ' . $this->operator . ' ';
if ($this->operator === Operators\Binary::IS_INSTANCE_OF && $this->rightOperand instanceof ValueExpression) {
$code .= $this->rightOperand->getValue();
} else {
$this->rightOperand->compileCode($code);
}
$code .= ')';
}
示例7: compileCode
protected function compileCode(&$code)
{
$code .= '(';
$this->condition->compileCode($code);
$code .= ' ? ';
if ($this->ifTrue !== null) {
$this->ifTrue->compileCode($code);
}
$code .= ' : ';
$this->ifFalse->compileCode($code);
$code .= ')';
}
示例8: compileCode
protected function compileCode(&$code)
{
$this->value->compileCode($code);
$code .= '->';
if ($this->name instanceof ValueExpression && self::isNormalSyntaxName($this->name->getValue())) {
$code .= $this->name->getValue();
} else {
$code .= '{';
$this->name->compileCode($code);
$code .= '}';
}
$code .= '(';
$code .= implode(',', self::compileAll($this->arguments));
$code .= ')';
}
示例9: compileType
protected function compileType(&$code, Expression $typeExpression)
{
if ($typeExpression instanceof ValueExpression) {
$code .= $typeExpression->getValue();
} else {
$typeExpression->compileCode($code);
}
}
示例10: compileCode
protected function compileCode(&$code)
{
if ($this->key !== null) {
$this->key->compileCode($code);
$code .= ' => ';
}
if ($this->isReference) {
$code .= '&';
}
$this->value->compileCode($code);
}
示例11: compileCode
protected function compileCode(&$code)
{
if ($this->typeHint !== null) {
$code .= $this->typeHint . ' ';
}
if ($this->isPassedByReference) {
$code .= '&';
}
if ($this->isVariadic) {
$code .= '...';
}
$code .= '$' . $this->name;
if ($this->defaultValue !== null) {
$code .= ' = ';
$this->defaultValue->compileCode($code);
}
}
示例12: compileCode
protected function compileCode(&$code)
{
$code .= 'empty(';
$this->value->compileCode($code);
$code .= ')';
}
示例13: compileCode
protected function compileCode(&$code)
{
$code .= $this->castType;
$this->castValue->compileCode($code);
}