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()
5757 $ errors = [];
5858 foreach (self ::$ observerClasses as $ observerClass ) {
5959 $ reflection = (new \ReflectionClass ($ observerClass ));
60+ $ publicMethodsCount = 0 ;
6061 $ 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+ }
6168
62- if (count ( $ reflection -> getMethods (\ReflectionMethod:: IS_PUBLIC )) > $ maxCountMethod ) {
69+ if ($ publicMethodsCount > $ maxCountMethod ) {
6370 $ errors [] = $ observerClass ;
6471 }
6572 }
66- $ errors = array_diff ($ errors , [GetPriceConfigurationObserver::class]);
6773
6874 if ($ errors ) {
6975 $ errors = array_unique ($ errors );
You can’t perform that action at this time.
0 commit comments