@@ -27,21 +27,16 @@ class ConflictingModulesNotification implements MessageInterface
27
27
/**
28
28
* @var string
29
29
*/
30
- private static string $ meta_business_extension = 'Meta_BusinessExtension ' ;
30
+ private string $ conflictingModuleFound = '' ;
31
31
32
32
/**
33
- * @var string
34
- */
35
- private string $ conflictingModulesFound = '' ;
36
-
37
- /**
38
- * ConflictingModulesNotification constructor.
33
+ * Constructor
39
34
*
40
35
* @param MetaIssueNotification $metaIssueNotification
41
36
* @param ModuleManager $moduleManager
42
37
*/
43
38
public function __construct (
44
- MetaIssueNotification $ metaIssueNotification ,
39
+ MetaIssueNotification $ metaIssueNotification ,
45
40
ModuleManager $ moduleManager
46
41
) {
47
42
$ this ->metaIssueNotification = $ metaIssueNotification ;
@@ -51,7 +46,7 @@ public function __construct(
51
46
/**
52
47
* Get identity
53
48
*
54
- * @return string
49
+ * @return mixed| string
55
50
*/
56
51
public function getIdentity ()
57
52
{
@@ -60,19 +55,16 @@ public function getIdentity()
60
55
}
61
56
62
57
/**
63
- * Validate if any conflicting modules are found
58
+ * Toggle flag for displaying notification
64
59
*
65
60
* @return bool
66
61
*/
67
- public function isDisplayed ()
62
+ public function isDisplayed (): bool
68
63
{
69
- //find out if the user enabled the Meta Business Extension
70
- $ has_Meta_BusinessExtension = $ this ->moduleManager ->isEnabled (self ::$ meta_business_extension );
71
-
72
- //iterate through the user's module manager to see if they have any conflicting modules
64
+ // iterate through the user's module manager to see if they have any conflicting modules
73
65
foreach (self ::$ conflictingModules as $ conflictingModule ) {
74
- if ($ this ->moduleManager ->isEnabled ($ conflictingModule ) && $ has_Meta_BusinessExtension ) {
75
- $ this ->conflictingModulesFound = $ conflictingModule ;
66
+ if ($ this ->moduleManager ->isEnabled ($ conflictingModule )) {
67
+ $ this ->conflictingModuleFound = $ conflictingModule ;
76
68
return true ;
77
69
}
78
70
}
@@ -84,18 +76,18 @@ public function isDisplayed()
84
76
*
85
77
* @return string
86
78
*/
87
- public function getText ()
79
+ public function getText (): string
88
80
{
89
81
return sprintf ('The following module conflicts with the Facebook & Instagram Extension: [%s].
90
- Please disable the conflicting module. ' , $ this ->conflictingModulesFound );
82
+ Please disable the conflicting module. ' , $ this ->conflictingModuleFound );
91
83
}
92
84
93
85
/**
94
- * Get severity
86
+ * Get severity of the notification
95
87
*
96
88
* @return int
97
89
*/
98
- public function getSeverity ()
90
+ public function getSeverity (): int
99
91
{
100
92
return self ::SEVERITY_CRITICAL ;
101
93
}
0 commit comments