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

api-platform / schema-generator / 3687596867

pending completion
3687596867

push

github

GitHub
feat(openapi): improve type detection (#399)

166 of 166 new or added lines in 23 files covered. (100.0%)

1656 of 2107 relevant lines covered (78.6%)

15.83 hits per line

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

42.86
/src/Model/Type/ArrayType.php
1
<?php
2

3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <dunglas@gmail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types=1);
13

14
namespace ApiPlatform\SchemaGenerator\Model\Type;
15

16
final class ArrayType implements Type
17
{
18
    public ?Type $type;
19

20
    public function __construct(?Type $type = null)
21
    {
22
        $this->type = $type;
18✔
23
    }
24

25
    public function __toString(): string
26
    {
27
        if ($this->type instanceof CompositeType) {
×
28
            return '('.$this->type.')[]';
×
29
        }
30

31
        return $this->type ? $this->type.'[]' : 'array';
×
32
    }
33

34
    public function getPhp(): string
35
    {
36
        if ($this->type instanceof CompositeType) {
6✔
37
            return '('.$this->type.')[]';
×
38
        }
39

40
        return $this->type ? $this->type.'[]' : 'array';
6✔
41
    }
42
}
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