Re: Signature compatibility: Number of arguments
| From: | Stas Malyshev | Date: | Thu, 29 Aug 2013 17:15:45 +0000 |
| Subject: | Re: Signature compatibility: Number of arguments | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-68691@lists.php.net to get a copy of this message | ||
Hi!
> I respectfully disagree.
>
> The first method requires at least one parameter (or two, depending on
> the pending clarification in the other thread) , and the latest: zero
> or more (or 1 or more).
Yes, this is true. But how it is an objection? LSP allows to weaken
preconditions, but not to strengthen them - that's exactly what happens.
Any method call that worked for base class would also work for derived
class, and some other, additional calls, would work too.
>> Is it okay to change this?
>
> I see no reason to do so and I would say -0.5.
The reason is that current situation does not match LSP requirements and
serves no useful purpose. Especially the second one which literally has
the same preconditions but for some weird reason is rejected.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227