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 22
33## NOT RELEASED
44- Fixed false positive "missing argument type declaration" when param are passed by-reference.
5+ - Make ` ReturnTypeDeclarationSniff ` compatible with PHPCS 3.3
56
67## 0.13.2
78- 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(
234234 */
235235 private function returnTypeContent (File $ file , int $ functionPosition ): string
236236 {
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+
237242 $ tokens = $ file ->getTokens ();
238243 $ returnTypeToken = $ file ->findNext (
239244 [T_RETURN_TYPE ],
Original file line number Diff line number Diff line change 2828 "minimum-stability" : " stable" ,
2929 "require" : {
3030 "php" : " >=7.0" ,
31- "squizlabs/php_codesniffer" : " ~3.2. 3" ,
31+ "squizlabs/php_codesniffer" : " ^ 3" ,
3232 "dealerdirect/phpcodesniffer-composer-installer" : " ^0.4" ,
3333 "wp-coding-standards/wpcs" : " ^0.14" ,
3434 "automattic/phpcs-neutron-standard" : " ^1" ,
You can’t perform that action at this time.
0 commit comments