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

brick / structured-data / 17475567799

04 Sep 2025 08:14PM UTC coverage: 77.67%. Remained the same
17475567799

push

github

BenMorel
Apply coding standard

14 of 15 new or added lines in 5 files covered. (93.33%)

59 existing lines in 7 files now uncovered.

240 of 309 relevant lines covered (77.67%)

1.84 hits per line

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

85.71
/src/Reader/ReaderChain.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Brick\StructuredData\Reader;
6

7
use Brick\StructuredData\Reader;
8
use DOMDocument;
9
use Override;
10

11
use function array_merge;
12

13
/**
14
 * Chains several schema readers and returns the aggregate results.
15
 */
16
final class ReaderChain implements Reader
17
{
18
    /**
19
     * @var Reader[]
20
     */
21
    private readonly array $readers;
22

23
    /**
24
     * ReaderChain constructor.
25
     */
26
    public function __construct(Reader ...$readers)
27
    {
28
        $this->readers = $readers;
5✔
29
    }
30

31
    #[Override]
32
    public function read(DOMDocument $document, string $url): array
33
    {
34
        if (! $this->readers) {
5✔
UNCOV
35
            return [];
×
36
        }
37

38
        $items = [];
5✔
39

40
        foreach ($this->readers as $reader) {
5✔
41
            $items[] = $reader->read($document, $url);
5✔
42
        }
43

44
        return array_merge(...$items);
5✔
45
    }
46
}
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