@@ -49,31 +49,32 @@ public function analyze($registryBefore, $registryAfter)
4949
5050 /** @var array $tablesData */
5151 foreach ($ whiteListBefore as $ moduleName => $ beforeModuleTablesData ) {
52+ $ fileBefore = $ registryBefore ->mapping ['whitelist_json ' ][$ moduleName ];
5253 if (!isset ($ whiteListAfter [$ moduleName ])) {
53- $ operation = new WhiteListWasRemoved ($ moduleName );
54+ $ operation = new WhiteListWasRemoved ($ fileBefore , $ moduleName );
5455 $ this ->report ->add ('database ' , $ operation );
5556 continue ;
5657 }
5758 $ afterModuleTablesData = $ whiteListAfter [$ moduleName ];
5859 /** @var array $beforeTableData */
5960 foreach ($ beforeModuleTablesData as $ tableName => $ beforeTableData ) {
6061 if (!$ this ->isArrayExistsAndHasSameSize ($ afterModuleTablesData , $ beforeTableData , $ tableName )) {
61- $ this ->addReport ($ moduleName , $ tableName );
62+ $ this ->addReport ($ fileBefore , $ tableName );
6263 continue ;
6364 }
6465 $ afterTableData = $ afterModuleTablesData [$ tableName ];
6566 /** @var array $beforeTablePartData */
6667 foreach ($ beforeTableData as $ tablePartName => $ beforeTablePartData ) {
6768 if (!$ this ->isArrayExistsAndHasSameSize ($ afterTableData , $ beforeTablePartData , $ tablePartName )) {
68- $ this ->addReport ($ moduleName , $ tableName . '/ ' . $ tablePartName );
69+ $ this ->addReport ($ fileBefore , $ tableName . '/ ' . $ tablePartName );
6970 continue ;
7071 }
7172 $ afterTablePartData = $ afterTableData [$ tablePartName ];
7273 /** @var bool $beforeStatus */
7374 foreach ($ beforeTablePartData as $ name => $ beforeStatus ) {
7475 //checks if array exists in new whitelist.json and if it has different amount of items inside
7576 if (!isset ($ afterTablePartData [$ name ])) {
76- $ this ->addReport ($ moduleName , $ tableName . '/ ' . $ tablePartName . '/ ' . $ name );
77+ $ this ->addReport ($ fileBefore , $ tableName . '/ ' . $ tablePartName . '/ ' . $ name );
7778 }
7879 }
7980 }
@@ -102,14 +103,14 @@ public function isArrayExistsAndHasSameSize(array $after, array $beforeArray, st
102103 }
103104
104105 /**
105- * @param string $moduleName
106+ * @param string $location
106107 * @param string $target
107108 *
108109 * @return void
109110 */
110- public function addReport (string $ moduleName , string $ target ): void
111+ public function addReport (string $ location , string $ target ): void
111112 {
112- $ operation = new WhiteListReduced ($ moduleName , $ target );
113+ $ operation = new WhiteListReduced ($ location , $ target );
113114 $ this ->report ->add ('database ' , $ operation );
114115 }
115116}
0 commit comments