This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
38
{
39
// load UNIX timestamp from redis
40
$shutdownTime = $this->redis->get($this->key);
41
if ($shutdownTime === null) {
42
return false;
43
}
44
$shutdownTime = (int) $shutdownTime;
45
46
// do not shutdown if shutdown time is in future
47
if ($shutdownTime > time()) {
48
return false;
49
}
50
51
// do not shutdown if hermes started after shutdown time
52
if ($shutdownTime < $startTime->getTimestamp()) {
53
return false;
54
}
55
56
return true;
57
}
58
59
/**
60
* {@inheritdoc}
61
*
62
* Sets to Redis value `$shutdownTime` (or current DateTime) to `$key` defined in constructor.
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.