Skip to content
Snippets Groups Projects
Commit 6765e10e authored by John Voskuilen's avatar John Voskuilen
Browse files

Issue #2919482: phpcs - hook implementation documentation

parent 00a70da3
Branches
Tags
No related merge requests found
Pipeline #90621 passed with warnings
......@@ -2,7 +2,7 @@
/**
* @file
* Development tools for Workflow.
* Development tools for Workflow module.
*/
use Drupal\Core\Entity\EntityInterface;
......@@ -15,17 +15,7 @@ use Drupal\workflow\Entity\WorkflowTransitionInterface;
/* Hooks defined by workflow module. */
/**
* {@inheritdoc}
*/
function workflow_devel_workflow_operations($op, EntityInterface $entity = NULL) {
workflow_debug(__FILE__, __FUNCTION__, __LINE__, $op, '');
return hook_workflow_operations($op, $entity);
}
/* Hooks defined by workflow module. */
/**
* {@inheritdoc}
* Implements hook_workflow().
*/
function workflow_devel_workflow($op, WorkflowTransitionInterface $transition, UserInterface $user) {
workflow_debug(__FILE__, __FUNCTION__, __LINE__, $op, '');
......@@ -33,7 +23,7 @@ function workflow_devel_workflow($op, WorkflowTransitionInterface $transition, U
}
/**
* {@inheritdoc}
* Implements hook_workflow_comment_alter().
*/
function workflow_devel_workflow_comment_alter(&$comment, array &$context) {
workflow_debug(__FILE__, __FUNCTION__, __LINE__, $comment, '');
......@@ -41,7 +31,7 @@ function workflow_devel_workflow_comment_alter(&$comment, array &$context) {
}
/**
* {@inheritdoc}
* Implements hook_workflow_history_alter().
*/
function workflow_devel_workflow_history_alter(array &$context) {
workflow_debug(__FILE__, __FUNCTION__, __LINE__);
......@@ -49,7 +39,15 @@ function workflow_devel_workflow_history_alter(array &$context) {
}
/**
* {@inheritdoc}
* Implements hook_workflow_operations().
*/
function workflow_devel_workflow_operations($op, EntityInterface $entity = NULL) {
workflow_debug(__FILE__, __FUNCTION__, __LINE__, $op, '');
return hook_workflow_operations($op, $entity);
}
/**
* Implements hook_workflow_permitted_state_transitions_alter().
*/
function workflow_devel_workflow_permitted_state_transitions_alter(array &$transitions, array $context) {
workflow_debug(__FILE__, __FUNCTION__, __LINE__);
......@@ -82,15 +80,7 @@ function workflow_devel_field_widget_workflow_default_form_alter(&$element, Form
}
/**
* {@inheritdoc}
*/
function workflow_devel_form_workflow_transition_form_alter(&$form, FormStateInterface $form_state, $form_id) {
workflow_debug(__FILE__, __FUNCTION__, __LINE__, $form_id, '');
hook_form_workflow_transition_form_alter($form, $form_state, $form_id);
}
/**
* {@inheritdoc}
* Implements hook_form_alter().
*/
function workflow_devel_form_alter(&$form, FormStateInterface $form_state, $form_id) {
if (substr($form_id, 0, 8) == 'workflow') {
......@@ -99,6 +89,14 @@ function workflow_devel_form_alter(&$form, FormStateInterface $form_state, $form
hook_form_alter($form, $form_state, $form_id);
}
/**
* Implements hook_form_FORM_ID_alter() for 'workflow_transition_form'.
*/
function workflow_devel_form_workflow_transition_form_alter(&$form, FormStateInterface $form_state, $form_id) {
workflow_debug(__FILE__, __FUNCTION__, __LINE__, $form_id, '');
hook_form_workflow_transition_form_alter($form, $form_state, $form_id);
}
/**
* Hooks defined by core: Change the operations column in an Entity list.
*
......@@ -127,35 +125,35 @@ function workflow_devel_entity_operation_alter(array $operations, EntityInterfac
*/
/**
* {@inheritdoc}
* Implements hook_entity_create().
*/
function workflow_devel_entity_create(EntityInterface $entity) {
// workflow_debug(__FILE__, __FUNCTION__, __LINE__, 'create', $entity->getEntityTypeId());
}
/**
* {@inheritdoc}
* Implements hook_entity_insert().
*/
function workflow_devel_entity_presave(EntityInterface $entity) {
workflow_debug(__FILE__, __FUNCTION__, __LINE__, 'presave', $entity->getEntityTypeId());
function workflow_devel_entity_insert(EntityInterface $entity) {
workflow_debug(__FILE__, __FUNCTION__, __LINE__, 'insert', $entity->getEntityTypeId());
}
/**
* {@inheritdoc}
* Implements hook_entity_presave().
*/
function workflow_devel_entity_insert(EntityInterface $entity) {
workflow_debug(__FILE__, __FUNCTION__, __LINE__, 'insert', $entity->getEntityTypeId());
function workflow_devel_entity_presave(EntityInterface $entity) {
workflow_debug(__FILE__, __FUNCTION__, __LINE__, 'presave', $entity->getEntityTypeId());
}
/**
* {@inheritdoc}
* Implements hook_entity_update().
*/
function workflow_devel_entity_update(EntityInterface $entity) {
workflow_debug(__FILE__, __FUNCTION__, __LINE__, 'update', $entity->getEntityTypeId());
}
/**
* {@inheritdoc}
* Implements hook_entity_predelete().
*/
function workflow_devel_entity_predelete(EntityInterface $entity) {
if (substr($entity->getEntityTypeId(), 0, 8) == 'workflow') {
......@@ -165,7 +163,7 @@ function workflow_devel_entity_predelete(EntityInterface $entity) {
}
/**
* {@inheritdoc}
* Implements hook_entity_delete().
*/
function workflow_devel_entity_delete(EntityInterface $entity) {
workflow_debug(__FILE__, __FUNCTION__, __LINE__, 'delete', $entity->getEntityTypeId());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment