File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed
Inpsyde/Sniffs/CodeQuality Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## NOT RELEASED
4
4
- Fixed false positive "missing argument type declaration" when param are passed by-reference.
5
+ - Make ` ReturnTypeDeclarationSniff ` compatible with PHPCS 3.3
5
6
6
7
## 0.13.2
7
8
- Changed "squizlabs/php_codesniffer" in composer.json to "~ 3.2.3"
Original file line number Diff line number Diff line change @@ -234,6 +234,11 @@ private function maybeGeneratorErrors(
234
234
*/
235
235
private function returnTypeContent (File $ file , int $ functionPosition ): string
236
236
{
237
+ $ info = $ file ->getMethodProperties ($ functionPosition );
238
+ if (array_key_exists ('return_type ' , $ info ) && is_string ($ info ['return_type ' ])) {
239
+ return ltrim ($ info ['return_type ' ], '\\' );
240
+ }
241
+
237
242
$ tokens = $ file ->getTokens ();
238
243
$ returnTypeToken = $ file ->findNext (
239
244
[T_RETURN_TYPE ],
Original file line number Diff line number Diff line change 28
28
"minimum-stability" : " stable" ,
29
29
"require" : {
30
30
"php" : " >=7.0" ,
31
- "squizlabs/php_codesniffer" : " ~3.2. 3" ,
31
+ "squizlabs/php_codesniffer" : " ^ 3" ,
32
32
"dealerdirect/phpcodesniffer-composer-installer" : " ^0.4" ,
33
33
"wp-coding-standards/wpcs" : " ^0.14" ,
34
34
"automattic/phpcs-neutron-standard" : " ^1" ,
You can’t perform that action at this time.
0 commit comments