Commit f8b41913 authored by Mathew Winstone's avatar Mathew Winstone
Browse files

fix(standards): update coding standards

parent d2f749e4
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -5,8 +5,6 @@
 * Install tasks for Dropfort Update.
 */

use Drupal\Component\Utility\Random;

/**
 * Implements hook_requirements().
 */
+8 −2
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
use GuzzleHttp\Exception\RequestException;
use Drupal\Component\Utility\UrlHelper;
use Drupal\update\UpdateFetcherInterface;
use Drupal\Component\Serialization\Json;

/**
 * Implements hook_cron().
@@ -75,7 +76,7 @@ function dropfort_update_send_status(array $options = NULL) {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
    ],
    'body' => json_encode($data),
    'body' => Json::encode($data),
    'method' => 'POST',
    'max_redirects' => 3,
    // We set a lower timeout since we don't want the user
@@ -97,7 +98,12 @@ function dropfort_update_send_status(array $options = NULL) {
  // If that's the case, have Dropfort Update try again sooner.
  $last_status = time();
  foreach ($data['update_status'] as $item) {
    if (in_array($item['status'], [UpdateFetcherInterface::NOT_FETCHED, UpdateFetcherInterface::FETCH_PENDING])) {
    if (in_array($item['status'],
      [
        UpdateFetcherInterface::NOT_FETCHED,
        UpdateFetcherInterface::FETCH_PENDING,
      ]
    )) {
      // Set the last status to an hour ago since we didn't get a full
      // status run. We'll take the existing data but we treat this
      // as if it hadn't run so it gets run again next cron.