• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

JBZoo / Data / 7796885268

28 Jan 2024 08:47AM UTC coverage: 98.958%. Remained the same
7796885268

push

github

web-flow
Add PHP 8.3 support and update dependencies in composer.json (#31)

190 of 192 relevant lines covered (98.96%)

38.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/JSON.php
1
<?php
2

3
/**
4
 * JBZoo Toolbox - Data.
5
 *
6
 * This file is part of the JBZoo Toolbox project.
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license    MIT
11
 * @copyright  Copyright (C) JBZoo.com, All rights reserved.
12
 * @see        https://github.com/JBZoo/Data
13
 */
14

15
declare(strict_types=1);
16

17
namespace JBZoo\Data;
18

19
final class JSON extends AbstractData
20
{
21
    protected function decode(string $string): mixed
22
    {
23
        /** @noinspection JsonEncodingApiUsageInspection */
24
        return \json_decode($string, true, 512, \JSON_BIGINT_AS_STRING);
102✔
25
    }
26

27
    protected function encode(array $data): string
28
    {
29
        $result = \json_encode($data, \JSON_THROW_ON_ERROR | \JSON_PRETTY_PRINT | \JSON_BIGINT_AS_STRING);
18✔
30

31
        // @phpstan-ignore-next-line
32
        return $result ?: '';
18✔
33
    }
34
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc