@@ -23,13 +23,13 @@ final class ProcessResult
2323 */
2424 private int $ totalChanged ;
2525 /**
26- * @var string[]
26+ * @var array< string, string[]>
2727 */
2828 private array $ usedSkips = [];
2929 /**
3030 * @param SystemError[] $systemErrors
3131 * @param FileDiff[] $fileDiffs
32- * @param string[] $usedSkips
32+ * @param array< string, string[]> $usedSkips
3333 */
3434 public function __construct (array $ systemErrors , array $ fileDiffs , int $ totalChanged , array $ usedSkips = [])
3535 {
@@ -39,7 +39,10 @@ public function __construct(array $systemErrors, array $fileDiffs, int $totalCha
3939 $ this ->usedSkips = $ usedSkips ;
4040 Assert::allIsInstanceOf ($ systemErrors , SystemError::class);
4141 Assert::allIsInstanceOf ($ fileDiffs , FileDiff::class);
42- Assert::allString ($ usedSkips );
42+ Assert::allString (array_keys ($ usedSkips ));
43+ foreach ($ usedSkips as $ usedSkip ) {
44+ Assert::allString ($ usedSkip );
45+ }
4346 }
4447 /**
4548 * @return SystemError[]
@@ -71,19 +74,22 @@ public function addSystemErrors(array $systemErrors): void
7174 * their result from worker processes only. Merge those main-process marks back in, or they would
7275 * be wrongly reported as unused.
7376 *
74- * @param string[] $usedSkips
77+ * @param array< string, string[]> $usedSkips
7578 */
7679 public function addUsedSkips (array $ usedSkips ): void
7780 {
78- Assert::allString ($ usedSkips );
79- $ this ->usedSkips = array_values (array_unique (array_merge ($ this ->usedSkips , $ usedSkips )));
81+ foreach ($ usedSkips as $ skip => $ paths ) {
82+ Assert::allString ($ paths );
83+ $ existingPaths = $ this ->usedSkips [$ skip ] ?? [];
84+ $ this ->usedSkips [$ skip ] = array_values (array_unique (array_merge ($ existingPaths , $ paths )));
85+ }
8086 }
8187 public function getTotalChanged (): int
8288 {
8389 return $ this ->totalChanged ;
8490 }
8591 /**
86- * @return string[]
92+ * @return array< string, string[]>
8793 */
8894 public function getUsedSkips (): array
8995 {
0 commit comments