symfony: Making `ExtensionInterface`s extending `\Throwable` is a BC break
Symfony version(s) affected: 4.1
Description #26702 introduces an annoying BC break: when using Prophecy, it’s not possible to prohesize our interfaces anymore.
How to reproduce
$serializerException = $this->prophesize(ExceptionInterface::class);
$serializerException->willExtend(\Exception::class);
$serializerException->reveal();
Was working before, now throws Prophecy\Exception\Doubler\MethodNotExtendableException: Method getMessage is not extendable, so can not be added.
Possible Solution
Reverting #26702. (I’m trying to figure another solution).
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 17 (17 by maintainers)
Commits related to this issue
- bug #27420 Revert "feature #26702 Mark ExceptionInterfaces throwable (ostrolucky)" (nicolas-grekas) This PR was merged into the 4.1 branch. Discussion ---------- Revert "feature #26702 Mark Excepti... — committed to symfony/symfony by nicolas-grekas 6 years ago
- minor #28307 Mark ExceptionInterfaces throwable #2 (ostrolucky) This PR was merged into the 4.2-dev branch. Discussion ---------- Mark ExceptionInterfaces throwable #2 | Q | A | ------... — committed to symfony/form by fabpot 6 years ago
- minor #28307 Mark ExceptionInterfaces throwable #2 (ostrolucky) This PR was merged into the 4.2-dev branch. Discussion ---------- Mark ExceptionInterfaces throwable #2 | Q | A | ------... — committed to symfony/filesystem by fabpot 6 years ago
- minor #28307 Mark ExceptionInterfaces throwable #2 (ostrolucky) This PR was merged into the 4.2-dev branch. Discussion ---------- Mark ExceptionInterfaces throwable #2 | Q | A | ------... — committed to symfony/symfony by fabpot 6 years ago
- minor #28307 Mark ExceptionInterfaces throwable #2 (ostrolucky) This PR was merged into the 4.2-dev branch. Discussion ---------- Mark ExceptionInterfaces throwable #2 | Q | A | ------... — committed to symfony/process by fabpot 6 years ago
- minor #28307 Mark ExceptionInterfaces throwable #2 (ostrolucky) This PR was merged into the 4.2-dev branch. Discussion ---------- Mark ExceptionInterfaces throwable #2 | Q | A | ------... — committed to symfony/serializer by fabpot 6 years ago
- minor #28307 Mark ExceptionInterfaces throwable #2 (ostrolucky) This PR was merged into the 4.2-dev branch. Discussion ---------- Mark ExceptionInterfaces throwable #2 | Q | A | ------... — committed to symfony/security by fabpot 6 years ago
- minor #28307 Mark ExceptionInterfaces throwable #2 (ostrolucky) This PR was merged into the 4.2-dev branch. Discussion ---------- Mark ExceptionInterfaces throwable #2 | Q | A | ------... — committed to symfony/console by fabpot 6 years ago
- minor #28307 Mark ExceptionInterfaces throwable #2 (ostrolucky) This PR was merged into the 4.2-dev branch. Discussion ---------- Mark ExceptionInterfaces throwable #2 | Q | A | ------... — committed to symfony/yaml by fabpot 6 years ago
- minor #28307 Mark ExceptionInterfaces throwable #2 (ostrolucky) This PR was merged into the 4.2-dev branch. Discussion ---------- Mark ExceptionInterfaces throwable #2 | Q | A | ------... — committed to symfony/dependency-injection by fabpot 6 years ago
- minor #28307 Mark ExceptionInterfaces throwable #2 (ostrolucky) This PR was merged into the 4.2-dev branch. Discussion ---------- Mark ExceptionInterfaces throwable #2 | Q | A | ------... — committed to symfony/lock by fabpot 6 years ago
- minor #28307 Mark ExceptionInterfaces throwable #2 (ostrolucky) This PR was merged into the 4.2-dev branch. Discussion ---------- Mark ExceptionInterfaces throwable #2 | Q | A | ------... — committed to symfony/messenger by fabpot 6 years ago
- minor #28307 Mark ExceptionInterfaces throwable #2 (ostrolucky) This PR was merged into the 4.2-dev branch. Discussion ---------- Mark ExceptionInterfaces throwable #2 | Q | A | ------... — committed to symfony/routing by fabpot 6 years ago
- minor #28307 Mark ExceptionInterfaces throwable #2 (ostrolucky) This PR was merged into the 4.2-dev branch. Discussion ---------- Mark ExceptionInterfaces throwable #2 | Q | A | ------... — committed to symfony/options-resolver by fabpot 6 years ago
- minor #28307 Mark ExceptionInterfaces throwable #2 (ostrolucky) This PR was merged into the 4.2-dev branch. Discussion ---------- Mark ExceptionInterfaces throwable #2 | Q | A | ------... — committed to symfony/dotenv by fabpot 6 years ago
- minor #28307 Mark ExceptionInterfaces throwable #2 (ostrolucky) This PR was merged into the 4.2-dev branch. Discussion ---------- Mark ExceptionInterfaces throwable #2 | Q | A | ------... — committed to symfony/validator by fabpot 6 years ago
- minor #28307 Mark ExceptionInterfaces throwable #2 (ostrolucky) This PR was merged into the 4.2-dev branch. Discussion ---------- Mark ExceptionInterfaces throwable #2 | Q | A | ------... — committed to symfony/translation by fabpot 6 years ago
- minor #28307 Mark ExceptionInterfaces throwable #2 (ostrolucky) This PR was merged into the 4.2-dev branch. Discussion ---------- Mark ExceptionInterfaces throwable #2 | Q | A | ------... — committed to symfony/security-core by fabpot 6 years ago
- minor #28307 Mark ExceptionInterfaces throwable #2 (ostrolucky) This PR was merged into the 4.2-dev branch. Discussion ---------- Mark ExceptionInterfaces throwable #2 | Q | A | ------... — committed to symfony/messenger by fabpot 6 years ago
- minor #28307 Mark ExceptionInterfaces throwable #2 (ostrolucky) This PR was merged into the 4.2-dev branch. Discussion ---------- Mark ExceptionInterfaces throwable #2 | Q | A | ------... — committed to SerhiyMytrovtsiy/translation by SerhiyMytrovtsiy 3 years ago
@curry684 but that does not mean you cannot have an interface extending it.
Traversablealready works that way. It only means that classes which want to implement this interface must extend Exception or Error (like classes implementing an interface extendingTraversablemust implement eitherIteratororIteratorAggregate)Maybe it could be merged again after the issue with Prophecy is fixed?
@nicolas-grekas @fabpot Do you consider re-merging #26702 ? It actually looks like a bug not related to Symfony and
\Throwable.It seems like a bug in Prophecy, here’s the WIP PR: https://github.com/phpspec/prophecy/pull/412