mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
3f920f2c01
Removes verbose documentation while preserving type annotations.
24 lines
589 B
PHP
24 lines
589 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Flasher\Prime\Stamp;
|
|
|
|
final readonly class PresenterStamp implements StampInterface
|
|
{
|
|
/**
|
|
* @throws \InvalidArgumentException
|
|
*/
|
|
public function __construct(private string $pattern)
|
|
{
|
|
if (false === @preg_match($pattern, '')) {
|
|
throw new \InvalidArgumentException(\sprintf("The provided regex pattern '%s' is invalid for the presenter stamp. Please ensure it is a valid regex expression.", $pattern));
|
|
}
|
|
}
|
|
|
|
public function getPattern(): string
|
|
{
|
|
return $this->pattern;
|
|
}
|
|
}
|