Unverified Commit f436f7c0 authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3222251 by bbrala, longwave: [November 8, 2021] Replace all isset...

Issue #3222251 by bbrala, longwave: [November 8, 2021] Replace all isset constructs with the null coalescing operator

(cherry picked from commit 330473e7)
parent 460665f7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ public function composerLock() {
   */
  public function getRequireDev() {
    $composerJsonData = $this->rootComposerJson();
    return isset($composerJsonData['require-dev']) ? $composerJsonData['require-dev'] : [];
    return $composerJsonData['require-dev'] ?? [];
  }

  /**
+2 −2
Original line number Diff line number Diff line
@@ -139,7 +139,7 @@ public function getAllCleanupPaths() {
    // Merge root config with defaults.
    foreach (array_change_key_case(static::$defaultConfig, CASE_LOWER) as $package => $paths) {
      $this->configData[$package] = array_merge(
        isset($this->configData[$package]) ? $this->configData[$package] : [],
        $this->configData[$package] ?? [],
        $paths);
    }
    return $this->configData;
@@ -157,7 +157,7 @@ public function getAllCleanupPaths() {
  public function getPathsForPackage($package) {
    $package = strtolower($package);
    $paths = $this->getAllCleanupPaths();
    return isset($paths[$package]) ? $paths[$package] : [];
    return $paths[$package] ?? [];
  }

}
+1 −1
Original line number Diff line number Diff line
@@ -354,7 +354,7 @@ function _batch_process() {
    // completion level of the current operation.
    $current    = $total - $remaining + $finished;
    $percentage = _batch_api_percentage($total, $current);
    $elapsed    = isset($current_set['elapsed']) ? $current_set['elapsed'] : 0;
    $elapsed    = $current_set['elapsed'] ?? 0;
    $values     = [
      '@remaining'  => $remaining,
      '@total'      => $total,
+2 −2
Original line number Diff line number Diff line
@@ -415,8 +415,8 @@ function drupal_valid_test_ua($new_prefix = NULL) {
  // A valid Simpletest request will contain a hashed and salted authentication
  // code. Check if this code is present in a cookie or custom user agent
  // string.
  $http_user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : NULL;
  $user_agent = isset($_COOKIE['SIMPLETEST_USER_AGENT']) ? $_COOKIE['SIMPLETEST_USER_AGENT'] : $http_user_agent;
  $http_user_agent = $_SERVER['HTTP_USER_AGENT'] ?? NULL;
  $user_agent = $_COOKIE['SIMPLETEST_USER_AGENT'] ?? $http_user_agent;
  if (isset($user_agent) && preg_match("/^simple(\w+\d+):(.+):(.+):(.+)$/", $user_agent, $matches)) {
    list(, $prefix, $time, $salt, $hmac) = $matches;
    $check_string = $prefix . ':' . $time . ':' . $salt;
+2 −2
Original line number Diff line number Diff line
@@ -355,8 +355,8 @@ function drupal_attach_tabledrag(&$element, array $options) {
  $tabledrag_id = (!isset($tabledrag_id)) ? 0 : $tabledrag_id + 1;

  // If a subgroup or source isn't set, assume it is the same as the group.
  $target = isset($options['subgroup']) ? $options['subgroup'] : $group;
  $source = isset($options['source']) ? $options['source'] : $target;
  $target = $options['subgroup'] ?? $group;
  $source = $options['source'] ?? $target;
  $element['#attached']['drupalSettings']['tableDrag'][$options['table_id']][$group][$tabledrag_id] = [
    'target' => $target,
    'source' => $source,
Loading