Skip to content

[RFC] Allow hooks for backed readonly properties #18757

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

NickSdot
Copy link
Contributor

@NickSdot NickSdot commented Jun 4, 2025

@TimWolla TimWolla added the RFC label Jun 4, 2025
@NickSdot NickSdot force-pushed the allow-readonly-hooks branch 3 times, most recently from 1a21998 to 6840873 Compare June 6, 2025 02:22
@NickSdot NickSdot force-pushed the allow-readonly-hooks branch from da64264 to 24f2687 Compare June 7, 2025 16:23
@NickSdot NickSdot force-pushed the allow-readonly-hooks branch from c06c915 to 12b986a Compare June 7, 2025 16:28
@NickSdot NickSdot changed the title Allow hooks for backed readonly properties [RFC] Allow hooks for backed readonly properties Jun 7, 2025
try {
$t->set(43);
} catch (Error $e) {
echo $e->getMessage(), "\n";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
echo $e->getMessage(), "\n";
echo $e::class, ": ", $e->getMessage(), PHP_EOL;

For consistency with other tests (applies to the entire PR).

Copy link
Contributor Author

@NickSdot NickSdot Jun 14, 2025

Choose a reason for hiding this comment

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

Hi Tim,

I based my approach on the tests in the existing property_hooks directory I was working in. Everything was written in the same style as I initially used here. Moreover, single quotation marks are used in other tests (outside of this directory).

- echo $e::class, ": ", $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;

As I am new here, I have no preference and have made the change as you requested (but with single quotes, ok?).

However, since my tests are now the only ones with this style in the directory, I thought I would mention it in case we want to follow up with an unification PR for the old tests.

(I will not mark as resolved here. Please do it if you consider it done – thanks!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants