Submit
Path:
~
/
/
usr
/
local
/
psa
/
admin
/
plib
/
modules
/
wp-toolkit
/
vendor
/
cerbero
/
json-parser
/
src
/
Decoders
/
File Content:
AbstractDecoder.php
<?php namespace WPToolkitDependenciesIsolationPrefix\Cerbero\JsonParser\Decoders; use Throwable; /** * The abstract implementation of a JSON decoder. * */ abstract class AbstractDecoder implements Decoder { /** * Retrieve the decoded value of the given JSON * * @param string $json * @return mixed * @throws Throwable */ protected abstract function decodeJson(string $json) : mixed; /** * Decode the given JSON. * * @param string $json * @return DecodedValue */ public function decode(string $json) : DecodedValue { try { $value = $this->decodeJson($json); } catch (Throwable $e) { return DecodedValue::failed($e, $json); } return DecodedValue::succeeded($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