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

JBZoo / Composer-Diff / 6408983532

16 Aug 2023 06:22PM UTC coverage: 94.294%. Remained the same
6408983532

push

github

web-flow
Upgrade `jbzoo/cli:^7.1.1` (#26)

1 of 1 new or added line in 1 file covered. (100.0%)

314 of 333 relevant lines covered (94.29%)

49.24 hits per line

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

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

3
/**
4
 * JBZoo Toolbox - Composer-Diff.
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/Composer-Diff
13
 */
14

15
declare(strict_types=1);
16

17
namespace JBZoo\ComposerDiff;
18

19
use function JBZoo\Data\data;
20

21
final class ComposerLock
22
{
23
    /** @var Package[] */
24
    private array $listRequired = [];
25

26
    /** @var Package[] */
27
    private array $listRequiredDev = [];
28

29
    public function __construct(array $composerLockData)
30
    {
31
        $data = data($composerLockData);
108✔
32

33
        foreach ($data->getArray('packages') as $packageData) {
108✔
34
            $package = new Package($packageData);
108✔
35

36
            $this->listRequired[$package->getName()] = $package;
108✔
37
        }
38

39
        foreach ($data->getArray('packages-dev') as $packageData) {
108✔
40
            $package = new Package($packageData);
56✔
41

42
            $this->listRequiredDev[$package->getName()] = $package;
56✔
43
        }
44
    }
45

46
    /**
47
     * @return Package[]
48
     */
49
    public function getRequired(): array
50
    {
51
        return $this->listRequired;
108✔
52
    }
53

54
    /**
55
     * @return Package[]
56
     */
57
    public function getRequiredDev(): array
58
    {
59
        return $this->listRequiredDev;
108✔
60
    }
61
}
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