|
9 | 9 | */ |
10 | 10 | namespace SebastianBergmann\CodeCoverage\Node; |
11 | 11 |
|
| 12 | +use SebastianBergmann\CodeCoverage\Data\ProcessedBranchCoverageData; |
| 13 | +use SebastianBergmann\CodeCoverage\Data\ProcessedPathCoverageData; |
12 | 14 | use function array_filter; |
13 | 15 | use function count; |
14 | 16 | use function range; |
@@ -664,33 +666,33 @@ private function newMethod(string $className, Method $method, string $link): arr |
664 | 666 |
|
665 | 667 | $key = $className . '->' . $method->name(); |
666 | 668 |
|
667 | | - if (isset($this->functionCoverageData[$key]['branches'])) { |
| 669 | + if (isset($this->functionCoverageData[$key])) { |
668 | 670 | $methodData['executableBranches'] = count( |
669 | | - $this->functionCoverageData[$key]['branches'], |
| 671 | + $this->functionCoverageData[$key]->branches, |
670 | 672 | ); |
671 | 673 |
|
672 | 674 | $methodData['executedBranches'] = count( |
673 | 675 | array_filter( |
674 | | - $this->functionCoverageData[$key]['branches'], |
675 | | - static function (array $branch) |
| 676 | + $this->functionCoverageData[$key]->branches, |
| 677 | + static function (ProcessedBranchCoverageData $branch) |
676 | 678 | { |
677 | | - return (bool) $branch['hit']; |
| 679 | + return (bool) $branch->hit; |
678 | 680 | }, |
679 | 681 | ), |
680 | 682 | ); |
681 | 683 | } |
682 | 684 |
|
683 | | - if (isset($this->functionCoverageData[$key]['paths'])) { |
| 685 | + if (isset($this->functionCoverageData[$key])) { |
684 | 686 | $methodData['executablePaths'] = count( |
685 | | - $this->functionCoverageData[$key]['paths'], |
| 687 | + $this->functionCoverageData[$key]->paths, |
686 | 688 | ); |
687 | 689 |
|
688 | 690 | $methodData['executedPaths'] = count( |
689 | 691 | array_filter( |
690 | | - $this->functionCoverageData[$key]['paths'], |
691 | | - static function (array $path) |
| 692 | + $this->functionCoverageData[$key]->paths, |
| 693 | + static function (ProcessedPathCoverageData $path) |
692 | 694 | { |
693 | | - return (bool) $path['hit']; |
| 695 | + return (bool) $path->hit; |
694 | 696 | }, |
695 | 697 | ), |
696 | 698 | ); |
|
0 commit comments