Lines 0.00% 0 / 2
Functions and Methods 0.00% 0 / 2
Classes and Traits 0.00% 0 / 1
Name Lines Functions and Methods CRAP Classes and Traits
JsonDecoder 0.00% 0 / 2 0.00% 0 / 2 6 0.00% 0 / 1
 __construct 0.00% 0 / 1 0.00% 0 / 1 2
 decodeJson 0.00% 0 / 1 0.00% 0 / 1 2
1<?php
2
3declare(strict_types=1);
4
5namespace Stewart\Support\Json;
6
7use JsonException;
8
9/** @internal */
10final class JsonDecoder
11{
12    private function __construct() {}
13
14    /**
15     * @param int<1, max> $depth
16     * @throws JsonException
17     */
18    public static function decodeJson(string $json, int $depth = 512): mixed
19    {
20        return json_decode($json, true, $depth, \JSON_THROW_ON_ERROR);
21    }
22}