diff --git a/core/modules/block/custom_block/custom_block.module b/core/modules/block/custom_block/custom_block.module index bfe5a39..d682efd 100644 --- a/core/modules/block/custom_block/custom_block.module +++ b/core/modules/block/custom_block/custom_block.module @@ -80,7 +80,7 @@ function custom_block_load($id) { * Implements hook_entity_type_alter(). */ function custom_block_entity_type_alter(array &$entity_types) { - /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */ + // @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] // Add a translation handler for fields if the language module is enabled. if (\Drupal::moduleHandler()->moduleExists('language')) { $translation = $entity_types['custom_block']->get('translation'); diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTranslationUITest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTranslationUITest.php index 9ad6a96..6a4c97d 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTranslationUITest.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTranslationUITest.php @@ -21,9 +21,7 @@ class CustomBlockTranslationUITest extends ContentTranslationUITest { protected $name; /** - * Modules to enable. - * - * @var array + * {@inheritdoc} */ public static $modules = array( 'language', @@ -45,7 +43,7 @@ public static function getInfo() { } /** - * Overrides \Drupal\simpletest\WebTestBase::setUp(). + * {@inheritdoc} */ public function setUp() { $this->entityTypeId = 'custom_block'; @@ -56,7 +54,7 @@ public function setUp() { } /** - * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getTranslatorPermission(). + * {@inheritdoc} */ public function getTranslatorPermissions() { return array_merge(parent::getTranslatorPermissions(), array( @@ -93,14 +91,14 @@ protected function createCustomBlock($title = FALSE, $bundle = FALSE) { } /** - * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getNewEntityValues(). + * {@inheritdoc} */ protected function getNewEntityValues($langcode) { return array('info' => $this->name) + parent::getNewEntityValues($langcode); } /** - * Returns an edit array containing the values to be posted. + * {@inheritdoc} */ protected function getEditValues($values, $langcode, $new = FALSE) { $edit = parent::getEditValues($values, $langcode, $new); diff --git a/core/modules/block/custom_block/tests/modules/custom_block_test/custom_block_test.module b/core/modules/block/custom_block/tests/modules/custom_block_test/custom_block_test.module index 8c53053..8038925 100644 --- a/core/modules/block/custom_block/tests/modules/custom_block_test/custom_block_test.module +++ b/core/modules/block/custom_block/tests/modules/custom_block_test/custom_block_test.module @@ -25,12 +25,12 @@ function custom_block_test_custom_block_view(CustomBlock $custom_block, $view_mo */ function custom_block_test_custom_block_presave(CustomBlock $custom_block) { if ($custom_block->label() == 'testing_custom_block_presave') { - $custom_block->setInfo($custom_block->label() .'_presave'); + $custom_block->setInfo($custom_block->label() . '_presave'); } // Determine changes. if (!empty($custom_block->original) && $custom_block->original->label() == 'test_changes') { if ($custom_block->original->label() != $custom_block->label()) { - $custom_block->setInfo($custom_block->label() .'_presave'); + $custom_block->setInfo($custom_block->label() . '_presave'); // Drupal 1.0 release. $custom_block->changed = 979534800; } @@ -44,7 +44,7 @@ function custom_block_test_custom_block_update(CustomBlock $custom_block) { // Determine changes on update. if (!empty($custom_block->original) && $custom_block->original->label() == 'test_changes') { if ($custom_block->original->label() != $custom_block->label()) { - $custom_block->setInfo($custom_block->label() .'_update'); + $custom_block->setInfo($custom_block->label() . '_update'); } } } diff --git a/core/modules/block/lib/Drupal/block/BlockFormController.php b/core/modules/block/lib/Drupal/block/BlockFormController.php index 6fd2c40..207d165 100644 --- a/core/modules/block/lib/Drupal/block/BlockFormController.php +++ b/core/modules/block/lib/Drupal/block/BlockFormController.php @@ -148,14 +148,10 @@ public function form(array $form, array &$form_state) { BLOCK_VISIBILITY_NOTLISTED => $this->t('All pages except those listed'), BLOCK_VISIBILITY_LISTED => $this->t('Only the listed pages'), ); - $description = $this->t(" - Specify pages by using their paths. Enter one path per line. - The '*' character is a wildcard. Example paths are %user for the current - user's page and %user-wildcard for every user page. %front is the front page.", - array( - '%user' => 'user', - '%user-wildcard' => 'user/*', '%front' => '') - ); + $description = $this->t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %user for the current user's page and %user-wildcard for every user page. %front is the front page.", array( + '%user' => 'user', + '%user-wildcard' => 'user/*', '%front' => '', + )); $form['visibility']['path']['visibility'] = array( '#type' => 'radios', diff --git a/core/modules/block/lib/Drupal/block/BlockListBuilder.php b/core/modules/block/lib/Drupal/block/BlockListBuilder.php index 81ecebd..aa40a4e 100644 --- a/core/modules/block/lib/Drupal/block/BlockListBuilder.php +++ b/core/modules/block/lib/Drupal/block/BlockListBuilder.php @@ -336,9 +336,9 @@ public function buildForm(array $form, array &$form_state) { // Sort the plugins first by category, then by label. $plugins = $this->blockManager->getDefinitions(); uasort($plugins, function ($a, $b) { - if ($a['category'] != $b['category']) { - return strnatcasecmp($a['category'], $b['category']); - } + if ($a['category'] != $b['category']) { + return strnatcasecmp($a['category'], $b['category']); + } return strnatcasecmp($a['admin_label'], $b['admin_label']); }); foreach ($plugins as $plugin_id => $plugin_definition) { diff --git a/core/modules/block/lib/Drupal/block/Entity/Block.php b/core/modules/block/lib/Drupal/block/Entity/Block.php index d42f444..03664fa 100644 --- a/core/modules/block/lib/Drupal/block/Entity/Block.php +++ b/core/modules/block/lib/Drupal/block/Entity/Block.php @@ -116,7 +116,7 @@ public function getPluginBag() { } /** - * Overrides \Drupal\Core\Entity\Entity::label(). + * {@inheritdoc} */ public function label() { $settings = $this->get('settings'); diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockInterfaceTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockInterfaceTest.php index 5ab3e3b..5ea01cb 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockInterfaceTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockInterfaceTest.php @@ -67,8 +67,21 @@ public function testBlockInterface() { $definition = $display_block->getPluginDefinition(); $period = array( - 0, 60, 180, 300, 600, 900, 1800, 2700, 3600, - 10800, 21600, 32400, 43200, 86400); + 0, + 60, + 180, + 300, + 600, + 900, + 1800, + 2700, + 3600, + 10800, + 21600, + 32400, + 43200, + 86400, + ); $period = array_map('format_interval', array_combine($period, $period)); $period[0] = '<' . t('no caching') . '>'; $period[\Drupal\Core\Cache\Cache::PERMANENT] = t('Forever'); diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php index e7b9553..be4ee54 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php @@ -44,10 +44,11 @@ protected function setUp() { parent::setUp(); // Create a new user, allow him to manage the blocks and the languages. - $this->adminUser = $this->drupalCreateUser( - array('administer blocks', - 'administer languages', 'administer site configuration') - ); + $this->adminUser = $this->drupalCreateUser(array( + 'administer blocks', + 'administer languages', + 'administer site configuration', + )); $this->drupalLogin($this->adminUser); // Add predefined language. diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php index a06ab2e..2e90d49 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php @@ -141,10 +141,9 @@ public function testBlock() { $this->assertNoText($block['settings[label]']); // Check for
if the machine name // is my_block_instance_name. - $xpath = $this->buildXPathQuery('//div[@id=:id]/*', - array( - ':id' => 'block-' . str_replace('_', '-', strtolower($block['id']))) - ); + $xpath = $this->buildXPathQuery('//div[@id=:id]/*', array( + ':id' => 'block-' . str_replace('_', '-', strtolower($block['id'])), + )); $this->assertNoFieldByXPath($xpath, FALSE, 'Block found in no regions.'); // Test deleting the block from the edit form. diff --git a/core/modules/block/tests/Drupal/block/Tests/Menu/BlockLocalTasksTest.php b/core/modules/block/tests/Drupal/block/Tests/Menu/BlockLocalTasksTest.php index 9e05e41..e15b4c2 100644 --- a/core/modules/block/tests/Drupal/block/Tests/Menu/BlockLocalTasksTest.php +++ b/core/modules/block/tests/Drupal/block/Tests/Menu/BlockLocalTasksTest.php @@ -90,13 +90,15 @@ public function providerTestBlockAdminDisplay() { 'block.admin_display', array( array('block.admin_display'), - array('block.admin_display_theme:test_b', 'block.admin_display_theme:test_c')), + array('block.admin_display_theme:test_b', 'block.admin_display_theme:test_c'), + ), ), array( 'block.admin_display_theme', array( array('block.admin_display'), - array('block.admin_display_theme:test_b', 'block.admin_display_theme:test_c')), + array('block.admin_display_theme:test_b', 'block.admin_display_theme:test_c'), + ), ), ); } diff --git a/core/modules/block/tests/modules/block_test/block_test.module b/core/modules/block/tests/modules/block_test/block_test.module index d840cca..f985a42 100644 --- a/core/modules/block/tests/modules/block_test/block_test.module +++ b/core/modules/block/tests/modules/block_test/block_test.module @@ -2,7 +2,7 @@ /** * @file - * Provide test blocks. + * Provide test blocks. */ use Drupal\block\BlockPluginInterface; @@ -35,7 +35,7 @@ function block_test_block_view_test_cache_alter(array &$build, BlockPluginInterf } /** - * #pre_render callback for a block to alter its content. + * The #pre_render callback for a block to alter its content. */ function block_test_pre_render_alter_content($build) { $build['#prefix'] = 'Hiya!
';