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
00a70da3
Commit
00a70da3
authored
1 year ago
by
John Voskuilen
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2919482
: phpcs
parent
8d84f589
No related branches found
No related tags found
No related merge requests found
Pipeline
#90393
passed with warnings
1 year ago
Stage: build
Stage: validate
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Entity/WorkflowManagerInterface.php
+21
-1
21 additions, 1 deletion
src/Entity/WorkflowManagerInterface.php
src/WorkflowTransitionListBuilder.php
+6
-4
6 additions, 4 deletions
src/WorkflowTransitionListBuilder.php
with
27 additions
and
5 deletions
src/Entity/WorkflowManagerInterface.php
+
21
−
1
View file @
00a70da3
...
...
@@ -18,7 +18,9 @@ interface WorkflowManagerInterface {
* Implements hook_cron().
*
* @param int $start
* The start time in unix timestamp.
* @param int $end
* The end time in unix timestamp.
*/
public
static
function
executeScheduledTransitionsBetween
(
$start
=
0
,
$end
=
0
);
...
...
@@ -35,6 +37,7 @@ interface WorkflowManagerInterface {
* This is referenced in from WorkflowDefaultWidget::massageFormValues().
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity.
*/
public
static
function
executeTransitionsOfEntity
(
EntityInterface
$entity
);
...
...
@@ -48,6 +51,7 @@ interface WorkflowManagerInterface {
* Make sure some roles are allowed to participate in a Workflow by default.
*
* @param \Drupal\Core\Entity\EntityInterface $workflow
* The workflow object.
*/
public
static
function
participateUserRoles
(
EntityInterface
$workflow
);
...
...
@@ -55,6 +59,7 @@ interface WorkflowManagerInterface {
* Implements hook_user_delete().
*
* @param \Drupal\Core\Session\AccountInterface $account
* The user account.
*/
public
static
function
deleteUser
(
AccountInterface
$account
);
...
...
@@ -71,8 +76,11 @@ interface WorkflowManagerInterface {
* "This action cannot be undone.
*
* @param $edit
* Not used.
* @param \Drupal\Core\Session\AccountInterface $account
* The user account.
* @param string $method
* The cancellation method.
*/
public
static
function
cancelUser
(
$edit
,
AccountInterface
$account
,
$method
);
...
...
@@ -82,7 +90,6 @@ interface WorkflowManagerInterface {
/**
* Utility function to return an array of workflow fields.
* Call \Drupal::service('workflow.manager')->getFieldMap($entity_type_id);
*
* @param string $entity_type_id
* The content entity type to which the workflow fields are attached.
...
...
@@ -104,8 +111,11 @@ interface WorkflowManagerInterface {
* Gets the TransitionWidget in a form (for e.g., Workflow History Tab)
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity.
* @param string $field_name
* The field name.
* @param array $form_state_additions
* Spome additions.
*
* @return array
* The form.
...
...
@@ -116,9 +126,12 @@ interface WorkflowManagerInterface {
* Returns the attached fields (via Field UI)
*
* @param string $entity_type_id
* The entity type ID.
* @param string $bundle
* The entity bundle.
*
* @return array
* A keyed list of Field configurations
*/
public
static
function
getAttachedFields
(
$entity_type_id
,
$bundle
);
...
...
@@ -145,7 +158,9 @@ interface WorkflowManagerInterface {
* Gets the previous state ID of a given entity.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity.
* @param string $field_name
* The field name.
*
* @return string
* The ID of the previous state.
...
...
@@ -156,9 +171,12 @@ interface WorkflowManagerInterface {
* Determine if User is owner/author of the entity.
*
* @param \Drupal\Core\Session\AccountInterface $account
* The user account.
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity.
*
* @return bool
* TRUE is user is owner of the entity.
*/
public
static
function
isOwner
(
AccountInterface
$account
,
EntityInterface
$entity
=
NULL
);
...
...
@@ -166,8 +184,10 @@ interface WorkflowManagerInterface {
* Determine if the entity is Workflow* entity type.
*
* @param string $entity_type_id
* The entity type ID.
*
* @return bool
* TRUE, if the entity is defined by workflow module.
*
* @usage Use it when a function should not operate on Workflow objects.
*/
...
...
This diff is collapsed.
Click to expand it.
src/WorkflowTransitionListBuilder.php
+
6
−
4
View file @
00a70da3
...
...
@@ -195,7 +195,8 @@ class WorkflowTransitionListBuilder extends EntityListBuilder {
'class' => ['footer-class'],
'data' => [
[
'data' => self::WORKFLOW_MARK_STATE_IS_DELETED . ' ' . $this->t('State is no longer available.'),
'data' => self::WORKFLOW_MARK_STATE_IS_DELETED . ' '
. $this->t('State is no longer available.'),
'colspan' => count($build['table']['#header']),
],
],
...
...
@@ -203,7 +204,8 @@ class WorkflowTransitionListBuilder extends EntityListBuilder {
];
*/
$build
[
'workflow_footer'
]
=
[
'#markup'
=>
self
::
WORKFLOW_MARK_STATE_IS_DELETED
.
' '
.
$this
->
t
(
'State is no longer available.'
),
'#markup'
=>
self
::
WORKFLOW_MARK_STATE_IS_DELETED
.
' '
.
$this
->
t
(
'State is no longer available.'
),
'#weight'
=>
500
,
// @todo Make this better.
];
}
...
...
@@ -238,7 +240,7 @@ class WorkflowTransitionListBuilder extends EntityListBuilder {
/**
* Sets the target entity.
*
* @return WorkflowTransitionListBuilder
* @return
\Drupal\workflow\
WorkflowTransitionListBuilder
* The object itself.
*/
public
function
setTargetEntity
(
EntityInterface
$entity
)
{
...
...
@@ -249,7 +251,7 @@ class WorkflowTransitionListBuilder extends EntityListBuilder {
/**
* Gets the target entity.
*
* @return EntityInterface
* @return
\Drupal\Core\Entity\
EntityInterface
* The entity.
*/
public
function
getTargetEntity
()
{
...
...
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