@@ -59,35 +59,35 @@ public function testCannotHandleUnknownNode(): void
59
59
/**
60
60
* @dataProvider typesDataProvider
61
61
*/
62
- public function testExtractFromReturnType (string $ expectedType , string $ method ): void
62
+ public function testExtractFromFunctionReturn (string $ expectedType , string $ method ): void
63
63
{
64
64
$ fallbackExtractor = $ this ->createStub (TypeExtractorInterface::class);
65
- $ fallbackExtractor ->method ('extractFromReturnType ' )->willReturn ('FALLBACK ' );
65
+ $ fallbackExtractor ->method ('extractFromFunctionReturn ' )->willReturn ('FALLBACK ' );
66
66
67
67
$ extractor = new PhpstanTypeExtractor ($ fallbackExtractor );
68
68
$ reflectionMethod = (new \ReflectionClass (PhpstanExtractableDummy::class))->getMethod ($ method );
69
69
70
- $ this ->assertSame ($ expectedType , $ extractor ->extractFromReturnType ($ reflectionMethod ));
70
+ $ this ->assertSame ($ expectedType , $ extractor ->extractFromFunctionReturn ($ reflectionMethod ));
71
71
}
72
72
73
- public function testFallbackOnVoidAndNeverReturnType (): void
73
+ public function testFallbackOnVoidAndNeverFunctionReturn (): void
74
74
{
75
75
$ fallbackExtractor = $ this ->createStub (TypeExtractorInterface::class);
76
- $ fallbackExtractor ->method ('extractFromReturnType ' )->willReturn ('FALLBACK ' );
76
+ $ fallbackExtractor ->method ('extractFromFunctionReturn ' )->willReturn ('FALLBACK ' );
77
77
78
78
$ extractor = new PhpstanTypeExtractor ($ fallbackExtractor );
79
79
80
80
$ voidReflectionMethod = (new \ReflectionClass (PhpstanExtractableDummy::class))->getMethod ('void ' );
81
81
$ neverReflectionMethod = (new \ReflectionClass (PhpstanExtractableDummy::class))->getMethod ('never ' );
82
82
83
- $ this ->assertSame ('FALLBACK ' , $ extractor ->extractFromReturnType ($ voidReflectionMethod ));
84
- $ this ->assertSame ('FALLBACK ' , $ extractor ->extractFromReturnType ($ neverReflectionMethod ));
83
+ $ this ->assertSame ('FALLBACK ' , $ extractor ->extractFromFunctionReturn ($ voidReflectionMethod ));
84
+ $ this ->assertSame ('FALLBACK ' , $ extractor ->extractFromFunctionReturn ($ neverReflectionMethod ));
85
85
}
86
86
87
- public function testExtractClassTypeFromFunctionReturnType (): void
87
+ public function testExtractClassTypeFromFunctionFunctionReturn (): void
88
88
{
89
89
$ fallbackExtractor = $ this ->createStub (TypeExtractorInterface::class);
90
- $ fallbackExtractor ->method ('extractFromReturnType ' )->willReturn ('FALLBACK ' );
90
+ $ fallbackExtractor ->method ('extractFromFunctionReturn ' )->willReturn ('FALLBACK ' );
91
91
92
92
$ extractor = new PhpstanTypeExtractor ($ fallbackExtractor );
93
93
@@ -96,7 +96,7 @@ public function testExtractClassTypeFromFunctionReturnType(): void
96
96
return $ this ;
97
97
});
98
98
99
- $ this ->assertSame (self ::class, $ extractor ->extractFromReturnType ($ selfReflectionFunction ));
99
+ $ this ->assertSame (self ::class, $ extractor ->extractFromFunctionReturn ($ selfReflectionFunction ));
100
100
}
101
101
102
102
/**
@@ -105,27 +105,27 @@ public function testExtractClassTypeFromFunctionReturnType(): void
105
105
public function testExtractFromParameter (string $ expectedType , string $ method ): void
106
106
{
107
107
$ fallbackExtractor = $ this ->createStub (TypeExtractorInterface::class);
108
- $ fallbackExtractor ->method ('extractFromParameter ' )->willReturn ('FALLBACK ' );
108
+ $ fallbackExtractor ->method ('extractFromFunctionParameter ' )->willReturn ('FALLBACK ' );
109
109
110
110
$ extractor = new PhpstanTypeExtractor ($ fallbackExtractor );
111
111
112
112
$ reflectionParameter = (new \ReflectionClass (PhpstanExtractableDummy::class))->getMethod ($ method )->getParameters ()[0 ];
113
113
114
- $ this ->assertSame ($ expectedType , $ extractor ->extractFromParameter ($ reflectionParameter ));
114
+ $ this ->assertSame ($ expectedType , $ extractor ->extractFromFunctionParameter ($ reflectionParameter ));
115
115
}
116
116
117
117
public function testExtractClassTypeFromParameter (): void
118
118
{
119
119
$ fallbackExtractor = $ this ->createStub (TypeExtractorInterface::class);
120
- $ fallbackExtractor ->method ('extractFromParameter ' )->willReturn ('FALLBACK ' );
120
+ $ fallbackExtractor ->method ('extractFromFunctionParameter ' )->willReturn ('FALLBACK ' );
121
121
122
122
$ extractor = new PhpstanTypeExtractor ($ fallbackExtractor );
123
123
124
124
/** @param self $_ */
125
125
$ selfReflectionFunction = new \ReflectionFunction (function ($ _ ) {
126
126
});
127
127
128
- $ this ->assertSame (self ::class, $ extractor ->extractFromParameter ($ selfReflectionFunction ->getParameters ()[0 ]));
128
+ $ this ->assertSame (self ::class, $ extractor ->extractFromFunctionParameter ($ selfReflectionFunction ->getParameters ()[0 ]));
129
129
}
130
130
131
131
/**
0 commit comments