bad.module in Coder 8.2
Bad examples of install hooks in a module file.
File
coder_sniffer/Drupal/Test/bad/bad.moduleView source
<?php
/**
* @file
* Bad examples of install hooks in a module file.
*/
define('UNPREFIXED_CONSTANT', 'invalid');
/**
* Implements hook_install().
*/
function bad_install() {
return TRUE;
}
/**
* Implements hook_uninstall().
*/
function bad_uninstall() {
return TRUE;
}
/**
* Implements hook_install().
*/
function bad_schema() {
return TRUE;
}
/**
* Implements hook_install().
*/
function bad_requirements() {
return TRUE;
}
/**
* Implements hook_menu().
*
* Menu title and description should be untranslated.
*/
function bad_menu() {
$items['example'] = array(
'title' => t('Example Page'),
'description' => t('My example module page that does something.'),
'page callback' => 'example_page',
'access arguments' => array(
'access content',
),
'type' => MENU_SUGGESTED_ITEM,
);
return $items;
}
Functions
Name | Description |
---|---|
bad_install | Implements hook_install(). |
bad_menu | Implements hook_menu(). |
bad_requirements | Implements hook_install(). |
bad_schema | Implements hook_install(). |
bad_uninstall | Implements hook_uninstall(). |
Constants
Name | Description |
---|---|
UNPREFIXED_CONSTANT | @file Bad examples of install hooks in a module file. |