<?php

declare(strict_types=1);

namespace App\Framework\Cache\Compression;

use App\Framework\Cache\CompressionAlgorithm;

/**
 * No-operation compression algorithm that performs no compression
 *
 * This implements the Null Object Pattern for compression,
 * allowing the cache system to work without null checks.
 */
final readonly class NoCompression implements CompressionAlgorithm
{
    public function compress(string $value, bool $forceCompression = false): string
    {
        // No compression - return value unchanged
        return $value;
    }

    public function decompress(string $value): string
    {
        // No decompression needed - return value unchanged
        return $value;
    }

    public function isCompressed(string $value): bool
    {
        // Values are never compressed with this algorithm
        return false;
    }
}
