Skip to content

Conversation

browner12
Copy link
Contributor

consistently prefix with a $ when referencing a class property.

this is a follow up to #10645

I explicitly only added the prefix when we were directly referencing and showing an example of a PHP class. I did not add the prefix when referencing a javascript property of an object, or when the example showed the calling code of the property from an instantiated object ($model->property).

if I'm being honest, I think the previous PR went the wrong direction, and instead we should remove all the $ prefixes. it feels like the $ is implied for all PHP class properties. we also get this inconsistency, because it becomes largely context dependent on what type of property we're referencing, and how we're showing it in the example. but I'll obviously leave that up to maintainers to decide on.

consistency prefix with a `$` when referencing a class property.
@AhmedAlaa4611
Copy link
Contributor

AhmedAlaa4611 commented Jul 28, 2025

it becomes largely context dependent on what type of property we're referencing, and how we're showing it in the example.

According to your description, I think we may need to remove the prefix.

@browner12
Copy link
Contributor Author

correct. Taylor can decide if he wants to accept this PR, which matches your changes from the previous PR. or if he'd like to revert and go the other direction.

@taylorotwell
Copy link
Member

Just reverted the other PR.

@browner12 browner12 deleted the AB-propety-$-prefix branch July 30, 2025 15:52
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.

3 participants