Checks whether a value is a boolean value

@param string $bValue The value to check

@return bool
556984
public function is_bool($bValue)
    {
        $this->set_message('is_bool', lang('fv_is_bool_field'));
        return is_bool($bValue) || $bValue === '1' || $bValue === '0' || $bValue === 1 || $bValue === 0;
    }
984438
private static boolean isValid(String stValue) {
        int scan;
        boolean bValid = true;

        for (scan = 0; scan < stValue.length(); scan++) {
            if (scan == 0)
                bValid = XMLChar.isNCNameStart(stValue.charAt(scan));
            else
                bValid = XMLChar.isNCName(stValue.charAt(scan));
            if (!bValid)
                break;
        }
        return bValid;
    }
159800
public static function isBooleanValue(string $value): bool
    {
        return in_array(strtolower(trim($value)), StringUtils::TRUES) || in_array(strtolower(trim($value)), StringUtils::FALSES);
    }
1319492
protected function isValueValid($value) {
		$this->checkValue($value);
		
		if ($this->validatable === null) {
			return true;
		}
		
		return $this->validatable->testEiFieldValue($this->eiu, $value);
	}
917290
public function containsValue($value): bool {
        TypeHelper::validateValue($value, $this);
        foreach ($this as $v) {
            if ($value == $v) {
                return true;
            }
        }

        return false;
    }
975803
public function containsOption($optionValue, $options)
    {
        if ($this->validationDisabled) {
            return true;
        }

        foreach ($options as $option) {
            if ($option['value'] == $optionValue) {
                return true;
            }
        }

        return false;
    }
607544
protected function booleanValue($value)
    {
        if (is_bool($value)) {
            return $value;
        }

        if (is_numeric($value)) {
            return (Boolean) $value;
        }

        return in_array(strtolower($value),  [ 'true', 't', 'y', 'yes' ], true);
    }
696420
public static boolean toBoolean(String value, boolean defaultValue)
    {
        return "true".equals(value) ? true : ("false".equals(value) ? false : defaultValue);
    }
1062370
protected function isCurrencyValid($currencyValue)
    {
        $availableCurrencies = $this->facade->getAvailableCurrencies();
        /** @var Currency $currency */
        $currencyFound = false;
        foreach ($availableCurrencies as $currency) {
            if ($currencyValue == $currency->getCode()) {
                $currencyFound = true;
            }
        }
        if (!$currencyFound) {
            throw new InvalidConditionValueException(
                \get_class(),
                'currency'
            );
        }

        return true;
    }
198223
public static Boolean toBool(Object value, Boolean defaultValue) {
		return convert(Boolean.class, value, defaultValue);
	}
179232
public function checkCondition(Value $value)
    {
        if ($this->compareType($value) && $value->getValue() == $this->getValue()->getValue()) {
            return true;
        }

        return false;
    }
363675
public boolean get(boolean defaultValue)
    {
        final String value =
            getInternal(
                Boolean.toString(defaultValue),
                false);
        if (value == null) {
            return defaultValue;
        }
        return toBoolean(value);
    }
967318
public static function checkboxValue2Boolean($checkboxValue)
    {
        $mapping = [
            'on'  => true,
            'off' => false,
        ];

        $clearValue = strtolower(trim($checkboxValue));

        if (isset($mapping[$clearValue])) {
            return $mapping[$clearValue];
        }

        return false;
    }
948503
public function parseBooleanValue($value)
    {
        if (is_bool($value)) {
            return $value;
        }
        switch (strtolower($value)) {
            case 'true':
                return true;
            case 'false':
                return false;
        }

        throw new RuntimeException("Unknown boolean value '{$value}'.");
    }
27722
public function isValidItem($mixValue){
		if(is_object($mixValue)){
			if($this->hasOption('max')){
				if(count($this->mixValue)>=$this->options()->max){
					throw new MaxException($this->options()->max);
					return false;
				}
			}

			if($this->hasOption('class')){
				$strClass = $this->options()->class;
				if(!$mixValue instanceof $strClass){
					throw new ClassException($mixValue, $this->options()->class);
					return false;
				}
			}
			return true;
		}
		return false;
	}
462635
public function isValid($mixValue){
		if(is_null($mixValue)){
			return true;
		}

		if(is_object($mixValue)){
			if($mixValue instanceof \DateTime){
				return true;
			}else{
				throw new ClassException($mixValue, '\DateTime');
				return false;
			}
		}

		if(is_string($mixValue)){
			try{
				$objTest = new \DateTime($mixValue);
				return true;
			}catch (\Exception $e){
				throw new TypeException($mixValue, get_class($this));
			}
		}

		return false;
	}
238472
protected function toBoolean($value)
    {
        if ($value === 1 || $value === 'true') {
            return true;
        }
        if (is_null($value) || $value === 0 || $value === 'false') {
            return false;
        }
        if ($this->getTypeCheck()->isArray($value) && count($value) === 1) {
            return $this->toBoolean(reset($value));
        }

        return $value;
    }