heymoon-cc/php-vector-tile-data-provider

View on GitHub
src/Helper/EncodingHelper.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace HeyMoon\VectorTileDataProvider\Helper;

/**
 * @SuppressWarnings(PHPMD.StaticAccess)
 */
class EncodingHelper
{
    public static function getOriginalOrGZIP(string $data): bool|string
    {
        set_error_handler(fn() => null);
        $result = gzdecode($data) ?: $data;
        restore_error_handler();
        return $result;
    }
}