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

lars toomre’s picture

Title: Make sure @param type used in function definition (as appropriate) » Ensure @param array type used in function definition (as appropriate)

Clarifying the title...

lars toomre’s picture

Issue summary: View changes

Updated issue summary.

klausi’s picture

Component: Code Sniffer » Coder Sniffer
Issue summary: View changes
Status: Active » Closed (duplicate)