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

DoclerLabs / api-client-generator / 7199039449

13 Dec 2023 05:42PM UTC coverage: 89.612% (-0.4%) from 90.043%
7199039449

Pull #102

github

vsouz4
stan
Pull Request #102: generator php 8

355 of 385 new or added lines in 40 files covered. (92.21%)

6 existing lines in 4 files now uncovered.

2657 of 2965 relevant lines covered (89.61%)

3.34 hits per line

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

85.71
/src/Entity/OperationCollection.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace DoclerLabs\ApiClientGenerator\Entity;
6

7
use ArrayIterator;
8
use DoclerLabs\ApiClientGenerator\Input\InvalidSpecificationException;
9
use IteratorAggregate;
10

11
class OperationCollection implements IteratorAggregate
12
{
13
    protected array $items = [];
14

15
    protected array $operationNames = [];
16

17
    public function add(Operation $item): self
18
    {
19
        if (isset($this->operationNames[$item->name])) {
2✔
NEW
20
            throw new InvalidSpecificationException('Duplicated operationId found: ' . $item->name);
×
21
        }
22

23
        $this->items[]                     = $item;
2✔
24
        $this->operationNames[$item->name] = true;
2✔
25

26
        return $this;
2✔
27
    }
28

29
    public function toArray(): array
30
    {
31
        return $this->items;
2✔
32
    }
33

34
    /**
35
     * @return ArrayIterator|Operation[]
36
     */
37
    public function getIterator(): ArrayIterator
38
    {
39
        return new ArrayIterator($this->toArray());
2✔
40
    }
41
}
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