brendt / stitcher.io

Source code of stitcher.io
https://stitcher.io
179 stars 135 forks source link

Add notes about attribute inheritance #208

Closed MattyRad closed 9 months ago

MattyRad commented 2 years ago

I'm running up against some of the limitations of attributes in PHP, which would be nice to be seen documented on stitcher.io, which is now pretty much my go to resource for how to use new PHP features. Thanks for the great work.

MattyRad commented 2 years ago

If this addition is agreeable, then I could use a sanity check that it's actually correct! Doing all the attributes checks with Reflection is a little wonky I could just be doing it wrong.

brendt commented 2 years ago

I agree that this should be added. Although I should also make a note on class attributes (which aren't inherited). I think the rule is this: the attribute only belongs to the place where it's declared. If you override anything (classes or methods) you should redeclare it, since it doesn't cascade.