Expiration does not seem to conform to the naming convention (^sspmod_monitor_([A-Z][a-zA-Z0-9_]+)+$).
This check examines a number of code elements and verifies that they conform
to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties,
methods, parameters, interfaces, classes, exceptions and special methods.
Loading history...
8
{
9
private $entityId = null;
10
private $metadata = null;
11
12
/*
13
* @return void
14
*/
15
protected function initialize()
16
{
17
$this->entityId = $this->getInput('entityId');
18
$this->metadata = $this->getInput('metadata');
19
}
20
21
/*
22
* @return void
23
*/
24
protected function invokeTest()
25
{
26
if (array_key_exists('expire', $this->metadata)) {
27
$expiration = $this->metadata['expire'];
28
if ($expiration <= time()) {
29
$this->setState(State::ERROR);
30
$this->addMessage(State::ERROR, 'Metadata expiration', $this->entityId, 'Metadata has expired');
31
} else {
32
$this->setState(State::OK);
33
$this->addMessage(State::OK, 'Metadata expiration', $this->entityId, 'Metadata will expire on ' . strftime('%c', $expiration));
34
}
35
} else {
36
$this->setState(State::OK);
37
$this->addMessage(State::OK, 'Metadata expiration', $this->entityId, 'Metadata never expires');
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.