Submit
Path:
~
/
/
usr
/
local
/
psa
/
admin
/
plib
/
modules
/
wp-toolkit
/
vendor
/
cerbero
/
json-parser
/
src
/
Decoders
/
File Content:
ConfigurableDecoder.php
<?php namespace WPToolkitDependenciesIsolationPrefix\Cerbero\JsonParser\Decoders; use WPToolkitDependenciesIsolationPrefix\Cerbero\JsonParser\Tokens\Parser; use WPToolkitDependenciesIsolationPrefix\Cerbero\JsonParser\ValueObjects\Config; /** * The configurable decoder. * */ final class ConfigurableDecoder { /** * Instantiate the class. * * @param Config $config */ public function __construct(private readonly Config $config) { } /** * Decode the given value. * * @param Parser|string|int $value * @return mixed */ public function decode(Parser|string|int $value) : mixed { if (!\is_string($value)) { return $value; } $decoded = $this->config->decoder->decode($value); if (!$decoded->succeeded) { ($this->config->onDecodingError)($decoded); } return $decoded->value; } }
Submit
FILE
FOLDER
INFO
Name
Size
Permission
Action
AbstractDecoder.php
808 bytes
0644
ConfigurableDecoder.php
927 bytes
0644
DecodedValue.php
1036 bytes
0644
Decoder.php
313 bytes
0644
JsonDecoder.php
754 bytes
0644
SimdjsonDecoder.php
728 bytes
0644
N4ST4R_ID | Naxtarrr