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

nikic / PHP-Parser / 18631674169

19 Oct 2025 02:18PM UTC coverage: 92.375% (-0.2%) from 92.539%
18631674169

Pull #1113

github

web-flow
Merge 86a87b02d into 0105ba17b
Pull Request #1113: add ContaintsStmts interface to mark stmt classes with nested stmts inside

2 of 17 new or added lines in 14 files covered. (11.76%)

19 existing lines in 1 file now uncovered.

7681 of 8315 relevant lines covered (92.38%)

226.1 hits per line

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

62.5
/lib/PhpParser/Node/Stmt/Namespace_.php
1
<?php declare(strict_types=1);
2

3
namespace PhpParser\Node\Stmt;
4

5
use PhpParser\Node;
6

7
class Namespace_ extends Node\Stmt implements Node\ContainsStmts {
8
    /* For use in the "kind" attribute */
9
    public const KIND_SEMICOLON = 1;
10
    public const KIND_BRACED = 2;
11

12
    /** @var null|Node\Name Name */
13
    public ?Node\Name $name;
14
    /** @var Node\Stmt[] Statements */
15
    public $stmts;
16

17
    /**
18
     * Constructs a namespace node.
19
     *
20
     * @param null|Node\Name $name Name
21
     * @param null|Node\Stmt[] $stmts Statements
22
     * @param array<string, mixed> $attributes Additional attributes
23
     */
24
    public function __construct(?Node\Name $name = null, ?array $stmts = [], array $attributes = []) {
25
        $this->attributes = $attributes;
50✔
26
        $this->name = $name;
50✔
27
        $this->stmts = $stmts;
50✔
28
    }
29

30
    public function getSubNodeNames(): array {
31
        return ['name', 'stmts'];
34✔
32
    }
33

34
    public function getType(): string {
35
        return 'Stmt_Namespace';
31✔
36
    }
37

38
    /**
39
     * @return Node\Stmt[]
40
     */
41
    public function getStmts(): array {
NEW
42
        if ($this->stmts === null) {
×
NEW
43
            return [];
×
44
        }
45

NEW
46
        return $this->stmts;
×
47
    }
48
}
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