for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Cerbero\JsonParser\Decoders;
/**
* The decoder using the simdjson extension.
*
*/
final class SimdjsonDecoder extends AbstractDecoder
{
* Instantiate the class.
* @param bool $decodesToArray
* @param int $depth
public function __construct(private readonly bool $decodesToArray = true, private readonly int $depth = 512)
}
* Retrieve the decoded value of the given JSON
* @param string $json
* @return mixed
* @throws \Throwable
protected function decodeJson(string $json): mixed
return simdjson_decode($json, $this->decodesToArray, $this->depth);
simdjson_decode
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
return /** @scrutinizer ignore-call */ simdjson_decode($json, $this->decodesToArray, $this->depth);