diff --git a/core/lib/Drupal/Core/Archiver/ArchiveTar.php b/core/lib/Drupal/Core/Archiver/ArchiveTar.php index 24085cea9f..30b9760322 100644 --- a/core/lib/Drupal/Core/Archiver/ArchiveTar.php +++ b/core/lib/Drupal/Core/Archiver/ArchiveTar.php @@ -369,7 +369,7 @@ public function extract($p_path = '', $p_preserve = false) */ public function listContent() { - $v_list_detail = array(); + $v_list_detail = []; if ($this->_openRead()) { if (!$this->_extractList('', $v_list_detail, "list", '', '')) { @@ -542,7 +542,7 @@ public function addModify($p_filelist, $p_add_dir, $p_remove_dir = '') * * @return true on success, false on error. */ - public function addString($p_filename, $p_string, $p_datetime = false, $p_params = array()) + public function addString($p_filename, $p_string, $p_datetime = false, $p_params = []) { $p_stamp = @$p_params["stamp"] ? $p_params["stamp"] : ($p_datetime ? $p_datetime : time()); $p_mode = @$p_params["mode"] ? $p_params["mode"] : 0600; @@ -609,7 +609,7 @@ public function addString($p_filename, $p_string, $p_datetime = false, $p_params public function extractModify($p_path, $p_remove_path, $p_preserve = false) { $v_result = true; - $v_list_detail = array(); + $v_list_detail = []; if ($v_result = $this->_openRead()) { $v_result = $this->_extractList( @@ -669,7 +669,7 @@ public function extractInString($p_filename) public function extractList($p_filelist, $p_path = '', $p_remove_path = '', $p_preserve = false) { $v_result = true; - $v_list_detail = array(); + $v_list_detail = []; if (is_array($p_filelist)) { $v_list = $p_filelist; @@ -771,7 +771,7 @@ public function setIgnoreRegexp($regexp) */ public function setIgnoreList($list) { - $regexp = str_replace(array('#', '.', '^', '$'), array('\#', '\.', '\^', '\$'), $list); + $regexp = str_replace(['#', '.', '^', '$'], ['\#', '\.', '\^', '\$'], $list); $regexp = '#/' . join('$|/', $list) . '#'; $this->setIgnoreRegexp($regexp); } @@ -1173,7 +1173,7 @@ public function _writeFooter() public function _addList($p_list, $p_add_dir, $p_remove_dir) { $v_result = true; - $v_header = array(); + $v_header = []; // ----- Remove potential windows directory separator $p_add_dir = $this->_translateWinPath($p_add_dir); @@ -1335,7 +1335,7 @@ public function _addFile($p_filename, &$p_header, $p_add_dir, $p_remove_dir, $v_ * @param array $p_params * @return bool */ - public function _addString($p_filename, $p_string, $p_datetime = false, $p_params = array()) + public function _addString($p_filename, $p_string, $p_datetime = false, $p_params = []) { $p_stamp = @$p_params["stamp"] ? $p_params["stamp"] : ($p_datetime ? $p_datetime : time()); $p_mode = @$p_params["mode"] ? $p_params["mode"] : 0600; @@ -1713,7 +1713,7 @@ public function _readHeader($v_binary_data, &$v_header) } if (!is_array($v_header)) { - $v_header = array(); + $v_header = []; } // ----- Calculate the checksum $v_checksum = 0; diff --git a/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php b/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php index e45cb884aa..5a4d9f8134 100644 --- a/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php +++ b/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php @@ -118,7 +118,7 @@ protected function callMethod($service, $call) { } } - call_user_func_array(array($service, $call[0]), $this->resolveServices($this->getParameterBag()->resolveValue($call[1]))); + call_user_func_array([$service, $call[0]], $this->resolveServices($this->getParameterBag()->resolveValue($call[1]))); } /** diff --git a/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php b/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php index da1c08c2f5..3632809171 100644 --- a/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php +++ b/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php @@ -203,12 +203,12 @@ private function parseDefinition($id, $service, $file) if (is_string($service['factory'])) { if (strpos($service['factory'], ':') !== false && strpos($service['factory'], '::') === false) { $parts = explode(':', $service['factory']); - $definition->setFactory(array($this->resolveServices('@'.$parts[0]), $parts[1])); + $definition->setFactory([$this->resolveServices('@'.$parts[0]), $parts[1]]); } else { $definition->setFactory($service['factory']); } } else { - $definition->setFactory(array($this->resolveServices($service['factory'][0]), $service['factory'][1])); + $definition->setFactory([$this->resolveServices($service['factory'][0]), $service['factory'][1]]); } } @@ -240,7 +240,7 @@ private function parseDefinition($id, $service, $file) if (is_string($service['configurator'])) { $definition->setConfigurator($service['configurator']); } else { - $definition->setConfigurator(array($this->resolveServices($service['configurator'][0]), $service['configurator'][1])); + $definition->setConfigurator([$this->resolveServices($service['configurator'][0]), $service['configurator'][1]]); } } @@ -252,10 +252,10 @@ private function parseDefinition($id, $service, $file) foreach ($service['calls'] as $call) { if (isset($call['method'])) { $method = $call['method']; - $args = isset($call['arguments']) ? $this->resolveServices($call['arguments']) : array(); + $args = isset($call['arguments']) ? $this->resolveServices($call['arguments']) : []; } else { $method = $call[0]; - $args = isset($call[1]) ? $this->resolveServices($call[1]) : array(); + $args = isset($call[1]) ? $this->resolveServices($call[1]) : []; } $definition->addMethodCall($method, $args); @@ -364,7 +364,7 @@ private function validate($content, $file) throw new InvalidArgumentException(sprintf('The service file "%s" is not valid. It should contain an array. Check your YAML syntax.', $file)); } - if ($invalid_keys = array_diff_key($content, array('parameters' => 1, 'services' => 1))) { + if ($invalid_keys = array_diff_key($content, ['parameters' => 1, 'services' => 1])) { throw new InvalidArgumentException(sprintf('The service file "%s" is not valid: it contains invalid keys %s. Services have to be added under "services" and Parameters under "parameters".', $file, $invalid_keys)); } @@ -381,7 +381,7 @@ private function validate($content, $file) private function resolveServices($value) { if (is_array($value)) { - $value = array_map(array($this, 'resolveServices'), $value); + $value = array_map([$this, 'resolveServices'], $value); } elseif (is_string($value) && 0 === strpos($value, '@=')) { // Not supported. //return new Expression(substr($value, 2)); diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc index 3e256c28fd..2e1977e2e5 100644 --- a/core/modules/locale/locale.bulk.inc +++ b/core/modules/locale/locale.bulk.inc @@ -205,7 +205,7 @@ function locale_translate_batch_import($file, array $options, &$context) { 'seek' => 0, ]; } - // Update the seek and the number of items in the $options array(). + // Update the seek and the number of items in the $options array. $options['seek'] = $context['sandbox']['parse_state']['seek']; $options['items'] = $context['sandbox']['parse_state']['chunk_size']; $report = Gettext::fileToDatabase($file, $options); diff --git a/core/modules/node/src/Plugin/Search/NodeSearch.php b/core/modules/node/src/Plugin/Search/NodeSearch.php index 6d7c8eb7d4..d94261220e 100644 --- a/core/modules/node/src/Plugin/Search/NodeSearch.php +++ b/core/modules/node/src/Plugin/Search/NodeSearch.php @@ -237,7 +237,7 @@ protected function findResults() { // \Drupal::request()->query->get('f') is an array that looks like this in // the URL: ?f[]=type:page&f[]=term:27&f[]=term:13&f[]=langcode:en // So $parameters['f'] looks like: - // array('type:page', 'term:27', 'term:13', 'langcode:en'); + // ['type:page', 'term:27', 'term:13', 'langcode:en']; // We need to parse this out into query conditions, some of which go into // the keywords string, and some of which are separate conditions. $parameters = $this->getParameters(); diff --git a/core/modules/rest/src/Plugin/ResourceInterface.php b/core/modules/rest/src/Plugin/ResourceInterface.php index 7e92c571c4..43eafb9ee5 100644 --- a/core/modules/rest/src/Plugin/ResourceInterface.php +++ b/core/modules/rest/src/Plugin/ResourceInterface.php @@ -46,7 +46,7 @@ public function permissions(); * Returns the available HTTP request methods on this plugin. * * @return array - * The list of supported methods. Example: array('GET', 'POST', 'PATCH'). + * The list of supported methods. Example: ['GET', 'POST', 'PATCH']. */ public function availableMethods(); diff --git a/core/modules/simpletest/src/TestBase.php b/core/modules/simpletest/src/TestBase.php index 1491cc2af1..0c64a14c6e 100644 --- a/core/modules/simpletest/src/TestBase.php +++ b/core/modules/simpletest/src/TestBase.php @@ -854,7 +854,7 @@ protected function verbose($message) { * * @param $methods * (optional) A list of method names in the test case class to run; e.g., - * array('testFoo', 'testBar'). By default, all methods of the class are + * ['testFoo', 'testBar']. By default, all methods of the class are * taken into account, but it can be useful to only run a few selected test * methods during debugging. */ diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php index 2491bc84b3..eab42e9166 100644 --- a/core/modules/simpletest/src/WebTestBase.php +++ b/core/modules/simpletest/src/WebTestBase.php @@ -316,7 +316,7 @@ protected function findBlockInstance(Block $block) { * For example: * @code * // Create a user. - * $account = $this->drupalCreateUser(array()); + * $account = $this->drupalCreateUser([]); * $this->drupalLogin($account); * // Load real user object. * $pass_raw = $account->pass_raw; @@ -923,7 +923,7 @@ protected function drupalGet($path, array $options = [], array $headers = []) { * @param array $options * Array of URL options. * @param array $headers - * Array of headers. Eg array('Accept: application/vnd.drupal-ajax'). + * Array of headers. Eg ['Accept: application/vnd.drupal-ajax']. * * @return array * Decoded json. @@ -1195,7 +1195,7 @@ protected function drupalPostForm($path, $edit, $submit, array $options = [], ar * The name of the form element that is responsible for triggering the Ajax * functionality to test. May be a string or, if the triggering element is * a button, an associative array where the key is the name of the button - * and the value is the button label. i.e.) array('op' => t('Refresh')). + * and the value is the button label. i.e.) ['op' => t('Refresh')]. * @param $ajax_path * (optional) Override the path set by the Ajax settings of the triggering * element. diff --git a/core/modules/views_ui/admin.inc b/core/modules/views_ui/admin.inc index a2d9fedcbc..a7c6ac8c9d 100644 --- a/core/modules/views_ui/admin.inc +++ b/core/modules/views_ui/admin.inc @@ -38,7 +38,7 @@ * An array of parent keys that point to the part of the form that will be * refreshed by AJAX. For example, if triggering the AJAX behavior should * cause $form['dynamic_content']['section'] to be refreshed, you would pass - * array('dynamic_content', 'section') for this parameter. + * ['dynamic_content', 'section'] for this parameter. */ function views_ui_add_ajax_trigger(&$wrapping_element, $trigger_key, $refresh_parents) { $seen_ids = &drupal_static(__FUNCTION__ . ':seen_ids', []); diff --git a/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php b/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php index 3298681051..c15061770c 100644 --- a/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php +++ b/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php @@ -77,12 +77,12 @@ public function buildForm(array $form, FormStateInterface $form_state) { /** * Filter groups is an array that contains: - * array( + * [ * 'operator' => 'and' || 'or', - * 'groups' => array( + * 'groups' => [ * $group_id => 'and' || 'or', - * ), - * ); + * ], + * ]; */ $grouping = count(array_keys($groups['groups'])) > 1; @@ -330,7 +330,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { /** * Adds one to each key of an array. * - * For example array(0 => 'foo') would be array(1 => 'foo'). + * For example [0 => 'foo'] would be [1 => 'foo']. * * @param array $array * The array to increment keys on. diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist index a593e62c7d..94c3a3b171 100644 --- a/core/phpcs.xml.dist +++ b/core/phpcs.xml.dist @@ -2,6 +2,8 @@ Default PHP CodeSniffer configuration for Drupal core. . + ../sites/default/default.settings.php + ./scripts/run-test.sh diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh index 09a7aad57c..24e11b5f76 100755 --- a/core/scripts/run-tests.sh +++ b/core/scripts/run-tests.sh @@ -5,12 +5,12 @@ * This script runs Drupal tests from command line. */ +use Drupal\Core\Asset\AttachedAssets; use Drupal\Component\FileSystem\FileSystem; use Drupal\Component\Utility\Html; use Drupal\Component\Utility\Timer; use Drupal\Component\Uuid\Php; use Drupal\Core\Database\Database; -use Drupal\Core\Site\Settings; use Drupal\Core\StreamWrapper\PublicStream; use Drupal\Core\Test\TestDatabase; use Drupal\Core\Test\TestRunnerKernel; @@ -98,7 +98,8 @@ $test_discovery = NULL; try { $test_discovery = \Drupal::service('test_discovery'); - } catch (Exception $e) { + } + catch (Exception $e) { error_log((string) $e); echo (string)$e; exit(SIMPLETEST_SCRIPT_EXIT_EXCEPTION); @@ -113,7 +114,7 @@ } // Output the list of files. else { - foreach(array_values($test_classes) as $test_class) { + foreach (array_values($test_classes) as $test_class) { echo $test_class . "\n"; } } @@ -147,7 +148,7 @@ drupal_set_time_limit(0); simpletest_script_reporter_init(); -$tests_to_run = array(); +$tests_to_run = []; for ($i = 0; $i < $args['repeat']; $i++) { $tests_to_run = array_merge($tests_to_run, $test_list); } @@ -344,7 +345,7 @@ function simpletest_script_help() { */ function simpletest_script_parse_args() { // Set default values. - $args = array( + $args = [ 'script' => '', 'help' => FALSE, 'list' => FALSE, @@ -366,7 +367,7 @@ function simpletest_script_parse_args() { 'verbose' => FALSE, 'keep-results' => FALSE, 'keep-results-table' => FALSE, - 'test_names' => array(), + 'test_names' => [], 'repeat' => 1, 'die-on-fail' => FALSE, 'browser' => FALSE, @@ -375,7 +376,7 @@ function simpletest_script_parse_args() { 'execute-test' => '', 'xml' => '', 'non-html' => FALSE, - ); + ]; // Override with set values. $args['script'] = basename(array_shift($_SERVER['argv'])); @@ -398,7 +399,7 @@ function simpletest_script_parse_args() { $args[$matches[1]] = array_shift($_SERVER['argv']); } // Clear extraneous values. - $args['test_names'] = array(); + $args['test_names'] = []; $count++; } else { @@ -423,7 +424,7 @@ function simpletest_script_parse_args() { if ($args['browser']) { $args['keep-results'] = TRUE; } - return array($args, $count); + return [$args, $count]; } /** @@ -591,13 +592,13 @@ function simpletest_script_setup_database($new = FALSE) { else { $sqlite = DRUPAL_ROOT . '/' . $args['sqlite']; } - $databases['test-runner']['default'] = array( + $databases['test-runner']['default'] = [ 'driver' => 'sqlite', 'database' => $sqlite, - 'prefix' => array( + 'prefix' => [ 'default' => '', - ), - ); + ], + ]; // Create the test runner SQLite database, unless it exists already. if ($new && !file_exists($sqlite)) { if (!is_dir(dirname($sqlite))) { @@ -659,7 +660,7 @@ function simpletest_script_execute_batch($test_classes) { $total_status = SIMPLETEST_SCRIPT_EXIT_SUCCESS; // Multi-process execution. - $children = array(); + $children = []; while (!empty($test_classes) || !empty($children)) { while (count($children) < $args['concurrency']) { if (empty($test_classes)) { @@ -669,7 +670,7 @@ function simpletest_script_execute_batch($test_classes) { try { $test_id = Database::getConnection('default', 'test-runner') ->insert('simpletest_test_id') - ->useDefaults(array('test_id')) + ->useDefaults(['test_id']) ->execute(); } catch (Exception $e) { @@ -681,7 +682,7 @@ function simpletest_script_execute_batch($test_classes) { $test_class = array_shift($test_classes); // Fork a child process. $command = simpletest_script_command($test_id, $test_class); - $process = proc_open($command, array(), $pipes, NULL, NULL, array('bypass_shell' => TRUE)); + $process = proc_open($command, [], $pipes, NULL, NULL, ['bypass_shell' => TRUE]); if (!is_resource($process)) { echo "Unable to fork test process. Aborting.\n"; @@ -689,12 +690,12 @@ function simpletest_script_execute_batch($test_classes) { } // Register our new child. - $children[] = array( + $children[] = [ 'process' => $process, 'test_id' => $test_id, 'class' => $test_class, 'pipes' => $pipes, - ); + ]; } // Wait for children every 200ms. @@ -755,7 +756,7 @@ function simpletest_script_run_phpunit($test_id, $class) { set_time_limit($reflection->getStaticPropertyValue('runLimit')); } - $results = simpletest_run_phpunit_tests($test_id, array($class), $status); + $results = simpletest_run_phpunit_tests($test_id, [$class], $status); simpletest_process_phpunit_results($results); // Map phpunit results to a data structure we can pass to @@ -781,7 +782,7 @@ function simpletest_script_run_one_test($test_id, $test_class) { else { $class_name = $test_class; // Use empty array to run all the test methods. - $methods = array(); + $methods = []; } $test = new $class_name($test_id); if (is_subclass_of($test_class, TestCase::class)) { @@ -834,7 +835,7 @@ function simpletest_script_command($test_id, $test_class) { } $command .= ' --php ' . escapeshellarg($php); $command .= " --test-id $test_id"; - foreach (array('verbose', 'keep-results', 'color', 'die-on-fail') as $arg) { + foreach (['verbose', 'keep-results', 'color', 'die-on-fail'] as $arg) { if ($args[$arg]) { $command .= ' --' . $arg; } @@ -887,7 +888,7 @@ function simpletest_script_cleanup($test_id, $test_class, $exitcode) { // Do not output verbose cleanup messages in case of a positive exitcode. $output = !empty($exitcode); - $messages = array(); + $messages = []; $messages[] = "- Found database prefix '$db_prefix' for test ID $test_id."; @@ -916,7 +917,7 @@ function simpletest_script_cleanup($test_id, $test_class, $exitcode) { // simpletest_clean_temporary_directories() cannot be used here, since it // would also delete file directories of other tests that are potentially // running concurrently. - file_unmanaged_delete_recursive($test_directory, array('Drupal\simpletest\TestBase', 'filePreDeleteCallback')); + file_unmanaged_delete_recursive($test_directory, ['Drupal\simpletest\TestBase', 'filePreDeleteCallback']); $messages[] = "- Removed test site directory."; } @@ -957,7 +958,7 @@ function simpletest_script_get_test_list() { global $args; $types_processed = empty($args['types']); - $test_list = array(); + $test_list = []; if ($args['all'] || $args['module']) { try { $groups = simpletest_test_get_all($args['module'], $args['types']); @@ -967,7 +968,7 @@ function simpletest_script_get_test_list() { echo (string) $e; exit(SIMPLETEST_SCRIPT_EXIT_EXCEPTION); } - $all_tests = array(); + $all_tests = []; foreach ($groups as $group => $tests) { $all_tests = array_merge($all_tests, array_keys($tests)); } @@ -975,7 +976,7 @@ function simpletest_script_get_test_list() { } else { if ($args['class']) { - $test_list = array(); + $test_list = []; foreach ($args['test_names'] as $test_class) { list($class_name) = explode('::', $test_class, 2); if (class_exists($class_name)) { @@ -989,7 +990,7 @@ function simpletest_script_get_test_list() { echo (string) $e; exit(SIMPLETEST_SCRIPT_EXIT_EXCEPTION); } - $all_classes = array(); + $all_classes = []; foreach ($groups as $group) { $all_classes = array_merge($all_classes, array_keys($group)); } @@ -1036,7 +1037,7 @@ function simpletest_script_get_test_list() { // minimal conditions only; i.e., a '*.php' file that has '/Tests/' in // its path. // Ignore anything from third party vendors. - $ignore = array('.', '..', 'vendor'); + $ignore = ['.', '..', 'vendor']; $files = []; if ($args['directory'][0] === '/') { $directory = $args['directory']; @@ -1126,11 +1127,11 @@ function simpletest_script_get_test_list() { function simpletest_script_reporter_init() { global $args, $test_list, $results_map; - $results_map = array( + $results_map = [ 'pass' => 'Pass', 'fail' => 'Fail', 'exception' => 'Exception', - ); + ]; echo "\n"; echo "Drupal test run\n"; @@ -1171,13 +1172,13 @@ function simpletest_script_reporter_display_summary($class, $results) { // Output all test results vertically aligned. // Cut off the class name after 60 chars, and pad each group with 3 digits // by default (more than 999 assertions are rare). - $output = vsprintf('%-60.60s %10s %9s %14s %12s', array( + $output = vsprintf('%-60.60s %10s %9s %14s %12s', [ $class, $results['#pass'] . ' passes', !$results['#fail'] ? '' : $results['#fail'] . ' fails', !$results['#exception'] ? '' : $results['#exception'] . ' exceptions', !$results['#debug'] ? '' : $results['#debug'] . ' messages', - )); + ]); $status = ($results['#fail'] || $results['#exception'] ? 'fail' : 'pass'); simpletest_script_print($output . "\n", simpletest_script_color_code($status)); @@ -1198,7 +1199,7 @@ function simpletest_script_reporter_write_xml_results() { } $test_class = ''; - $xml_files = array(); + $xml_files = []; foreach ($results as $result) { if (isset($results_map[$result->status])) { @@ -1214,7 +1215,7 @@ function simpletest_script_reporter_write_xml_results() { $doc = new DomDocument('1.0'); $root = $doc->createElement('testsuite'); $root = $doc->appendChild($root); - $xml_files[$test_class] = array('doc' => $doc, 'suite' => $root); + $xml_files[$test_class] = ['doc' => $doc, 'suite' => $root]; } } @@ -1412,7 +1413,7 @@ function simpletest_script_color_code($status) { * @see http://php.net/manual/en/function.levenshtein.php */ function simpletest_script_print_alternatives($string, $array, $degree = 4) { - $alternatives = array(); + $alternatives = []; foreach ($array as $item) { $lev = levenshtein($string, $item); if ($lev <= strlen($item) / $degree || FALSE !== strpos($string, $item)) { @@ -1440,7 +1441,7 @@ function simpletest_script_print_alternatives($string, $array, $degree = 4) { */ function simpletest_script_load_messages_by_test_id($test_ids) { global $args; - $results = array(); + $results = []; // Sqlite has a maximum number of variables per query. If required, the // database query is split into chunks. @@ -1448,15 +1449,15 @@ function simpletest_script_load_messages_by_test_id($test_ids) { $test_id_chunks = array_chunk($test_ids, SIMPLETEST_SCRIPT_SQLITE_VARIABLE_LIMIT); } else { - $test_id_chunks = array($test_ids); + $test_id_chunks = [$test_ids]; } foreach ($test_id_chunks as $test_id_chunk) { try { $result_chunk = Database::getConnection('default', 'test-runner') - ->query("SELECT * FROM {simpletest} WHERE test_id IN ( :test_ids[] ) ORDER BY test_class, message_id", array( + ->query("SELECT * FROM {simpletest} WHERE test_id IN ( :test_ids[] ) ORDER BY test_class, message_id", [ ':test_ids[]' => $test_id_chunk, - ))->fetchAll(); + ])->fetchAll(); } catch (Exception $e) { echo (string) $e; @@ -1492,12 +1493,12 @@ function simpletest_script_open_browser() { } // Get the results form. - $form = array(); + $form = []; SimpletestResultsForm::addResultForm($form, $results); // Get the assets to make the details element collapsible and theme the result // form. - $assets = new \Drupal\Core\Asset\AttachedAssets(); + $assets = new AttachedAssets(); $assets->setLibraries([ 'core/drupal.collapse', 'system/admin', diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php index 1720d11e43..41424c137f 100644 --- a/sites/default/default.settings.php +++ b/sites/default/default.settings.php @@ -86,7 +86,7 @@ * ); * @endcode */ -$databases = array(); +$databases = []; /** * Customizing database settings. @@ -249,7 +249,7 @@ * ); * @endcode */ -$config_directories = array(); +$config_directories = []; /** * Settings: @@ -377,7 +377,7 @@ * Specify every reverse proxy IP address in your environment. * This setting is required if $settings['reverse_proxy'] is TRUE. */ -# $settings['reverse_proxy_addresses'] = array('a.b.c.d', ...); +# $settings['reverse_proxy_addresses'] = ['a.b.c.d', ...]; /** * Set this value if your proxy server sends the client IP in a header @@ -462,16 +462,14 @@ * example, to use Symfony's APC class loader without automatic detection, * uncomment the code below. */ -/* -if ($settings['hash_salt']) { - $prefix = 'drupal.' . hash('sha256', 'drupal.' . $settings['hash_salt']); - $apc_loader = new \Symfony\Component\ClassLoader\ApcClassLoader($prefix, $class_loader); - unset($prefix); - $class_loader->unregister(); - $apc_loader->register(); - $class_loader = $apc_loader; -} -*/ +# if ($settings['hash_salt']) { +# $prefix = 'drupal.' . hash('sha256', 'drupal.' . $settings['hash_salt']); +# $apc_loader = new \Symfony\Component\ClassLoader\ApcClassLoader($prefix, $class_loader); +# unset($prefix); +# $class_loader->unregister(); +# $apc_loader->register(); +# $class_loader = $apc_loader; +# } /** * Authorized file system operations: @@ -562,10 +560,10 @@ * The "en" part of the variable name, is dynamic and can be any langcode of * any added language. (eg locale_custom_strings_de for german). */ -# $settings['locale_custom_strings_en'][''] = array( +# $settings['locale_custom_strings_en'][''] = [ # 'forum' => 'Discussion board', # '@count min' => '@count minutes', -# ); +# ]; /** * A custom theme for the offline page: @@ -619,7 +617,7 @@ * override in a services.yml file in the same directory as settings.php * (definitions in this file will override service definition defaults). */ -# $settings['bootstrap_config_storage'] = array('Drupal\Core\Config\BootstrapConfigStorageFactory', 'getFileStorage'); +# $settings['bootstrap_config_storage'] = ['Drupal\Core\Config\BootstrapConfigStorageFactory', 'getFileStorage']; /** * Configuration overrides.