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

nikic / PHP-Parser / 18712471845

22 Oct 2025 09:57AM UTC coverage: 92.375% (-0.2%) from 92.54%
18712471845

Pull #1113

github

web-flow
Merge 2a2622abf into 3a454ca03
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%)

16 existing lines in 14 files 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

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

3
namespace PhpParser\Node\Stmt;
4

5
use PhpParser\Node;
6

7
class For_ extends Node\Stmt implements Node\ContainsStmts {
8
    /** @var Node\Expr[] Init expressions */
9
    public array $init;
10
    /** @var Node\Expr[] Loop conditions */
11
    public array $cond;
12
    /** @var Node\Expr[] Loop expressions */
13
    public array $loop;
14
    /** @var Node\Stmt[] Statements */
15
    public array $stmts;
16

17
    /**
18
     * Constructs a for loop node.
19
     *
20
     * @param array{
21
     *     init?: Node\Expr[],
22
     *     cond?: Node\Expr[],
23
     *     loop?: Node\Expr[],
24
     *     stmts?: Node\Stmt[],
25
     * } $subNodes Array of the following optional subnodes:
26
     *             'init'  => array(): Init expressions
27
     *             'cond'  => array(): Loop conditions
28
     *             'loop'  => array(): Loop expressions
29
     *             'stmts' => array(): Statements
30
     * @param array<string, mixed> $attributes Additional attributes
31
     */
32
    public function __construct(array $subNodes = [], array $attributes = []) {
33
        $this->attributes = $attributes;
11✔
34
        $this->init = $subNodes['init'] ?? [];
11✔
35
        $this->cond = $subNodes['cond'] ?? [];
11✔
36
        $this->loop = $subNodes['loop'] ?? [];
11✔
37
        $this->stmts = $subNodes['stmts'] ?? [];
11✔
38
    }
39

40
    public function getSubNodeNames(): array {
41
        return ['init', 'cond', 'loop', 'stmts'];
10✔
42
    }
43

44
    public function getType(): string {
45
        return 'Stmt_For';
11✔
46
    }
47

48
    /**
49
     * @return Node\Stmt[]
50
     */
51
    public function getStmts(): array {
NEW
UNCOV
52
        return $this->stmts;
×
53
    }
54
}
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