Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

@WalterWoshid
Copy link
Author

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;
Copy link
Member

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

Copy link
Author

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>
Copy link
Member

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about now?

src/Prophecy/Doubler/Generator/Node/ClassNode.php Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mocking PHP 8.2 readonly classes generates readonly double with untyped property and fails
2 participants