Retype raw INI value into `bool`, `NULL` or `string`.
@param string $rawValue
@return bool|NULL|string
422386
protected function getTypedSpecialValueOrString ($rawValue) {
		$lowerRawValue = strtolower($rawValue);
		if (isset(static::$specialValues[$lowerRawValue])) {
			return static::$specialValues[$lowerRawValue]; // bool or null
		} else {
			return trim($rawValue); // string
		}
	}
75019
public static function literal($mixColValue)
    {
        if (is_null($mixColValue)) {
            return 'null';
        } elseif (is_integer($mixColValue)) {
            return $mixColValue;
        } elseif (is_bool($mixColValue)) {
            return ($mixColValue ? 'true' : 'false');
        } elseif (is_float($mixColValue)) {
            return "(float)$mixColValue";
        } elseif (is_object($mixColValue)) {
            return "t('" . $mixColValue->_toString() . "')";
        }    // whatever is suitable for the constructor of the object
        else {
            return "t('" . str_replace("'", "\\'", $mixColValue) . "')";
        }
    }
810111
public static function getKey($enumValue = '')
    {
        foreach (self::all() as $key => $value) {
            if (strtolower($value) == strtolower($enumValue)) {
                return $key;
            }
        }

        return null;
    }
1319486
public function setStringValue($stringValue)
    {
        if (\is_array($stringValue) || \is_object($stringValue)) {
            $m = "Invalid value type for attribute {$this->getFamilyCode()}.{$this->getAttributeCode()}, ";
            $m .= 'expecting string, got '.gettype($stringValue);
            throw new \UnexpectedValueException($m);
        }
        if (null !== $stringValue && 255 < \mb_strlen($stringValue)) {
            $stringValue = mb_substr($stringValue, 0, 255);
        }
        $this->stringValue = null === $stringValue ? null : (string) $stringValue;

        return $this;
    }
639507
private function escape($colValue, $colType)
    {
        if (is_null($colValue)) {
            return "NULL";
        } elseif ($this->dumpSettings['hex-blob'] && $colType['is_blob']) {
            if ($colType['type'] == 'bit' || !empty($colValue)) {
                return "0x${colValue}";
            } else {
                return "''";
            }
        } elseif ($colType['is_numeric']) {
            return $colValue;
        }

        return $this->dbHandler->quote($colValue);
    }
841286
public function decodeVendorSpecificContent($rawValue)
    {
        $result   = array();
        $offset   = 0;
        $vendorId = (ord(substr($rawValue, 0, 1)) * 256 * 256 * 256) +
                    (ord(substr($rawValue, 1, 1)) * 256 * 256) +
                    (ord(substr($rawValue, 2, 1)) * 256) +
                     ord(substr($rawValue, 3, 1));

        $offset += 4;
        while ($offset < strlen($rawValue)) {
            $vendorType        = (ord(substr($rawValue, 0 + $offset, 1)));
            $vendorLength      = (ord(substr($rawValue, 1 + $offset, 1)));
            $attributeSpecific = substr($rawValue, 2 + $offset, $vendorLength);
            $result[]          = array($vendorId, $vendorType, $attributeSpecific);
            $offset           += $vendorLength;
        }

        return $result;
    }
160524
public function getValue(bool $urldecoded = true) : string
    {
        return (($urldecoded === true) ? rawurldecode($this->value) : $this->value);
    }
29946
protected function CleanAndBuildConstantKeyValue($rawValue, $valueToTrim) {
        $valueCleaned = $this->RemoveExtensionFileName($rawValue, $valueToTrim);
        return $this->BuildConstantKeyValue($valueCleaned);
    }
1183444
public function normalizeValue($type, $value)
    {
        if ($value === null) {
            return null;
        }

        if ($type === 'string') {
            return is_string($value) ? $value : (string)$value;
        } elseif ($type === 'int') {
            return is_int($value) ? $value : (int)$value;
        } elseif ($type === 'float') {
            return is_float($value) ? $value : (float)$value;
        } elseif ($type === 'objectid') {
            return is_scalar($type) ? new ObjectID($value) : $value;
        } elseif ($type === 'bool') {
            return is_bool($value) ? $value : (bool)$value;
        } elseif ($type === 'array') {
            return (array)$value;
        } else {
            throw new InvalidValueException(['`:model` model is not supported `:type` type', 'model' => static::class, 'type' => $type]);
        }
    }
468305
public static function TRIMNONPRINTABLE($stringValue = '') {
		$stringValue	= PHPExcel_Calculation_Functions::flattenSingleValue($stringValue);

		if (is_bool($stringValue)) {
			return ($stringValue) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
		}

		if (self::$_invalidChars == Null) {
			self::$_invalidChars = range(chr(0),chr(31));
		}

		if (is_string($stringValue) || is_numeric($stringValue)) {
			return str_replace(self::$_invalidChars,'',trim($stringValue,"\x00..\x1F"));
		}
		return NULL;
	}
77650
public static function iniSet($varName, $newValue)
    {
        if (self::isFunc('ini_set')) {
            return Filter::bool(ini_set($varName, $newValue));
        }

        return null; // @codeCoverageIgnore
    }
1315766
protected function validator($inputValue)
    {
        if ('' === $inputValue) {
            if ($this->mandatory) {
                $this->addError(
                    $this->getEnvironment()->getTranslator()->translate('mandatory', 'ERR', [$this->strLabel])
                );
            }

            return '';
        }

        $inputValue = \array_map('\Contao\StringUtil::uuidToBin', \array_filter(\explode(',', $inputValue)));

        return $this->multiple ? $inputValue : $inputValue[0];
    }
50898
public function getValue($nullValue = null, $calculateFormulas = false, $formatData = true)
    {
        $value = $nullValue;
        if ($this->cell->getValue() !== null) {
            if ($this->cell->getValue() instanceof RichText) {
                $value = $this->cell->getValue()->getPlainText();
            } elseif ($calculateFormulas) {
                $value = $this->cell->getCalculatedValue();
            } else {
                $value = $this->cell->getValue();
            }

            if ($formatData) {
                $style = $this->cell->getWorksheet()->getParent()->getCellXfByIndex($this->cell->getXfIndex());
                $value = NumberFormat::toFormattedString(
                    $value,
                    ($style && $style->getNumberFormat()) ? $style->getNumberFormat()->getFormatCode() : NumberFormat::FORMAT_GENERAL
                );
            }
        }

        return $value;
    }
195464
public static Boolean toBooleanObject(String str, Boolean defaultValue) {
		return str != null ? Boolean.valueOf(str) : defaultValue;
	}
1071782
protected function convertValue($propertyValue, $dataType)
    {
        $parsedType = TypeHandling::parseType($dataType);

        // This hardcoded handling is to circumvent rewriting PropertyMappers that convert objects. Usually they expect the source to be an object already and break if not.
        if (!TypeHandling::isSimpleType($parsedType['type']) && !is_object($propertyValue) && !is_array($propertyValue)) {
            return null;
        }

        $conversionTargetType = $parsedType['type'];
        if (!TypeHandling::isSimpleType($parsedType['type'])) {
            $conversionTargetType = 'array';
        }
        // Technically the "string" hardcoded here is irrelevant as the configured type converter wins, but it cannot be the "elementType"
        // because if the source is of the type $elementType then the PropertyMapper skips the type converter.
        if ($parsedType['type'] === 'array' && $parsedType['elementType'] !== null) {
            $conversionTargetType .= '<' . (TypeHandling::isSimpleType($parsedType['elementType']) ? $parsedType['elementType'] : 'string') . '>';
        }

        $propertyMappingConfiguration = $this->createConfiguration($dataType);
        $convertedValue = $this->propertyMapper->convert($propertyValue, $conversionTargetType, $propertyMappingConfiguration);
        if ($convertedValue instanceof \Neos\Error\Messages\Error) {
            throw new PropertyException($convertedValue->getMessage(), $convertedValue->getCode());
        }

        return $convertedValue;
    }
1209206
public function parseDateTime($rawValue) {
		if (null === $rawValue) return null;
		
		try {
			return DateUtils::createDateTimeFromFormat(MssqlDateTimeColumn::generateFormatBuildRawValue(
							MssqlDateTimeColumn::FORMAT_BUILD_TYPE_PARSE, true, true, self::COLUMN_TYPE_PRECISION, false),
					$rawValue);
		} catch (\n2n\util\DateParseException $e) {
			throw new \InvalidArgumentException($e->getMessage(), 0, $e);
		}
	}
967992
protected function getDefaultValueForSet($stringValue)
    {
        $stringValue = trim($stringValue);

        if (empty($stringValue)) {
            return null;
        }

        $values = [];
        foreach (explode(',', $stringValue) as $v) {
            $values[] = trim($v);
        }
        if (count($values) === 0) {
            return null;
        }
        return $values;
    }