File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ public function format(bool $ignoreSubElements = false): string
7171 // remove interfaces from parent class if there is a parent class
7272 if ($ parentClass instanceof ReflectionClass) {
7373 $ interfaces = array_filter ($ interfaces , function (ReflectionClass $ interface ) use ($ parentClass ) {
74+ // if the $parentClass is a default php class it cannot use an user defined interface
7475 if (!$ parentClass ->isUserDefined () && $ interface ->isUserDefined ()) {
7576 return false ;
7677 }
@@ -86,7 +87,11 @@ public function format(bool $ignoreSubElements = false): string
8687 /**
8788 * @var ReflectionClass $compareInterface
8889 */
89- if ($ compareInterface ->implementsInterface ($ interfaceName )) {
90+ /** @noinspection NotOptimalIfConditionsInspection */
91+ // if the $compareInterface is a default php interface it cannot use an user defined interface
92+ if ((!$ compareInterface ->isUserDefined () && $ interface ->isUserDefined ())
93+ || $ compareInterface ->implementsInterface ($ interfaceName )
94+ ) {
9095 return false ;
9196 }
9297 }
You can’t perform that action at this time.
0 commit comments