Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksantamaria committed Jan 8, 2024
1 parent 2b5ffe4 commit d02a992
Showing 1 changed file with 14 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace Drupal\tide_jira\Plugin\monitoring\SensorPlugin;

use Drupal\Core\Config\ConfigFactory;
use Drupal\jira_rest\JiraRestWrapperService;
use Drupal\monitoring\Entity\SensorConfig;
use Drupal\monitoring\Result\SensorResultInterface;
use Drupal\monitoring\SensorPlugin\SensorPluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\monitoring\SensorPlugin\SensorPluginInterface;
use Drupal\Core\Config\ConfigFactory;
use Drupal\jira_rest\JiraRestWrapperService;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
* Monitors the Section API connection.
Expand All @@ -20,21 +20,21 @@
* )
*/
class TideJiraSensorPlugin extends SensorPluginBase implements SensorPluginInterface {

/**
* The config.
*
* @var \Drupal\Core\Config\ConfigFactory
*/
protected $config;

/**
* The connector.
*
* @var \Drupal\jira_rest\JiraRestWrapperService
*/
protected $connector;

/**
* {@inheritdoc}
*/
Expand All @@ -43,7 +43,7 @@ public function __construct(SensorConfig $sensor_config, $plugin_id, $plugin_def
$this->config = $config_factory->get('tide_jira.settings');
$this->connector = $jira_rest;
}

/**
* {@inheritdoc}
*/
Expand All @@ -56,7 +56,7 @@ public static function create(ContainerInterface $container, SensorConfig $senso
$container->get('jira_rest_wrapper_service'),
);
}

/**
* {@inheritdoc}
*/
Expand All @@ -68,7 +68,7 @@ public function getDefaultConfiguration() {
'settings' => [],
];
}

/**
* {@inheritdoc}
*/
Expand All @@ -78,21 +78,19 @@ public function runSensor(SensorResultInterface $sensor_result) {
try {
$us = $this->connector->getUserService();
$account_id = $us->findUserByEmail($default_email);
}
catch (\Exception $e) {
} catch (\Exception $e) {
$sensor_result->setStatus(SensorResultInterface::STATUS_CRITICAL);
$sensor_result->setMessage('Tide Jira endpoint is not correctly configured...');
}

if (empty($account_id)) {
$sensor_result->setStatus(SensorResultInterface::STATUS_CRITICAL);
$sensor_result->setMessage(sprintf('Failed to lookup default account %s', $default_email));
}
else {
} else {
$sensor_result->setStatus(SensorResultInterface::STATUS_OK);
$sensor_result->setMessage('Tide Jira OK!');
}

}

}

0 comments on commit d02a992

Please sign in to comment.