public static function checkCompatibility()

in src/Apache/Ignite/Internal/Binary/BinaryUtils.php [48:67]


    public static function checkCompatibility($value, $type): void
    {
        if (!$type) {
            return;
        }
        $typeCode = BinaryUtils::getTypeCode($type);
        if ($value === null) {
            if (!TypeInfo::getTypeInfo($typeCode)->isNullable()) {
                BinaryUtils::typeCastError(ObjectType::NULL, $typeCode);
            }
            return;
        } elseif (BinaryUtils::isStandardType($typeCode)) {
            BinaryUtils::checkStandardTypeCompatibility($value, $typeCode, $type);
            return;
        }
        $valueTypeCode = BinaryUtils::getTypeCode(BinaryUtils::calcObjectType($value));
        if ($typeCode !== $valueTypeCode) {
            BinaryUtils::typeCastError($valueTypeCode, $typeCode);
        }
    }