Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
workflow
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
workflow
Commits
6765e10e
Commit
6765e10e
authored
1 year ago
by
John Voskuilen
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2919482
: phpcs - hook implementation documentation
parent
00a70da3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#90621
passed with warnings
1 year ago
Stage: build
Stage: validate
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/workflow_devel/workflow_devel.module
+32
-34
32 additions, 34 deletions
modules/workflow_devel/workflow_devel.module
with
32 additions
and
34 deletions
modules/workflow_devel/workflow_devel.module
+
32
−
34
View file @
6765e10e
...
...
@@ -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());
}
/**
*
{@
in
h
er
itdoc}
*
Implements hook_entity_
in
s
er
t().
*/
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
());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment