See #253 for context.
Given some type with a method:
interface SomeType
{
public function someMethod(string $arg): string|int;
}
A "standard" ad hoc mock like the following one would result in a mock class with someMethod having the signature (string|int): string (matching the signature of the ad hoc implementation):
partialMock([
SomeType::class,
[
'someMethod' => function (string|int $arg): string {
},
]
]);
Whereas a special token like {useOriginalSignature} would change the behaviour and result in a mock class with someMethod having the signature (string): string|int (matching the signature of the original method):
partialMock([
SomeType::class,
[
'someMethod {useOriginalSignature}' => function (string|int $arg): string {
},
]
]);
Alternatively, perhaps the behaviour could be flipped, defaulting to using the overridden method's signature, and a keyword like override (inspired by languages that require explicit override declaration) could indicate that the signature of the ad hoc implementation should be used. This would be a BC break, however.