Re: How do I handle covariant parameters and not fall foul of LSP.

From: Date: Sun, 19 Feb 2017 09:56:05 +0000
Subject: Re: How do I handle covariant parameters and not fall foul of LSP.
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-325976@lists.php.net to get a copy of this message
"Richard Quadling" wrote in message news:CAKUjMCXEXqy=VB8Jjjg8XKdUsc5NsqQTeZcs54+V5e4GH1RYYw@mail.gmail.com...
<snip>
That's fine for concrete classes, but abstract classes which cannot be instantiated, therefore cannot be swapped, cannot fall foul of LSP. It is the abstract part that, in my mind, should be making the difference.
That is correct. LSP does not come into play when you inherit from an abstract class, only when you inherit from one concrete class to create a different concrete class. The author of LSP should have made this clear. -- Tony Marston

« previous php.general (#325976) next »