diff -u b/core/modules/block/lib/Drupal/block/BlockBase.php b/core/modules/block/lib/Drupal/block/BlockBase.php --- b/core/modules/block/lib/Drupal/block/BlockBase.php +++ b/core/modules/block/lib/Drupal/block/BlockBase.php @@ -130,7 +130,8 @@ ); // Identical options to the ones for page caching. // @see \Drupal\system\Form\PerformanceForm::buildForm() - $period = array(0, 60, 180, 300, 600, 900, 1800, 2700, 3600, 10800, 21600, 32400, 43200, 86400); + $period = array(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 -u b/core/modules/block/lib/Drupal/block/BlockFormController.php b/core/modules/block/lib/Drupal/block/BlockFormController.php --- b/core/modules/block/lib/Drupal/block/BlockFormController.php +++ b/core/modules/block/lib/Drupal/block/BlockFormController.php @@ -146,7 +146,14 @@ 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 -u b/core/modules/block/lib/Drupal/block/Tests/BlockInterfaceTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockInterfaceTest.php --- b/core/modules/block/lib/Drupal/block/Tests/BlockInterfaceTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockInterfaceTest.php @@ -66,7 +66,9 @@ $this->assertIdentical($display_block->getConfiguration(), $expected_configuration, 'The block configuration was updated correctly.'); $definition = $display_block->getPluginDefinition(); - $period = array(0, 60, 180, 300, 600, 900, 1800, 2700, 3600, 10800, 21600, 32400, 43200, 86400); + $period = array( + 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 -u b/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php --- b/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php @@ -44,7 +44,10 @@ 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 -u b/core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php --- b/core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php @@ -55,7 +55,10 @@ $variables['elements']['#derivative_plugin_id'] = $plugin->getDerivativeId(); $variables['elements']['content'] = array(); $suggestions = block_theme_suggestions_block($variables); - $this->assertEqual($suggestions, array('block__system', 'block__system_menu_block', 'block__system_menu_block__admin', 'block__machinename')); + $this->assertEqual($suggestions, array( + 'block__system', + 'block__system_menu_block', + 'block__system_menu_block__admin', 'block__machinename')); } } diff -u b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php --- b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php @@ -111,7 +111,12 @@ // Set block title to confirm that interface works and override any custom // titles. - $this->drupalPostForm('admin/structure/block/add/' . $block['id'] . '/' . $block['theme'], array('settings[label]' => $block['settings[label]'], 'id' => $block['id'], 'region' => $block['region']), t('Save block')); + $this->drupalPostForm( + 'admin/structure/block/add/' . $block['id'] . '/' . $block['theme'], + array( + 'settings[label]' => $block['settings[label]'], + 'id' => $block['id'], 'region' => $block['region']), t('Save block') + ); $this->assertText(t('The block configuration has been saved.'), 'Block title set.'); // Check to see if the block was created by checking its configuration. $instance = entity_load('block', $block['id']); @@ -133,10 +138,13 @@ // Confirm that the block instance title and markup are not displayed. $this->drupalGet('node'); - $this->assertNoText(t('@label', array('@label' => $block['settings[label]']))); + $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 -u b/core/modules/block/lib/Drupal/block/Tests/BlockViewBuilderTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockViewBuilderTest.php --- b/core/modules/block/lib/Drupal/block/Tests/BlockViewBuilderTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockViewBuilderTest.php @@ -220,8 +220,13 @@ $request_method = \Drupal::request()->server->get('REQUEST_METHOD'); $this->container->get('request')->setMethod('GET'); - $default_keys = array('entity_view', 'block', 'test_block', 'en', 'cache_context.theme'); - $default_tags = array('content' => TRUE, 'block_view' => TRUE, 'block' => array('test_block'), 'block_plugin' => array('test_cache')); + $default_keys = array( + 'entity_view', + 'block', 'test_block', 'en', 'cache_context.theme'); + $default_tags = array( + 'content' => TRUE, + 'block_view' => TRUE, + 'block' => array('test_block'), 'block_plugin' => array('test_cache')); // Advanced: cached block, but an alter hook adds an additional cache key. $this->setBlockCacheConfig(array( @@ -236,7 +241,9 @@ $this->assertIdentical(drupal_render($build), ''); $cache_entry = $this->container->get('cache.render')->get($cid); $this->assertTrue($cache_entry, 'The block render element has been cached with the expected cache ID.'); - $expected_flattened_tags = array('content:1', 'block_view:1', 'block:test_block', 'block_plugin:test_cache'); + $expected_flattened_tags = array( + 'content:1', + 'block_view:1', 'block:test_block', 'block_plugin:test_cache'); // The block render element has been cached with the expected cache tags. $this->assertIdentical($cache_entry->tags, array_combine($expected_flattened_tags, $expected_flattened_tags)); @@ -252,7 +259,10 @@ $this->assertIdentical(drupal_render($build), ''); $cache_entry = $this->container->get('cache.render')->get($cid); $this->assertTrue($cache_entry, 'The block render element has been cached with the expected cache ID.'); - $expected_flattened_tags = array('content:1', 'block_view:1', 'block:test_block', 'block_plugin:test_cache', $alter_add_tag . ':1'); + $expected_flattened_tags = array( + 'content:1', + 'block_view:1', + 'block:test_block', 'block_plugin:test_cache', $alter_add_tag . ':1'); // The block render element has been cached with the expected cache tags. $this->assertIdentical($cache_entry->tags, array_combine($expected_flattened_tags, $expected_flattened_tags)); diff -u b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php --- b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php @@ -26,7 +26,12 @@ * * @var array */ - public static $modules = array('node', 'block_test_views', 'test_page_test', 'contextual', 'views_ui'); + public static $modules = array( + 'node', + 'block_test_views', + 'test_page_test', + 'contextual', + 'views_ui'); /** * Views used by this test. @@ -274,7 +279,9 @@ * Tests the contextual links on a Views block. */ public function testBlockContextualLinks() { - $this->drupalLogin($this->drupalCreateUser(array('administer views', 'access contextual links', 'administer blocks'))); + $this->drupalLogin($this->drupalCreateUser(array( + 'administer views', + 'access contextual links', 'administer blocks'))); $block = $this->drupalPlaceBlock('views_block:test_view_block-block_1'); $cached_block = $this->drupalPlaceBlock('views_block:test_view_block-block_1', array('cache' => array('max_age' => 3600))); $this->drupalGet('test-page'); diff -u b/core/modules/block/tests/Drupal/block/Tests/BlockFormControllerTest.php b/core/modules/block/tests/Drupal/block/Tests/BlockFormControllerTest.php --- b/core/modules/block/tests/Drupal/block/Tests/BlockFormControllerTest.php +++ b/core/modules/block/tests/Drupal/block/Tests/BlockFormControllerTest.php @@ -48,7 +48,11 @@ $query->expects($this->exactly(5)) ->method('execute') - ->will($this->returnValue(array('test', 'other_test', 'other_test_1', 'other_test_2'))); + ->will($this->returnValue(array( + 'test', + 'other_test', + 'other_test_1', + 'other_test_2'))); $block_storage = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityStorageInterface'); $block_storage->expects($this->exactly(5)) diff -u b/core/modules/block/tests/Drupal/block/Tests/Menu/BlockLocalTasksTest.php b/core/modules/block/tests/Drupal/block/Tests/Menu/BlockLocalTasksTest.php --- b/core/modules/block/tests/Drupal/block/Tests/Menu/BlockLocalTasksTest.php +++ b/core/modules/block/tests/Drupal/block/Tests/Menu/BlockLocalTasksTest.php @@ -86,8 +86,18 @@ */ public function providerTestBlockAdminDisplay() { return array( - array('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', array(array('block.admin_display'), array('block.admin_display_theme:test_b', 'block.admin_display_theme:test_c'))), + array( + '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', + array( + array('block.admin_display'), + array('block.admin_display_theme:test_b', 'block.admin_display_theme:test_c')), + ), ); } only in patch2: unchanged: --- 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) { only in patch2: unchanged: --- a/core/modules/block/lib/Drupal/block/BlockPluginBag.php +++ b/core/modules/block/lib/Drupal/block/BlockPluginBag.php @@ -46,6 +46,7 @@ public function __construct(PluginManagerInterface $manager, $instance_id, array * {@inheritdoc} * * @return \Drupal\block\BlockPluginInterface + * Retrieves a plugin instance, initializing it if necessary. */ public function &get($instance_id) { return parent::get($instance_id);