Infer the QTI baseType of a given $value.

@param mixed $value A value you want to know the QTI baseType.
@return integer|false A value from the BaseType enumeration or false if the baseType could not be infered.
517264
static public function inferBaseType($value)
    {
        if ($value === null) {
            return false;
        } elseif ($value instanceof RecordContainer) {
            return false;
        } elseif ($value instanceof QtiDatatype) {
            return $value->getBaseType();
        } else {
            return false;
        }
    }
267191
private function getValueType($value)
    {
        if (is_string($value))
            return 'string';
        if (is_bool($value))
            return 'bool';
        if (is_float($value))
            return 'float';
        if (is_numeric($value))
            return 'int';
        if (is_array($value))
            return 'array';
        return 'mixed';
    }
450467
public function isValueValid($value) {
		return $value instanceof Type\QualitativeValueType || $value instanceof DataType\TextType || $value instanceof DataType\URLType;
	}
428391
private function getTypedValue(string $value)
    {
        if (\in_array($value, self::$boolValues, true)) {
            return \in_array($value, self::$truthlyValues, true);
        }

        if (\is_numeric($value)) {
            return $this->getNumericValue($value);
        }

        return $value;
    }
88742
public function isAssignableFromValue($value)
    {
        switch ($this->name)
        {
            case self::INTEGER_NAME:
                return is_int($value);
            case self::FLOAT_NAME:
                return is_float($value);
            case self::STRING_NAME:
                return is_string($value);
            case self::BOOLEAN_NAME:
                return is_bool($value);
            case self::MIXED_NAME:
                return true;
            case self::RESOURCE_NAME:
                return is_resource($value);
            case self::OBJECT_NAME:
                return is_object($value);
            case self::NULL_NAME:
                return is_null($value);
            case self::CALLABLE_NAME:
                return is_callable($value);
            default:
                throw new Exception("Implementation error");
        }
    }
370482
public function isValueValid($value) {
		return $value instanceof Type\Enumeration || $value instanceof Type\PropertyValue || $value instanceof Type\QualitativeValue || $value instanceof Type\QuantitativeValue || $value instanceof Type\StructuredValue;
	}
286665
public static function GetNativeType( $value )
   {

      if ( \is_string( $value ) )
      {
         return Type::PHP_STRING;
      }

      if ( \is_int( $value ) )
      {
         return Type::PHP_INTEGER;
      }

      if ( \is_bool( $value ) )
      {
         return Type::PHP_BOOLEAN;
      }

      if ( \is_double( $value ) )
      {
         return Type::PHP_DOUBLE;
      }

      if ( \is_float( $value ) )
      {
         return Type::PHP_FLOAT;
      }

      return false;

   }
5120
private function isValidType($value): bool
    {
        if ($this->type instanceof DataType) {
            return $this->type->isTheTypeOf($value);
        }

        return true;
    }
843711
private static function isSimpleType($value, string $type): ?bool
    {
        switch ($type) {
            case 'array':
                return static::isArray($value);
                break;
            case 'object':
                return static::isObject($value);
                break;
            case 'bool':
                return static::isBool($value);
                break;
            case 'int':
                return static::isInt($value);
                break;
            case 'float':
                return static::isFloat($value);
                break;
            case 'string':
                return static::isString($value);
                break;
            case 'callable':
                return static::isCallable($value);
                break;
            default:
                break;
        }

        return null;
    }
652041
public static function trasferTypes($type, $value)
    {
        if ($value === null) {
            $value = null;
        } elseif ($type === Types::INT || $type === Types::NUMBER) {
            $value = (int)$value;
        } elseif ($type === Types::STRING) {
            $value = null === $value ? null : (string)$value;
        } elseif ($type === Types::BOOLEAN) {
            $value = (bool)$value;
        } elseif ($type === Types::FLOAT) {
            $value = (float)$value;
        }

        return $value;
    }
1164582
private function isPrimitive($value): bool {
		return (is_string($value)
			|| is_int($value)
			|| is_float($value)
			|| is_bool($value)
			|| is_null($value)
			|| ($value instanceof PhpConstant));
	}
527349
protected function checkValueStructure(BaseValue $value)
    {
        if (!$value instanceof Value) {
            throw new InvalidArgumentType(
                '$value',
                'eZ\\Publish\\Core\\FieldType\\Checkbox\\Value',
                $value
            );
        }

        if (!is_bool($value->bool)) {
            throw new InvalidArgumentType(
                '$value->bool',
                'boolean',
                $value->bool
            );
        }
    }
465368
public function isValueValid($value) {
		return $value instanceof Type\EnumerationType || $value instanceof Type\PropertyValueType || $value instanceof Type\QualitativeValueType || $value instanceof Type\QuantitativeValueType || $value instanceof Type\StructuredValueType;
	}
376040
public function isValueValid($value) {
		return $value instanceof DataType\NumberType || $value instanceof Type\PriceSpecification || $value instanceof DataType\TextType;
	}
548898
public function int($value)
    {
        if ($this->notBeEmpty($value)) {
            if (is_int($value)) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
696725
private function isType(string $type, $value)
    {
        switch ($type) {
            case 'bool':
                return is_bool($value);

            case 'int':
                return is_int($value);

            case 'float':
                return is_float($value) || is_int($value);

            case 'string':
                return is_string($value);

            case 'array':
                return is_array($value);

            default:
                throw new InvalidParamsException('Type match error');
        }
    }
239416
protected function getValueType($value)
    {
        switch (true) {
            case is_scalar($value):
                $type = gettype($value);
                break;

            case is_array($value):
                $type = 'array';
                break;

            case is_object($value):
                $type = get_class($value);
                break;

            case is_resource($value):
                $type = 'resource';
                break;

            default:
                $type = 'unknown';
                break;
        }

        return $type;
    }