@@ -49,31 +49,32 @@ public function analyze($registryBefore, $registryAfter)
49
49
50
50
/** @var array $tablesData */
51
51
foreach ($ whiteListBefore as $ moduleName => $ beforeModuleTablesData ) {
52
+ $ fileBefore = $ registryBefore ->mapping ['whitelist_json ' ][$ moduleName ];
52
53
if (!isset ($ whiteListAfter [$ moduleName ])) {
53
- $ operation = new WhiteListWasRemoved ($ moduleName );
54
+ $ operation = new WhiteListWasRemoved ($ fileBefore , $ moduleName );
54
55
$ this ->report ->add ('database ' , $ operation );
55
56
continue ;
56
57
}
57
58
$ afterModuleTablesData = $ whiteListAfter [$ moduleName ];
58
59
/** @var array $beforeTableData */
59
60
foreach ($ beforeModuleTablesData as $ tableName => $ beforeTableData ) {
60
61
if (!$ this ->isArrayExistsAndHasSameSize ($ afterModuleTablesData , $ beforeTableData , $ tableName )) {
61
- $ this ->addReport ($ moduleName , $ tableName );
62
+ $ this ->addReport ($ fileBefore , $ tableName );
62
63
continue ;
63
64
}
64
65
$ afterTableData = $ afterModuleTablesData [$ tableName ];
65
66
/** @var array $beforeTablePartData */
66
67
foreach ($ beforeTableData as $ tablePartName => $ beforeTablePartData ) {
67
68
if (!$ this ->isArrayExistsAndHasSameSize ($ afterTableData , $ beforeTablePartData , $ tablePartName )) {
68
- $ this ->addReport ($ moduleName , $ tableName . '/ ' . $ tablePartName );
69
+ $ this ->addReport ($ fileBefore , $ tableName . '/ ' . $ tablePartName );
69
70
continue ;
70
71
}
71
72
$ afterTablePartData = $ afterTableData [$ tablePartName ];
72
73
/** @var bool $beforeStatus */
73
74
foreach ($ beforeTablePartData as $ name => $ beforeStatus ) {
74
75
//checks if array exists in new whitelist.json and if it has different amount of items inside
75
76
if (!isset ($ afterTablePartData [$ name ])) {
76
- $ this ->addReport ($ moduleName , $ tableName . '/ ' . $ tablePartName . '/ ' . $ name );
77
+ $ this ->addReport ($ fileBefore , $ tableName . '/ ' . $ tablePartName . '/ ' . $ name );
77
78
}
78
79
}
79
80
}
@@ -102,14 +103,14 @@ public function isArrayExistsAndHasSameSize(array $after, array $beforeArray, st
102
103
}
103
104
104
105
/**
105
- * @param string $moduleName
106
+ * @param string $location
106
107
* @param string $target
107
108
*
108
109
* @return void
109
110
*/
110
- public function addReport (string $ moduleName , string $ target ): void
111
+ public function addReport (string $ location , string $ target ): void
111
112
{
112
- $ operation = new WhiteListReduced ($ moduleName , $ target );
113
+ $ operation = new WhiteListReduced ($ location , $ target );
113
114
$ this ->report ->add ('database ' , $ operation );
114
115
}
115
116
}
0 commit comments