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

DoclerLabs / api-client-generator / 7259428899

19 Dec 2023 08:47AM UTC coverage: 89.733% (-0.3%) from 90.043%
7259428899

push

github

web-flow
Merge pull request #102 from DoclerLabs/generator-php-8

generator php 8

355 of 381 new or added lines in 40 files covered. (93.18%)

6 existing lines in 4 files now uncovered.

2657 of 2961 relevant lines covered (89.73%)

3.35 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

© 2025 Coveralls, Inc