-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor rule to exact file + line reporting (#19)
- Loading branch information
1 parent
374c504
commit 97532b3
Showing
23 changed files
with
161 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,5 +79,4 @@ parameters: | |
return_type: 50 | ||
param_type: 30 | ||
property_type: 70 | ||
print_suggestions: false | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace TomasVotruba\TypeCoverage; | ||
|
||
use TomasVotruba\TypeCoverage\ValueObject\TypeCountAndMissingTypes; | ||
|
||
final class CollectorDataNormalizer | ||
{ | ||
/** | ||
* @param mixed[] $collectorDataByPath | ||
*/ | ||
public function normalize(array $collectorDataByPath): TypeCountAndMissingTypes | ||
{ | ||
$totalCount = 0; | ||
|
||
$missingTypeLinesByFilePath = []; | ||
|
||
foreach ($collectorDataByPath as $filePath => $returnSeaLevelData) { | ||
foreach ($returnSeaLevelData as $nestedData) { | ||
$totalCount += $nestedData[0]; | ||
|
||
$missingTypeLinesByFilePath[$filePath] = array_merge( | ||
$missingTypeLinesByFilePath[$filePath] ?? [], | ||
$nestedData[1] | ||
); | ||
} | ||
} | ||
|
||
return new TypeCountAndMissingTypes($totalCount, $missingTypeLinesByFilePath); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.