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

Breadcrumb

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

function BooleanParser::parse

Parameters

string|bool $value:

1 call to BooleanParser::parse()
Configuration::getBoolean in vendor/open-telemetry/sdk/Common/Configuration/Configuration.php

File

vendor/open-telemetry/sdk/Common/Configuration/Parser/BooleanParser.php, line 17

Class

BooleanParser

Namespace

OpenTelemetry\SDK\Common\Configuration\Parser

Code

public static function parse($value) : bool {
    if (is_bool($value)) {
        return $value;
    }
    if (strtolower($value) === self::TRUE_VALUE) {
        return true;
    }
    if (strtolower($value) === self::FALSE_VALUE) {
        return false;
    }
    throw new InvalidArgumentException(sprintf('Value "%s" is a non-boolean value', $value));
}

API Navigation

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