diff --git a/core/modules/contextual/src/Element/ContextualLinks.php b/core/modules/contextual/src/Element/ContextualLinks.php index 68021aa303..62e8966afa 100644 --- a/core/modules/contextual/src/Element/ContextualLinks.php +++ b/core/modules/contextual/src/Element/ContextualLinks.php @@ -45,14 +45,14 @@ public function getInfo() { * - route_parameters: The route parameters passed to the url generator. * - metadata: Any additional data needed in order to alter the link. * @code - * ['#contextual_links' => [ - * 'block' => [ - * 'route_parameters' => ['block' => 'system.menu-tools'], - * ], - * 'menu' => [ - * 'route_parameters' => ['menu' => 'tools'], - * ], - * ]] + * array('#contextual_links' => array( + * 'block' => array( + * 'route_parameters' => array('block' => 'system.menu-tools'), + * ), + * 'menu' => array( + * 'route_parameters' => array('menu' => 'tools'), + * ), + * )) * @endcode * * @return array diff --git a/core/modules/field_ui/src/Form/EntityDisplayFormBase.php b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php index 6fe5cf17d1..0a91862b35 100644 --- a/core/modules/field_ui/src/Form/EntityDisplayFormBase.php +++ b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php @@ -76,8 +76,8 @@ public function getEntityFromRouteMatch(RouteMatchInterface $route_match, $entit * @return array * Example usage: * @code - * return [ - * 'content' => [ + * return array( + * 'content' => array( * // label for the region. * 'title' => $this->t('Content'), * // Indicates if the region is visible in the UI. @@ -85,8 +85,8 @@ public function getEntityFromRouteMatch(RouteMatchInterface $route_match, $entit * // A message to indicate that there is nothing to be displayed in * // the region. * 'message' => $this->t('No field is displayed.'), - * ], - * ]; + * ), + * ); * @endcode */ public function getRegions() { diff --git a/core/modules/migrate/src/Plugin/Migration.php b/core/modules/migrate/src/Plugin/Migration.php index a5c0252c1b..13092e7775 100644 --- a/core/modules/migrate/src/Plugin/Migration.php +++ b/core/modules/migrate/src/Plugin/Migration.php @@ -162,15 +162,15 @@ class Migration extends PluginBase implements MigrationInterface, RequirementsIn * * The migration_dependencies value is structured like this: * @code - * [ - * 'required' => [ + * array( + * 'required' => array( * // An array of migration IDs that must be run before this migration. - * ], - * 'optional' => [ + * ), + * 'optional' => array( * // An array of migration IDs that, if they exist, must be run before * // this migration. - * ], - * ]; + * ), + * ); * @endcode * * @var array diff --git a/core/modules/node/node.api.php b/core/modules/node/node.api.php index 828e50dfbf..604187406b 100644 --- a/core/modules/node/node.api.php +++ b/core/modules/node/node.api.php @@ -43,20 +43,20 @@ * access modules can also grant "view all" permission on their custom realms; * for example, a module could create a record in {node_access} with: * @code - * $record = [ + * $record = array( * 'nid' => 0, * 'gid' => 888, * 'realm' => 'example_realm', * 'grant_view' => 1, * 'grant_update' => 0, * 'grant_delete' => 0, - * ]; + * ); * db_insert('node_access')->fields($record)->execute(); * @endcode * And then in its hook_node_grants() implementation, it would need to return: * @code * if ($op == 'view') { - * $grants['example_realm'] = [888]; + * $grants['example_realm'] = array(888); * } * @endcode * If you decide to do this, be aware that the node_access_rebuild() function @@ -130,14 +130,14 @@ function hook_node_grants(\Drupal\Core\Session\AccountInterface $account, $op) { * A "deny all" grant may be used to deny all access to a particular node or * node translation: * @code - * $grants[] = [ + * $grants[] = array( * 'realm' => 'all', * 'gid' => 0, * 'grant_view' => 0, * 'grant_update' => 0, * 'grant_delete' => 0, * 'langcode' => 'ca', - * ]; + * ); * @endcode * Note that another module node access module could override this by granting * access to one or more nodes, since grants are additive. To enforce that diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module index 81fd8b0f5f..e5c67d3954 100644 --- a/core/modules/simpletest/simpletest.module +++ b/core/modules/simpletest/simpletest.module @@ -573,13 +573,13 @@ function simpletest_log_read($test_id, $database_prefix, $test_class) { * An array of tests keyed with the groups, and then keyed by test classes. * For example: * @code - * $groups['Block'] => [ - * 'BlockTestCase' => [ + * $groups['Block'] => array( + * 'BlockTestCase' => array( * 'name' => 'Block functionality', * 'description' => 'Add, edit and delete custom block.', * 'group' => 'Block', - * ], - * ]; + * ), + * ); * @endcode * * @deprecated in Drupal 8.3.x, for removal before 9.0.0 release. Use diff --git a/core/modules/simpletest/src/BlockCreationTrait.php b/core/modules/simpletest/src/BlockCreationTrait.php index bef22c5daa..b252d9e9e6 100644 --- a/core/modules/simpletest/src/BlockCreationTrait.php +++ b/core/modules/simpletest/src/BlockCreationTrait.php @@ -21,9 +21,9 @@ * Override the defaults by specifying the key and value in the array, for * example: * @code - * $this->drupalPlaceBlock('system_powered_by_block', [ + * $this->drupalPlaceBlock('system_powered_by_block', array( * 'label' => t('Hello, world!'), - * ]); + * )); * @endcode * The following defaults are provided: * - label: Random string. diff --git a/core/modules/simpletest/src/NodeCreationTrait.php b/core/modules/simpletest/src/NodeCreationTrait.php index 2a3d55534c..20dc3f8379 100644 --- a/core/modules/simpletest/src/NodeCreationTrait.php +++ b/core/modules/simpletest/src/NodeCreationTrait.php @@ -44,18 +44,18 @@ public function getNodeByTitle($title, $reset = FALSE) { * entity_create(). Override the defaults by specifying the key and value * in the array, for example: * @code - * $this->drupalCreateNode([ + * $this->drupalCreateNode(array( * 'title' => t('Hello, world!'), * 'type' => 'article', - * ]); + * )); * @endcode * The following defaults are provided: * - body: Random string using the default filter format: * @code - * $settings['body'][0] = [ + * $settings['body'][0] = array( * 'value' => $this->randomMachineName(32), * 'format' => filter_default_format(), - * ]; + * ); * @endcode * - title: Random string. * - type: 'page'. diff --git a/core/modules/simpletest/src/TestBase.php b/core/modules/simpletest/src/TestBase.php index 1a94cbdff6..0c64a14c6e 100644 --- a/core/modules/simpletest/src/TestBase.php +++ b/core/modules/simpletest/src/TestBase.php @@ -1351,18 +1351,18 @@ protected function settingsSet($name, $value) { * * Example: * @code - * $parameters = [ - * 'one' => [0, 1], - * 'two' => [2, 3], - * ]; + * $parameters = array( + * 'one' => array(0, 1), + * 'two' => array(2, 3), + * ); * $permutations = TestBase::generatePermutations($parameters); * // Result: - * $permutations == [ - * ['one' => 0, 'two' => 2], - * ['one' => 1, 'two' => 2], - * ['one' => 0, 'two' => 3], - * ['one' => 1, 'two' => 3], - * ] + * $permutations == array( + * array('one' => 0, 'two' => 2), + * array('one' => 1, 'two' => 2), + * array('one' => 0, 'two' => 3), + * array('one' => 1, 'two' => 3), + * ) * @endcode * * @param $parameters diff --git a/core/modules/simpletest/src/TestDiscovery.php b/core/modules/simpletest/src/TestDiscovery.php index ff1ca59907..5374520e56 100644 --- a/core/modules/simpletest/src/TestDiscovery.php +++ b/core/modules/simpletest/src/TestDiscovery.php @@ -143,13 +143,13 @@ public function registerTestNamespaces() { * @return array * An array of tests keyed by the the group name. * @code - * $groups['block'] => [ - * 'Drupal\block\Tests\BlockTest' => [ + * $groups['block'] => array( + * 'Drupal\block\Tests\BlockTest' => array( * 'name' => 'Drupal\block\Tests\BlockTest', * 'description' => 'Tests block UI CRUD functionality.', * 'group' => 'block', - * ], - * ]; + * ), + * ); * @endcode * * @todo Remove singular grouping; retain list of groups in 'group' key. diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php index ce5dc7eebd..eab42e9166 100644 --- a/core/modules/simpletest/src/WebTestBase.php +++ b/core/modules/simpletest/src/WebTestBase.php @@ -562,10 +562,10 @@ protected function getDatabaseTypes() { * Array of values containing the untranslated string and its translation. * For example: * @code - * [ - * '' => ['Sunday' => 'domingo'], - * 'Long month name' => ['March' => 'marzo'], - * ]; + * array( + * '' => array('Sunday' => 'domingo'), + * 'Long month name' => array('March' => 'marzo'), + * ); * @endcode * Pass an empty array to remove all existing custom translations for the * given $langcode. @@ -1002,11 +1002,11 @@ protected function drupalGetXHR($path, array $options = [], array $headers = []) * * @code * // First step in form. - * $edit = [...]; + * $edit = array(...); * $this->drupalPostForm('some_url', $edit, t('Save')); * * // Second step in form. - * $edit = [...]; + * $edit = array(...); * $this->drupalPostForm(NULL, $edit, t('Save')); * @endcode * @param $edit @@ -1030,8 +1030,8 @@ protected function drupalGetXHR($path, array $options = [], array $headers = []) * be unchecked. Multiple select fields can be tested using 'name[]' and * setting each of the desired values in an array: * @code - * $edit = []; - * $edit['name[]'] = ['value1', 'value2']; + * $edit = array(); + * $edit['name[]'] = array('value1', 'value2'); * @endcode * @param $submit * Value of the submit button whose click is to be emulated. For example, diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 4779e5992d..61faa3b4f0 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -1112,13 +1112,13 @@ function user_role_load($rid) { * Any value that evaluates to FALSE will cause the permission to be * revoked. * @code - * [ + * array( * 'administer nodes' => 0, // Revoke 'administer nodes' * 'administer blocks' => FALSE, // Revoke 'administer blocks' * 'access user profiles' => 1, // Grant 'access user profiles' * 'access content' => TRUE, // Grant 'access content' * 'access comments' => 'access comments', // Grant 'access comments' - * ] + * ) * @endcode * Existing permissions are not changed, unless specified in $permissions. * diff --git a/core/modules/views/src/Annotation/ViewsDisplay.php b/core/modules/views/src/Annotation/ViewsDisplay.php index 97aa5c7107..85887e352d 100644 --- a/core/modules/views/src/Annotation/ViewsDisplay.php +++ b/core/modules/views/src/Annotation/ViewsDisplay.php @@ -84,10 +84,10 @@ class ViewsDisplay extends ViewsPluginAnnotationBase { * A list of places where contextual links should be added. * For example: * @code - * [ + * array( * 'page', * 'block', - * ] + * ) * @endcode * * If you don't specify it there will be contextual links rendered for all diff --git a/core/modules/views/src/Plugin/Derivative/ViewsLocalTask.php b/core/modules/views/src/Plugin/Derivative/ViewsLocalTask.php index d7c40c3b42..bc6400c018 100644 --- a/core/modules/views/src/Plugin/Derivative/ViewsLocalTask.php +++ b/core/modules/views/src/Plugin/Derivative/ViewsLocalTask.php @@ -152,10 +152,10 @@ public function alterLocalTasks(&$local_tasks) { * @return array * A list of arrays containing the $view and $display_id. * @code - * [ - * [$view, $display_id], - * [$view, $display_id], - * ]; + * array( + * array($view, $display_id), + * array($view, $display_id), + * ); * @endcode */ protected function getApplicableMenuViews() { diff --git a/core/modules/views/src/Plugin/views/join/JoinPluginBase.php b/core/modules/views/src/Plugin/views/join/JoinPluginBase.php index 0f6f69b5d4..0aa6aa3b67 100644 --- a/core/modules/views/src/Plugin/views/join/JoinPluginBase.php +++ b/core/modules/views/src/Plugin/views/join/JoinPluginBase.php @@ -24,13 +24,13 @@ * @endcode * Use this configuration: * @code - * $configuration = [ + * $configuration = array( * 'table' => 'two', * 'field' => 'field_b', * 'left_table' => 'one', * 'left_field' => 'field_a', * 'operator' => '=', - * ]; + * ); * $join = Views::pluginManager('join')->createInstance('standard', $configuration); * @endcode * Note that the default join type is a LEFT join when 'type' is not supplied in @@ -42,20 +42,20 @@ * @endcode * Use this configuration: * @code - * $configuration = [ + * $configuration = array( * 'type' => 'INNER', * 'table' => 'two', * 'field' => 'field_b', * 'left_table' => 'one', * 'left_field' => 'field_a', * 'operator' => '=', - * 'extra' => [ - * 0 => [ + * 'extra' => array( + * 0 => array( * 'left_field' => 'field_c', * 'value' => 'some_val', - * ], - * ], - * ]; + * ), + * ), + * ); * $join = Views::pluginManager('join')->createInstance('standard', $configuration); * @endcode * @@ -65,20 +65,20 @@ * @endcode * Use this configuration: * @code - * $configuration = [ + * $configuration = array( * 'type' => 'INNER', * 'table' => 'two', * 'field' => 'field_b', * 'left_table' => 'one', * 'left_field' => 'field_a', * 'operator' => '=', - * 'extra' => [ - * 0 => [ + * 'extra' => array( + * 0 => array( * 'field' => 'field_d', * 'value' => 'other_val', - * ], - * ], - * ]; + * ), + * ), + * ); * $join = Views::pluginManager('join')->createInstance('standard', $configuration); * @endcode * @@ -88,20 +88,20 @@ * @endcode * Use this configuration: * @code - * $configuration = [ + * $configuration = array( * 'type' => 'INNER', * 'table' => 'two', * 'field' => 'field_b', * 'left_table' => 'one', * 'left_field' => 'field_a', * 'operator' => '=', - * 'extra' => [ - * 0 => [ + * 'extra' => array( + * 0 => array( * 'left_field' => 'field_c', * 'field' => 'field_d', - * ], - * ], - * ]; + * ), + * ), + * ); * $join = Views::pluginManager('join')->createInstance('standard', $configuration); * @endcode * diff --git a/core/modules/views/views.api.php b/core/modules/views/views.api.php index e7a55cf021..c21b9c54e8 100644 --- a/core/modules/views/views.api.php +++ b/core/modules/views/views.api.php @@ -837,7 +837,7 @@ function hook_views_pre_render(ViewExecutable $view) { * And then in the post-render, create an array with the text that should * go there: * @code - * strtr($output, ['' => 'output for FIELD of nid 1']; + * strtr($output, array('' => 'output for FIELD of nid 1'); * @endcode * All of the cached result data will be available in $view->result, as well, * so all ids used in the query should be discoverable. diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php index 72d1de1f90..41424c137f 100644 --- a/sites/default/default.settings.php +++ b/sites/default/default.settings.php @@ -154,13 +154,13 @@ * The 'default' element is mandatory and holds the prefix for any tables * not specified elsewhere in the array. Example: * @code - * 'prefix' => [ + * 'prefix' => array( * 'default' => 'main_', * 'users' => 'shared_', * 'sessions' => 'shared_', * 'role' => 'shared_', * 'authmap' => 'shared_', - * ], + * ), * @endcode * You can also use a reference to a schema/database as a prefix. This may be * useful if your Drupal installation exists in a schema that is not the default @@ -168,13 +168,13 @@ * time. * Example: * @code - * 'prefix' => [ + * 'prefix' => array( * 'default' => 'main.', * 'users' => 'shared.', * 'sessions' => 'shared.', * 'role' => 'shared.', * 'authmap' => 'shared.', - * ]; + * ); * @endcode * NOTE: MySQL and SQLite's definition of a schema is a database. * @@ -183,14 +183,14 @@ * example, to enable MySQL SELECT queries to exceed the max_join_size system * variable, and to reduce the database connection timeout to 5 seconds: * @code - * $databases['default']['default'] = [ - * 'init_commands' => [ + * $databases['default']['default'] = array( + * 'init_commands' => array( * 'big_selects' => 'SET SQL_BIG_SELECTS=1', - * ], - * 'pdo' => [ + * ), + * 'pdo' => array( * PDO::ATTR_TIMEOUT => 5, - * ], - * ]; + * ), + * ); * @endcode * * WARNING: The above defaults are designed for database portability. Changing @@ -205,22 +205,22 @@ * * Sample Database configuration format for PostgreSQL (pgsql): * @code - * $databases['default']['default'] = [ + * $databases['default']['default'] = array( * 'driver' => 'pgsql', * 'database' => 'databasename', * 'username' => 'sqlusername', * 'password' => 'sqlpassword', * 'host' => 'localhost', * 'prefix' => '', - * ]; + * ); * @endcode * * Sample Database configuration format for SQLite (sqlite): * @code - * $databases['default']['default'] = [ + * $databases['default']['default'] = array( * 'driver' => 'sqlite', * 'database' => '/path/to/databasefilename', - * ]; + * ); * @endcode */ @@ -244,9 +244,9 @@ * * Example: * @code - * $config_directories = [ + * $config_directories = array( * CONFIG_SYNC_DIRECTORY => '/directory/outside/webroot', - * ]; + * ); * @endcode */ $config_directories = []; @@ -709,9 +709,9 @@ * * For example: * @code - * $settings['trusted_host_patterns'] = [ + * $settings['trusted_host_patterns'] = array( * '^www\.example\.com$', - * ]; + * ); * @endcode * will allow the site to only run from www.example.com. * @@ -722,12 +722,12 @@ * * For example: * @code - * $settings['trusted_host_patterns'] = [ + * $settings['trusted_host_patterns'] = array( * '^example\.com$', * '^.+\.example\.com$', * '^example\.org$', * '^.+\.example\.org$', - * ]; + * ); * @endcode * will allow the site to run off of all variants of example.com and * example.org, with all subdomains included.