File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
dev/tests/static/testsuite/Magento/Test/Integrity Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -57,13 +57,19 @@ public function testObserverHasNoExtraPublicMethods()
57
57
$ errors = [];
58
58
foreach (self ::$ observerClasses as $ observerClass ) {
59
59
$ reflection = (new \ReflectionClass ($ observerClass ));
60
+ $ publicMethodsCount = 0 ;
60
61
$ maxCountMethod = $ reflection ->getConstructor () ? 2 : 1 ;
62
+ $ publicMethods = $ reflection ->getMethods (\ReflectionMethod::IS_PUBLIC );
63
+ foreach ($ publicMethods as $ publicMethod ) {
64
+ if (!str_starts_with ($ publicMethod ->getName (), '_ ' )) {
65
+ $ publicMethodsCount ++;
66
+ }
67
+ }
61
68
62
- if (count ( $ reflection -> getMethods (\ReflectionMethod:: IS_PUBLIC )) > $ maxCountMethod ) {
69
+ if ($ publicMethodsCount > $ maxCountMethod ) {
63
70
$ errors [] = $ observerClass ;
64
71
}
65
72
}
66
- $ errors = array_diff ($ errors , [GetPriceConfigurationObserver::class]);
67
73
68
74
if ($ errors ) {
69
75
$ errors = array_unique ($ errors );
You can’t perform that action at this time.
0 commit comments