Skip to content
Snippets Groups Projects

Issue #3185419: Code style updates

Open dpi requested to merge issue/workflows_field-3185419:php-futureproof into 2.x
7 files
+ 156
102
Compare changes
  • Side-by-side
  • Inline
Files
7
<?php
declare(strict_types = 1);
namespace Drupal\workflows_field\Form;
use Drupal\Core\Form\FormStateInterface;
@@ -7,14 +9,14 @@ use Drupal\workflows\Plugin\WorkflowTypeConfigureFormBase;
use Drupal\workflows\State;
/**
* Plugin form for the workflows field.
* Plugin configuration form for the "Workflows Field" workflow type.
*/
class WorkflowTypeConfigureForm extends WorkflowTypeConfigureFormBase {
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
public function buildConfigurationForm(array $form, FormStateInterface $form_state): array {
$configuration = $this->workflowType->getConfiguration();
$form['settings'] = [
'#title' => $this->t('Workflow Settings'),
@@ -24,7 +26,7 @@ class WorkflowTypeConfigureForm extends WorkflowTypeConfigureFormBase {
$form['settings']['initial_state'] = [
'#title' => $this->t('Initial State'),
'#type' => 'select',
'#default_value' => isset($configuration['initial_state']) ? $configuration['initial_state'] : NULL,
'#default_value' => $configuration['initial_state'] ?? NULL,
'#options' => $labels,
];
return $form;
@@ -33,7 +35,7 @@ class WorkflowTypeConfigureForm extends WorkflowTypeConfigureFormBase {
/**
* {@inheritdoc}
*/
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
public function submitConfigurationForm(array &$form, FormStateInterface $form_state): void {
$configuration = $this->workflowType->getConfiguration();
$configuration['initial_state'] = $form_state->getValue(['settings', 'initial_state']);
$this->workflowType->setConfiguration($configuration);
Loading