Verified Commit b36ea266 authored by Dave Long's avatar Dave Long
Browse files

task: #3549730 Enable LongLineDeclaration

By: quietone
By: smustgrave
By: longwave
By: dcam
parent 70bbe3ba
Loading
Loading
Loading
Loading
Loading
+7 −1
Changes for core/includes/batch.inc: 7 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -462,7 +462,13 @@ function _batch_finished() {
      $operations = $queue->getAllItems();
      $callable_resolver = \Drupal::service(CallableResolver::class);
      $callable = $callable_resolver->getCallableFromDefinition($batch_set['finished']);
      $batch_set_result = $callable(...array_merge([$batch_set['success'], $batch_set['results'], $operations, \Drupal::service('date.formatter')->formatInterval((int) ($batch_set['elapsed'] / 1000))]));
      $batch_set_result = $callable(
        $batch_set['success'],
        $batch_set['results'],
        $operations,
        \Drupal::service('date.formatter')
          ->formatInterval((int) ($batch_set['elapsed'] / 1000)),
      );
      // If a batch 'finished' callback requested a redirect after the batch
      // is complete, save that for later use. If more than one batch set
      // returned a redirect, the last one is used.
+6 −1
Changes for core/includes/errors.inc: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -171,7 +171,12 @@ function _drupal_log_error($error, $fatal = FALSE): void {
      // Provide the PHP backtrace and exception to logger implementations. Add
      // 'severity_level' to the context to maintain BC and allow logging
      // implementations to use it.
      \Drupal::logger('php')->log($severity, '%type: @message in %function (line %line of %file) @backtrace_string.', $error + ['backtrace' => $backtrace, 'exception' => $exception, 'severity_level' => $severity]);
      \Drupal::logger('php')
        ->log($severity, '%type: @message in %function (line %line of %file) @backtrace_string.', $error + [
          'backtrace' => $backtrace,
          'exception' => $exception,
          'severity_level' => $severity,
        ]);
    }
    catch (\Throwable) {
      // We can't log, for example because the database connection is not
+33 −8
Changes for core/includes/install.core.inc: 33 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -1227,7 +1227,11 @@ function install_database_errors($database, $settings_file) {
    $errors = $driverExtension->getInstallTasks()->runTasks();
  }
  catch (UnknownExtensionException) {
    $errors['driver'] = t("In your %settings_file file you have configured @drupal to use a %driver server, however your PHP installation currently does not support this database type.", ['%settings_file' => $settings_file, '@drupal' => drupal_install_profile_distribution_name(), '%driver' => $database['driver']]);
    $errors['driver'] = t("In your %settings_file file you have configured @drupal to use a %driver server, however your PHP installation currently does not support this database type.", [
      '%settings_file' => $settings_file,
      '@drupal' => drupal_install_profile_distribution_name(),
      '%driver' => $database['driver'],
    ]);
  }
  return $errors;
}
@@ -2031,7 +2035,10 @@ function install_check_translations($langcode, $server_pattern): array {
      'title'       => t('Translations directory'),
      'value'       => t('The translations directory does not exist.'),
      'severity'    => RequirementSeverity::Error,
      'description' => t('The installer requires that you create a translations directory as part of the installation process. Create the directory %translations_directory . More details about installing Drupal are available in <a href=":install_txt">INSTALL.txt</a>.', ['%translations_directory' => $translations_directory, ':install_txt' => base_path() . 'core/INSTALL.txt']),
      'description' => t('The installer requires that you create a translations directory as part of the installation process. Create the directory %translations_directory . More details about installing Drupal are available in <a href=":install_txt">INSTALL.txt</a>.', [
        '%translations_directory' => $translations_directory,
        ':install_txt' => base_path() . 'core/INSTALL.txt',
      ]),
    ];
  }
  else {
@@ -2045,7 +2052,10 @@ function install_check_translations($langcode, $server_pattern): array {
        'title'       => t('Translations directory'),
        'value'       => t('The translations directory is not readable.'),
        'severity'    => RequirementSeverity::Error,
        'description' => t('The installer requires read permissions to %translations_directory at all times. The <a href=":handbook_url">webhosting issues</a> documentation section offers help on this and other topics.', ['%translations_directory' => $translations_directory, ':handbook_url' => 'https://www.drupal.org/server-permissions']),
        'description' => t('The installer requires read permissions to %translations_directory at all times. The <a href=":handbook_url">webhosting issues</a> documentation section offers help on this and other topics.', [
          '%translations_directory' => $translations_directory,
          ':handbook_url' => 'https://www.drupal.org/server-permissions',
        ]),
      ];
    }
    // If translations directory is not writable, throw an error.
@@ -2054,7 +2064,10 @@ function install_check_translations($langcode, $server_pattern): array {
        'title'       => t('Translations directory'),
        'value'       => t('The translations directory is not writable.'),
        'severity'    => RequirementSeverity::Error,
        'description' => t('The installer requires write permissions to %translations_directory during the installation process. The <a href=":handbook_url">webhosting issues</a> documentation section offers help on this and other topics.', ['%translations_directory' => $translations_directory, ':handbook_url' => 'https://www.drupal.org/server-permissions']),
        'description' => t('The installer requires write permissions to %translations_directory during the installation process. The <a href=":handbook_url">webhosting issues</a> documentation section offers help on this and other topics.', [
          '%translations_directory' => $translations_directory,
          ':handbook_url' => 'https://www.drupal.org/server-permissions',
        ]),
      ];
    }
    else {
@@ -2071,7 +2084,10 @@ function install_check_translations($langcode, $server_pattern): array {
      'title'       => t('Internet'),
      'value'       => t('The translation server is offline.'),
      'severity'    => RequirementSeverity::Error,
      'description' => t('The installer requires to contact the translation server to download a translation file. Check your internet connection and verify that your website can reach the translation server at <a href=":server_url">@server_url</a>.', [':server_url' => $server_url, '@server_url' => $server_url]),
      'description' => t('The installer requires to contact the translation server to download a translation file. Check your internet connection and verify that your website can reach the translation server at <a href=":server_url">@server_url</a>.', [
        ':server_url' => $server_url,
        '@server_url' => $server_url,
      ]),
    ];
  }
  else {
@@ -2086,7 +2102,10 @@ function install_check_translations($langcode, $server_pattern): array {
        'title'       => t('Translation'),
        'value'       => t('The %language translation is not available.', ['%language' => $language]),
        'severity'    => RequirementSeverity::Error,
        'description' => t('The %language translation file is not available at the translation server. <a href=":url">Choose a different language</a> or select English and translate your website later.', ['%language' => $language, ':url' => $_SERVER['SCRIPT_NAME']]),
        'description' => t('The %language translation file is not available at the translation server. <a href=":url">Choose a different language</a> or select English and translate your website later.', [
          '%language' => $language,
          ':url' => $_SERVER['SCRIPT_NAME'],
        ]),
      ];
    }
    else {
@@ -2105,7 +2124,10 @@ function install_check_translations($langcode, $server_pattern): array {
        'title'       => t('Translation'),
        'value'       => t('The %language translation could not be downloaded.', ['%language' => $language]),
        'severity'    => RequirementSeverity::Error,
        'description' => t('The %language translation file could not be downloaded. <a href=":url">Choose a different language</a> or select English and translate your website later.', ['%language' => $language, ':url' => $_SERVER['SCRIPT_NAME']]),
        'description' => t('The %language translation file could not be downloaded. <a href=":url">Choose a different language</a> or select English and translate your website later.', [
          '%language' => $language,
          ':url' => $_SERVER['SCRIPT_NAME'],
        ]),
      ];
    }
  }
@@ -2338,7 +2360,10 @@ function install_display_requirements($install_state, $requirements) {
      $build['report']['#requirements'] = $requirements;
      if ($severity == RequirementSeverity::Warning) {
        $build['#title'] = t('Requirements review');
        $build['#suffix'] = t('Check the messages and <a href=":retry">retry</a>, or you may choose to <a href=":cont">continue anyway</a>.', [':retry' => drupal_requirements_url(RequirementSeverity::Error), ':cont' => drupal_requirements_url($severity)]);
        $build['#suffix'] = t('Check the messages and <a href=":retry">retry</a>, or you may choose to <a href=":cont">continue anyway</a>.', [
          ':retry' => drupal_requirements_url(RequirementSeverity::Error),
          ':cont' => drupal_requirements_url($severity),
        ]);
      }
      else {
        $build['#title'] = t('Requirements problem');
+14 −2
Changes for core/includes/install.inc: 14 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -292,7 +292,15 @@ function drupal_verify_install_file($file, $mask = NULL, $type = 'file', $auto_f

  // Verify file permissions.
  if (isset($mask)) {
    $masks = [FILE_EXIST, FILE_READABLE, FILE_WRITABLE, FILE_EXECUTABLE, FILE_NOT_READABLE, FILE_NOT_WRITABLE, FILE_NOT_EXECUTABLE];
    $masks = [
      FILE_EXIST,
      FILE_READABLE,
      FILE_WRITABLE,
      FILE_EXECUTABLE,
      FILE_NOT_READABLE,
      FILE_NOT_WRITABLE,
      FILE_NOT_EXECUTABLE,
    ];
    foreach ($masks as $current_mask) {
      if ($mask & $current_mask) {
        switch ($current_mask) {
@@ -645,7 +653,11 @@ function drupal_check_module($module) {
      if (isset($requirement['severity']) && $requirement['severity'] === RequirementSeverity::Error) {
        $message = $requirement['description'];
        if (isset($requirement['value']) && $requirement['value']) {
          $message = t('@requirements_message (Currently using @item version @version)', ['@requirements_message' => $requirement['description'], '@item' => $requirement['title'], '@version' => $requirement['value']]);
          $message = t('@requirements_message (Currently using @item version @version)', [
            '@requirements_message' => $requirement['description'],
            '@item' => $requirement['title'],
            '@version' => $requirement['value'],
          ]);
        }
        \Drupal::messenger()->addError($message);
      }
+2 −1
Changes for core/modules/block_content/src/BlockContentPermissions.php: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -44,7 +44,8 @@ public static function create(ContainerInterface $container) {
   *   The block type permissions.
   */
  public function blockTypePermissions() {
    return $this->generatePermissions($this->entityTypeManager->getStorage('block_content_type')->loadMultiple(), [$this, 'buildPermissions']);
    return $this->generatePermissions($this->entityTypeManager->getStorage('block_content_type')->loadMultiple(),
      [$this, 'buildPermissions']);
  }

  /**
Loading