Skip to content

Instantly share code, notes, and snippets.

@Mizpah
Created November 26, 2014 06:41
Show Gist options
  • Save Mizpah/af902c3d2a2d19b54bbd to your computer and use it in GitHub Desktop.
Save Mizpah/af902c3d2a2d19b54bbd to your computer and use it in GitHub Desktop.
The array, returning an error from code sniffer
/**
* Implements hook_node_info().
*/
function genima_log_node_info() {
// Returns an array defining a new node type.
return array(
'logged_item' => array(
'name' => t('Logged Item'),
'base' => 'genima_logged_item',
'description' => t('A content type for logging items for use in Genima Log'),
'help' => t('Add logged items, actions, notes, bugs and fixes here'),
'has_title' => TRUE,
'title_label' => t('Logged entry title'),
'locked' = TRUE,
),
);
}
@Mizpah
Copy link
Author

Mizpah commented Nov 26, 2014

Whats the cause / fix to this?

The code above follow this example:
https://api.drupal.org/api/drupal/modules%21node%21node.api.php/function/hook_node_info/7

Am trying to work out why code sniffer (with Drupal standards is getting upset) ?!

PHP_CodeSniffer found at least one issue. [error]
Martins-MacBook-Pro-2:genimalog martindean$ drush dcs

FILE: ...Sites/drupal-core/sites/all/modules/custom/genima_log/genima_log.module

FOUND 1 ERROR(S) AFFECTING 1 LINE(S)

35 | ERROR | No key specified for array entry; first entry specifies key

@iamsumit
Copy link

Change 'locked' = TRUE, to 'locked' => TRUE,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment