Hi Robert, wt., 11 lip 2023 o 14:54 Robert Landers <landers.rob...@gmail.com> napisał(a):
> ... > Abstract classes solve this problem perfectly. It's part of the type > system, it's type-hintable, it's mockable, and it's pretty easy to see > what inherits it as people who inherit it already know what the base > behavior was when they wrote the code. > Not exactly, How you wanna solve by abstract class two interfaces which can be implemented using let's say two traits - let's say interface Foo { public function foo(): string; } trait HasFoo { public function foo(): string { return 'foo'; } } interface Bar { public function bar(): bool; } traitHasBar { public function bar(): bool { return true; } } Now I can need to implement Foo or Bar separately or together. Using abstract class that would require 3 abstract classes: Foo, Bar, and FooWithBar. With this RFC that would require just two interfaces with default methods. Now you can easily see how bad this goes if you wanna add 3rd interface. Cheers, Michał Marcin Brzuchalski