-
Notifications
You must be signed in to change notification settings - Fork 17
Commit 04e3d23
authored
Simplify detecting class properties to improve detection for anonymous classes (#337)
* Add test for anon class with typehint properties
* Remove search for visibility keywords to find properties
This defaults to only using the condition: if a variable is defined
inside a class and not inside a method within a class, then it's a
property.
* Add readonly properties1 parent e9dae13 commit 04e3d23
File tree
2 files changed
+26
-23
lines changed- Tests/VariableAnalysisSniff/fixtures
- VariableAnalysis/Sniffs/CodeAnalysis
2 files changed
+26
-23
lines changedLines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | + | ||
45 | + | ||
46 | + | ||
47 | + | ||
48 | + | ||
49 | + | ||
50 | + | ||
51 | + | ||
52 | + | ||
53 | + | ||
54 | + | ||
55 | + | ||
56 | + | ||
57 | + | ||
58 | + | ||
59 | + | ||
60 | + | ||
61 | + | ||
62 | + | ||
63 | + | ||
64 | + | ||
65 | + | ||
66 | + | ||
67 | + | ||
68 | + | ||
Lines changed: 1 addition & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
864 | 864 | | |
865 | 865 | | |
866 | 866 | | |
867 | - | ||
868 | - | ||
869 | - | ||
870 | - | ||
871 | - | ||
872 | - | ||
873 | - | ||
874 | - | ||
875 | - | ||
876 | - | ||
877 | - | ||
878 | - | ||
879 | - | ||
880 | - | ||
881 | - | ||
882 | - | ||
883 | - | ||
884 | - | ||
885 | - | ||
886 | - | ||
887 | - | ||
888 | - | ||
889 | - | ||
867 | + | ||
890 | 868 | | |
891 | 869 | | |
892 | 870 | | |
| |||
0 commit comments