Я знаю о LSP и о том, почему следующий код выдает:
Неустранимая ошибка PHP: Объявление
UnauthenticatedUser:: ExecuteCommand(UnauuthenticatedCommand $c) должен быть
совместим с User::executeCommand(Command $c) в /tmp/test.php в
строке 13
< br />
Однако я бы сказал, что два интерфейса
Код: Выделить всё
CommandКод: Выделить всё
UnauthenticatedCommandGiven these facts, what would be a clean[1] approach for making it impossible for an unauthenticated user to execute anything else but an
Код: Выделить всё
UnauthenticatedCommandКод: Выделить всё
Источник: [url]https://stackoverflow.com/questions/49457117/safe-programming-with-marker-interfaces-vs-the-liskov-substitution-principle[/url]
Мобильная версия