diff --git a/restui.module b/restui.module index 2ae34e5..0c90041 100644 --- a/restui.module +++ b/restui.module @@ -27,7 +27,7 @@ function restui_theme() { 'variables' => [ 'granularity' => [], 'configuration' => [], - ], + ], 'template' => 'restui-resource-info', ], ]; diff --git a/src/Controller/RestUIController.php b/src/Controller/RestUIController.php index f871b90..5fa3c57 100644 --- a/src/Controller/RestUIController.php +++ b/src/Controller/RestUIController.php @@ -111,12 +111,7 @@ class RestUIController implements ContainerInjectionInterface { // List of resources. foreach (['enabled', 'disabled'] as $status) { $list[$status]['#type'] = 'container'; - $list[$status]['#attributes'] = [ - 'class' => [ - 'rest-ui-list-section', - $status - ] - ]; + $list[$status]['#attributes'] = ['class' => ['rest-ui-list-section', $status]]; $list[$status]['table'] = [ '#theme' => 'table', '#header' => [ diff --git a/src/Form/RestUIForm.php b/src/Form/RestUIForm.php index caeda27..aed3a01 100644 --- a/src/Form/RestUIForm.php +++ b/src/Form/RestUIForm.php @@ -356,10 +356,7 @@ class RestUIForm extends ConfigFormBase { protected function validateFormValuesForMethodGranularity(FormStateInterface $form_state) { // At least one method must be checked. $method_checked = FALSE; - foreach ($form_state->getValue([ - 'wrapper', - 'methods' - ]) as $method => $values) { + foreach ($form_state->getValue(['wrapper', 'methods']) as $method => $values) { if ($values[$method]) { $method_checked = TRUE; // At least one format and authentication provider must be selected. diff --git a/tests/src/Functional/RestUITest.php b/tests/src/Functional/RestUITest.php index 9bf8f5a..2f5d9d2 100644 --- a/tests/src/Functional/RestUITest.php +++ b/tests/src/Functional/RestUITest.php @@ -49,14 +49,12 @@ class RestUITest extends JavascriptTestBase { // Assert that the 'resource' configuration form is build as default. $this->assertSession()->fieldExists('wrapper[settings][methods][GET]'); $this->assertSession()->fieldExists('wrapper[settings][formats][json]'); - $this->assertSession() - ->fieldExists('wrapper[settings][authentication][cookie]'); + $this->assertSession()->fieldExists('wrapper[settings][authentication][cookie]'); // Method granularity. // Adjust the node resource so it allows GET method with JSON format and // Cookie authentication. - $page->findField('granularity') - ->selectOption(RestResourceConfigInterface::METHOD_GRANULARITY); + $page->findField('granularity')->selectOption(RestResourceConfigInterface::METHOD_GRANULARITY); $this->assertSession()->waitForField('wrapper[methods][GET]'); $page->findField('wrapper[methods][GET][GET]')->check(); $page->findField('wrapper[methods][GET][settings][formats][json]')->check(); @@ -71,8 +69,7 @@ class RestUITest extends JavascriptTestBase { $this->drupalGet('admin/config/services/rest/resource/entity%3Anode/edit'); $page = $this->getSession()->getPage(); - $page->findField('granularity') - ->selectOption(RestResourceConfigInterface::RESOURCE_GRANULARITY); + $page->findField('granularity')->selectOption(RestResourceConfigInterface::RESOURCE_GRANULARITY); $this->assertSession()->waitForField('wrapper[settings][methods][GET]'); $page->findField('wrapper[settings][methods][GET]')->check(); $page->findField('wrapper[settings][formats][json]')->check();