-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Readonly support #623
base: master
Are you sure you want to change the base?
Add Readonly support #623
Conversation
WalterWoshid
commented
Apr 25, 2024
- closes Mocking PHP 8.2 readonly classes generates readonly double with untyped property and fails #586
Ran the tests on PHP 8.3 and PHP 7.2, both ran successfully. |
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Prophecy\Doubler\ClassPatch\ProphecySubjectPatch; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this class is part of the final API, it should not be in the ClassPatch namespace at all IMO.
And this class should probably be tagged as @internal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What defines the final API? Where should I place it instead?
* @return array<string, string> | ||
* | ||
* @phpstan-return array<string, 'public'|'private'|'protected'> | ||
* @return array<string, PropertyNode> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cannot be done as it. This ClassNode is not internal (it is part of the API exposed to custom class patches) so we must preserve backward compatibility. Changing the return type is a BC break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about now?