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

Breadcrumb

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

function ConstExprEvaluator::__construct

Create a constant expression evaluator.

The provided fallback evaluator is invoked whenever a subexpression cannot be evaluated. See class doc comment for more information.

Parameters

callable|null $fallbackEvaluator To call if subexpression cannot be evaluated:

File

vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php, line 41

Class

ConstExprEvaluator
Evaluates constant expressions.

Namespace

PhpParser

Code

public function __construct(?callable $fallbackEvaluator = null) {
    $this->fallbackEvaluator = $fallbackEvaluator ?? function (Expr $expr) {
        throw new ConstExprEvaluationException("Expression of type {$expr->getType()} cannot be evaluated");
    };
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal