0 follower

Final Class Yiisoft\HttpMiddleware\HttpCache\ETagGenerator\CallableETagGenerator

InheritanceYiisoft\HttpMiddleware\HttpCache\ETagGenerator\CallableETagGenerator
ImplementsYiisoft\HttpMiddleware\HttpCache\ETagGenerator\ETagGeneratorInterface

Generates a string ETag value using a callable function.

Psalm Types

Name Value
TCallable callable

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( callable $callable )
$callable callable

A callable function that takes a string seed and returns a string ETag value.

                public function __construct(callable $callable)
{
    $this->callable = $callable;
}

            
generate() public method

public string generate ( string $seed )
$seed string

                public function generate(string $seed): string
{
    return ($this->callable)($seed);
}