diff --git a/examples/friend/friendWIthInheritance.php b/examples/friend/friendWIthInheritance.php new file mode 100644 index 0000000..092a870 --- /dev/null +++ b/examples/friend/friendWIthInheritance.php @@ -0,0 +1,41 @@ +sendEmail(); // OK + } +} + +class AnotherClass { + public function sendEmail(): void + { + $mailer = new PhpMailer(); + $mailer->sendEmail(); // ERROR + } +} + + diff --git a/examples/friend/friendWIthInheritance2.php b/examples/friend/friendWIthInheritance2.php new file mode 100644 index 0000000..d055869 --- /dev/null +++ b/examples/friend/friendWIthInheritance2.php @@ -0,0 +1,45 @@ +execute(); // OK + } +} + + +class AnotherClass +{ + public function process(Command $command): void + { + $command->execute(); // ERROR + } +} \ No newline at end of file