You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 45928f4
Browse filesBrowse the repository at this point in the historyBrowse files
Keep protected properties of a final class across calls like private ones
No subclass reaches a protected property of a final class, so only the
class's own code writes it - and the parent's code, when the parent
declares the property too, which the resolver checks by reflection.
Amp-Thread-ID: https://ampcode.com/threads/T-01a1ffd7-32dc-7043-b3ac-2d8cf42d2441
Copy file name to clipboardExpand all lines: src/Parser/PreservedPropertiesClassScan.php
+20-1Lines changed: 20 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,9 @@ final class PreservedPropertiesClassScan
46
46
/** @var array<string, bool> declared instance properties, each with whether only the class's own code can write it */
47
47
publicarray$properties = [];
48
48
49
+
/** @var array<string, true> protected properties of a final class with a parent, which only the class's own code writes unless the parent declares them too */
50
+
privatearray$unlessParentDeclares = [];
51
+
49
52
/** @var array<string, true> properties written in ways no walk sees the value of: not by assigning it, or in closures */
0 commit comments