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

Breadcrumb

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

function Parser::postInit

Post initialize operations

Return value

void

Overrides ParserAbstract::postInit

File

vendor/mck89/peast/lib/Peast/Syntax/Parser.php, line 158

Class

Parser
Parser class

Namespace

Peast\Syntax

Code

protected function postInit() {
    
    //Remove exponentiation operator if the feature
    
    //is not enabled
    if (!$this->features->exponentiationOperator) {
        Utils::removeArrayValue($this->assignmentOperators, "**=");
        unset($this->logicalBinaryOperators["**"]);
    }
    
    //Remove coalescing operator if the feature
    
    //is not enabled
    if (!$this->features->coalescingOperator) {
        unset($this->logicalBinaryOperators["??"]);
    }
    
    //Remove logical assignment operators if the
    
    //feature is not enabled
    if (!$this->features->logicalAssignmentOperators) {
        foreach (array(
            "&&=",
            "||=",
            "??=",
        ) as $op) {
            Utils::removeArrayValue($this->assignmentOperators, $op);
        }
    }
}

API Navigation

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