Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. IfStatement.php

function IfStatement::setConsequent

Sets the statement that is activated if the test expression is true

Parameters

Statement|FunctionDeclaration $consequent The consequent expression:

Return value

$this

File

vendor/mck89/peast/lib/Peast/Syntax/Node/IfStatement.php, line 92

Class

IfStatement
A node that represents an if statement. For example: if (test) {} else {}

Namespace

Peast\Syntax\Node

Code

public function setConsequent($consequent) {
    $this->assertType($consequent, array(
        "Statement",
        "FunctionDeclaration",
    ), true);
    $this->consequent = $consequent;
    return $this;
}
RSS feed
Powered by Drupal