Skip to content

Commit

Permalink
[Core] Feature Smile-SA#3432, code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
vahonc committed Jan 13, 2025
1 parent 214b13d commit d3ec33b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
*/
interface CheckInterface
{
/**
* Warning status declaration.
*/
const WARNING_STATUS = 'warning';

/**
* Retrieve the unique identifier for the health check.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ class ReplicasConfigCheck implements CheckInterface
*/
private const ES_INDICES_SETTINGS_WIKI_PAGE = 'https://github.com/Smile-SA/elasticsuite/wiki/ModuleInstall#indices-settings';

public const WARNING_STATUS = 'warning';

/**
* @var IndexSettingsHelper
*/
Expand Down Expand Up @@ -94,7 +92,7 @@ public function getDescription(): string
{
$status = $this->getStatus();

if ($status === self::WARNING_STATUS) {
if ($status === CheckInterface::WARNING_STATUS) {
// Description when the replicas configuration is incorrect.
// @codingStandardsIgnoreStart
return __(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ class ShardsConfigCheck implements CheckInterface
*/
private const ES_INDICES_SETTINGS_WIKI_PAGE = 'https://github.com/Smile-SA/elasticsuite/wiki/ModuleInstall#indices-settings';

public const WARNING_STATUS = 'warning';

public const UNDEFINED_SIZE = 'N/A';

/**
Expand Down Expand Up @@ -100,7 +98,7 @@ public function getDescription(): string
$maxIndexSize = $this->getMaxIndexSize();
$status = $this->getStatus();

if ($status === self::WARNING_STATUS) {
if ($status === CheckInterface::WARNING_STATUS) {
// Description when the shard's configuration is incorrect.
// @codingStandardsIgnoreStart
return __(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

use Magento\Framework\UrlInterface;
use Magento\Framework\Notification\MessageInterface;
use Smile\ElasticsuiteCore\Api\Healthcheck\CheckInterface;
use Smile\ElasticsuiteCore\Model\Healthcheck\HealthcheckList;

/**
Expand All @@ -38,8 +39,6 @@ class GenericHealthcheckWarning implements MessageInterface
*/
private $urlBuilder;

public const WARNING_STATUS = 'warning';

/**
* Constructor.
*
Expand Down Expand Up @@ -105,7 +104,7 @@ private function getIssueCount(): int
$issuesCount = 0;

foreach ($this->healthcheckList->getChecks() as $check) {
if ($check->getStatus() === self::WARNING_STATUS) {
if ($check->getStatus() === CheckInterface::WARNING_STATUS) {
$issuesCount++;
}
}
Expand Down

0 comments on commit d3ec33b

Please sign in to comment.