• 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

75.0
/src/Ast/ParameterNode.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace DoclerLabs\ApiClientGenerator\Ast;
6

7
use PhpParser\Node\Expr;
8
use PhpParser\Node\NullableType;
9
use PhpParser\Node\Param;
10
use PhpParser\Node\UnionType;
11
use Stringable;
12

13
class ParameterNode extends Param
14
{
15
    public function __construct(
16
        $var,
17
        Expr $default = null,
18
        $type = null,
19
        int $flags = 0,
20
        bool $byRef = false,
21
        bool $variadic = false,
22
        array $attributes = [],
23
        protected string $docBlockType = ''
24
    ) {
25
        parent::__construct($var, $default, $type, $byRef, $variadic, $attributes, $flags);
1✔
26
    }
1✔
27

28
    public function getDocBlockType(): string
29
    {
30
        if ($this->docBlockType !== '') {
1✔
31
            return $this->docBlockType;
1✔
32
        }
33

34
        if ($this->type instanceof UnionType) {
1✔
NEW
35
            return implode('|', (array)$this->type->getAttribute('types'));
×
36
        }
37

38
        if ($this->type instanceof NullableType) {
1✔
39
            return sprintf('%s|null', $this->type->type->toString());
×
40
        }
41

42
        if (
43
            $this->type !== null
1✔
44
            && $this->type instanceof Stringable
1✔
45
        ) {
46
            return (string)$this->type;
1✔
47
        }
48

49
        return '';
×
50
    }
51
}
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