respect-validation/src/Message/Parameters/NameHandler.php
Henrique Moody 140bd36aa3
Rename library/ to src/
We've always considered renaming this directory, as it's not a common
standard to name `library` the directory where the source code of a
library it. Having it as `src/` is a common pattern we find in several
PHP libraries these days.

Acked-by: Alexandre Gomes Gaigalas <alganet@gmail.com>
2026-01-22 13:13:15 +01:00

26 lines
545 B
PHP

<?php
/*
* SPDX-License-Identifier: MIT
* SPDX-FileCopyrightText: (c) Respect Project Contributors
* SPDX-FileContributor: Henrique Moody <henriquemoody@gmail.com>
*/
declare(strict_types=1);
namespace Respect\Validation\Message\Parameters;
use Respect\Stringifier\Handler;
use Respect\Validation\Name;
final readonly class NameHandler implements Handler
{
public function handle(mixed $raw, int $depth): string|null
{
if (!$raw instanceof Name) {
return null;
}
return $raw->value;
}
}