This is a follow-up as the result of a patch review in #1818016-7: Make Breakpoint module pass Coder Review point 4). That addressed the following code in core's Breakpoint module:
/**
* Import breakpoints from all new enabled themes.
*
* @param array $theme_list
* An array of theme names.
*/
function _breakpoint_theme_enabled($theme_list) {As I stated in that review, I was surprised that the Coder review report was not highlighting this as an item that needed review. My understanding is that the correct function definition in this example is 'function _breakpoint_theme_enabled(array $theme_list) {'.
The purpose of this issue is create a sniff that will identify this type of inconsistency in the future. Maybe this issue should only focus on the array and object types.
Namespaced objects probably require a different sniff to make sure that they are using either the namespaced object and/or ideally an interface class.
Comments
Comment #1
lars toomre commentedClarifying the title...
Comment #1.0
lars toomre commentedUpdated issue summary.
Comment #2
klausiDuplicate of #2560651: PHP_Codesniffer flagging 'Type hint "array" missing...' but type hints not a standard