phpspec / prophecy

Highly opinionated mocking framework for PHP 5.3+
MIT License
8.53k stars 242 forks source link

Revert #441: #526

Open Jean85 opened 3 years ago

Jean85 commented 3 years ago

Fixes #472, declares a new major bump to 2.0.

As suggested by @stof in https://github.com/phpspec/prophecy/issues/472#issuecomment-801142387, this is an attempt to revert #441 and go back to the old behavior, with a fast bailout when the prophecy hits an unregistered method call. This avoids returning null in those cases, since it would probably lead to \TypeErrors or other unpredictable behaviours, as originally pointed out in https://github.com/phpspec/prophecy/pull/441/files#r388191626.

Jean85 commented 3 years ago

Ouch, we would need to declare PHPSpec compatible with Prophecy 2.0 in advance :cry: I'll revert the dev-master alias change to make the build happy.

ciaranmcnulty commented 3 years ago

If we're going to bump the version number we should re-think the behaviour more comprehensively

What do you think of #528 ?