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

Breadcrumb

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

function IfStatement::setAlternate

Sets the "else" statement

Parameters

Statement|FunctionDeclaration $alternate The "else" statement:

Return value

$this

File

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

Class

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

Namespace

Peast\Syntax\Node

Code

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