@@ -62,44 +62,44 @@ abstract class Endpoint instanceof DataFlow::Node {
62
62
* A callable method or accessor from source code.
63
63
*/
64
64
class MethodEndpoint extends Endpoint {
65
- private DataFlow:: MethodNode methodNode ;
66
-
67
65
MethodEndpoint ( ) {
68
- this = methodNode and
69
- methodNode .isPublic ( ) and
70
- not isUninteresting ( methodNode )
66
+ this .( DataFlow:: MethodNode ) .isPublic ( ) and
67
+ not isUninteresting ( this )
71
68
}
72
69
73
- DataFlow:: MethodNode getNode ( ) { result = methodNode }
70
+ DataFlow:: MethodNode getNode ( ) { result = this }
74
71
75
- override string getName ( ) { result = methodNode .getMethodName ( ) }
72
+ override string getName ( ) { result = this . ( DataFlow :: MethodNode ) .getMethodName ( ) }
76
73
77
74
/**
78
75
* Gets the unbound type name of this endpoint.
79
76
*/
80
77
override string getType ( ) {
81
78
result =
82
- any ( DataFlow:: ModuleNode m | m .getOwnInstanceMethod ( this .getName ( ) ) = methodNode )
83
- .getQualifiedName ( ) or
79
+ any ( DataFlow:: ModuleNode m | m .getOwnInstanceMethod ( this .getName ( ) ) = this ) .getQualifiedName ( ) or
84
80
result =
85
- any ( DataFlow:: ModuleNode m | m .getOwnSingletonMethod ( this .getName ( ) ) = methodNode )
81
+ any ( DataFlow:: ModuleNode m | m .getOwnSingletonMethod ( this .getName ( ) ) = this )
86
82
.getQualifiedName ( ) + "!"
87
83
}
88
84
89
85
/**
90
86
* Gets the parameter types of this endpoint.
91
87
*/
92
88
override string getParameters ( ) {
93
- // For now, return the names of postional and keyword parameters. We don't always have type information, so we can't return type names.
89
+ // For now, return the names of positional and keyword parameters. We don't always have type information, so we can't return type names.
94
90
// We don't yet handle splat params or block params.
95
91
result =
96
92
"(" +
97
93
concat ( string key , string value |
98
94
value =
99
- any ( int i | i .toString ( ) = key | methodNode .asCallable ( ) .getParameter ( i ) ) .getName ( )
95
+ any ( int i |
96
+ i .toString ( ) = key
97
+ |
98
+ this .( DataFlow:: MethodNode ) .asCallable ( ) .getParameter ( i )
99
+ ) .getName ( )
100
100
or
101
101
exists ( DataFlow:: ParameterNode param |
102
- param = methodNode .asCallable ( ) .getKeywordParameter ( key )
102
+ param = this . ( DataFlow :: MethodNode ) .asCallable ( ) .getKeywordParameter ( key )
103
103
|
104
104
value = key + ":"
105
105
)
0 commit comments