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

Breadcrumb

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

function Parser::parseLiteralBoolNull

Parses a literal boolean or null value

Return value

int|bool|null

Throws

Exception

1 call to Parser::parseLiteralBoolNull()
Parser::parseLiteral in vendor/mck89/peast/lib/Peast/Selector/Parser.php
Parses a literal value

File

vendor/mck89/peast/lib/Peast/Selector/Parser.php, line 371

Class

Parser
Selector parser class

Namespace

Peast\Selector

Code

protected function parseLiteralBoolNull() {
    $word = $this->consumeWord();
    if (!$word) {
        return 0;
    }
    elseif ($word === "true") {
        return true;
    }
    elseif ($word === "false") {
        return false;
    }
    elseif ($word === "null") {
        return null;
    }
    throw new Exception("Invalid attribute value '{$word}'");
}

API Navigation

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