File tree Expand file tree Collapse file tree 13 files changed +237
-217
lines changed Expand file tree Collapse file tree 13 files changed +237
-217
lines changed Original file line number Diff line number Diff line change 1+ <?php declare (strict_types=1 );
2+ /*
3+ * This file is part of phpunit/php-code-coverage.
4+ *
5+ * (c) Sebastian Bergmann <sebastian@phpunit.de>
6+ *
7+ * For the full copyright and license information, please view the LICENSE
8+ * file that was distributed with this source code.
9+ */
10+ namespace SebastianBergmann \CodeCoverage \Data ;
11+
12+ final class ProcessedClassType
13+ {
14+ public function __construct (
15+ public string $ className ,
16+ public string $ namespace ,
17+ /**
18+ * @var array<string, ProcessedMethodType>
19+ */
20+ public array $ methods ,
21+ public int $ startLine ,
22+ public int $ executableLines ,
23+ public int $ executedLines ,
24+ public int $ executableBranches ,
25+ public int $ executedBranches ,
26+ public int $ executablePaths ,
27+ public int $ executedPaths ,
28+ public int $ ccn ,
29+ public float |int $ coverage ,
30+ public int |string $ crap ,
31+ public string $ link ,
32+ ) {
33+ }
34+ }
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types=1 );
2+ /*
3+ * This file is part of phpunit/php-code-coverage.
4+ *
5+ * (c) Sebastian Bergmann <sebastian@phpunit.de>
6+ *
7+ * For the full copyright and license information, please view the LICENSE
8+ * file that was distributed with this source code.
9+ */
10+ namespace SebastianBergmann \CodeCoverage \Data ;
11+
12+ final class ProcessedTraitType
13+ {
14+ public function __construct (
15+ public string $ traitName ,
16+ public string $ namespace ,
17+ /**
18+ * @var array<string, ProcessedMethodType>
19+ */
20+ public array $ methods ,
21+ public int $ startLine ,
22+ public int $ executableLines ,
23+ public int $ executedLines ,
24+ public int $ executableBranches ,
25+ public int $ executedBranches ,
26+ public int $ executablePaths ,
27+ public int $ executedPaths ,
28+ public int $ ccn ,
29+ public float |int $ coverage ,
30+ public int |string $ crap ,
31+ public string $ link ,
32+ ) {
33+ }
34+ }
Original file line number Diff line number Diff line change 1515use function str_replace ;
1616use function substr ;
1717use Countable ;
18+ use SebastianBergmann \CodeCoverage \Data \ProcessedClassType ;
1819use SebastianBergmann \CodeCoverage \Data \ProcessedFunctionType ;
20+ use SebastianBergmann \CodeCoverage \Data \ProcessedTraitType ;
1921use SebastianBergmann \CodeCoverage \StaticAnalysis \LinesOfCode ;
2022use SebastianBergmann \CodeCoverage \Util \Percentage ;
2123
2224/**
2325 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
24- *
25- * @phpstan-import-type ProcessedClassType from File
26- * @phpstan-import-type ProcessedTraitType from File
2726 */
2827abstract class AbstractNode implements Countable
2928{
@@ -186,7 +185,7 @@ public function cyclomaticComplexity(): int
186185 $ ccn = 0 ;
187186
188187 foreach ($ this ->classesAndTraits () as $ classLike ) {
189- $ ccn += $ classLike[ ' ccn ' ] ;
188+ $ ccn += $ classLike-> ccn ;
190189 }
191190
192191 foreach ($ this ->functions () as $ function ) {
Original file line number Diff line number Diff line change 1414use function count ;
1515use IteratorAggregate ;
1616use RecursiveIteratorIterator ;
17+ use SebastianBergmann \CodeCoverage \Data \ProcessedClassType ;
1718use SebastianBergmann \CodeCoverage \Data \ProcessedFunctionType ;
19+ use SebastianBergmann \CodeCoverage \Data \ProcessedTraitType ;
1820use SebastianBergmann \CodeCoverage \StaticAnalysis \LinesOfCode ;
1921
2022/**
2123 * @template-implements IteratorAggregate<int, AbstractNode>
2224 *
23- * @phpstan-import-type ProcessedClassType from File
24- * @phpstan-import-type ProcessedTraitType from File
25- *
2625 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
2726 */
2827final class Directory extends AbstractNode implements IteratorAggregate
You can’t perform that action at this time.
0 commit comments