Konafets / TYPO3SniffPool

This repository contains custom sniffs which are compatible with the PHP_CodeSniffer. Understand this package as a sniff pool which contains all needed custom sniffs for the various TYPO3 projects.
21 stars 10 forks source link

FEATURE: Allow PHP 7 type declaration #79

Open DanielSiepmann opened 8 years ago

DanielSiepmann commented 8 years ago
DanielSiepmann commented 8 years ago

Otherwise the following code will result in errors:

protected function shouldExecuteHook(string $action, string $table, string $recordUid, array $modifiedFields) : bool 
-------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 4 LINES                                                                                               
-------------------------------------------------------------------------------------------------------------------------------
 160 | ERROR | Unknown type hint "string" found for $action (TYPO3SniffPool.Commenting.FunctionComment.InvalidTypeHint)        
 160 | ERROR | Unknown type hint "string" found for $table (TYPO3SniffPool.Commenting.FunctionComment.InvalidTypeHint)         
 160 | ERROR | Unknown type hint "string" found for $recordUid (TYPO3SniffPool.Commenting.FunctionComment.InvalidTypeHint)     
 202 | ERROR | Unknown type hint "string" found for $fieldToModify (TYPO3SniffPool.Commenting.FunctionComment.InvalidTypeHint) 
 223 | ERROR | Unknown type hint "string" found for $recordUid (TYPO3SniffPool.Commenting.FunctionComment.InvalidTypeHint)     
 245 | ERROR | Unknown type hint "int" found for $pageUid (TYPO3SniffPool.Commenting.FunctionComment.InvalidTypeHint)          
-------------------------------------------------------------------------------------------------------------------------------
DanielSiepmann commented 8 years ago

Looks like the failing result is not due to the change? Or someone has to help me to understand the result so I can fix the broken part.

Konafets commented 8 years ago

Thanks for the PR! It seems something is wrong with PHPCS itself. I will have a look at this and your PR as well.

DanielSiepmann commented 8 years ago

Thanks for taking a look.

I've also noticed that PHPCS or TYPO3SniffPool, don't know anymore which exactly, has issues with yield, too. So generators will also fail.