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

devnix / belfiore-code / 18655299025

20 Oct 2025 02:28PM UTC coverage: 11.696% (-0.4%) from 12.048%
18655299025

push

github

devnix
refactor RegionCollection

0 of 7 new or added lines in 1 file covered. (0.0%)

20 of 171 relevant lines covered (11.7%)

0.98 hits per line

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

0.0
/src/Collection/RegionCollection.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * (c) Pablo Largo Mohedano <devnix.code@gmail.com>
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10

11
namespace Devnix\BelfioreCode\Collection;
12

13
class RegionCollection extends AbstractCollection
14
{
15
    protected const JSON_PATH = __DIR__.'/../../dist/regions.json';
16

17
    public function __construct(?array $elements = null)
×
18
    {
19
        if (null === $elements) {
×
NEW
20
            $rawJson = file_get_contents(self::JSON_PATH);
×
21

NEW
22
            if (false === $rawJson) {
×
NEW
23
                throw new \RuntimeException('Unexpected error when reading '.self::JSON_PATH);
×
24
            }
25

NEW
26
            $elements = json_decode(
×
NEW
27
                $rawJson,
×
NEW
28
                flags: \JSON_OBJECT_AS_ARRAY,
×
NEW
29
            );
×
30
        }
31

32
        parent::__construct($elements);
×
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

© 2026 Coveralls, Inc