Completed
Push — master ( ae5fca...d9758b )
by Julien
13s
created

EnvironmentEventCommand::getEventName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace TheAentMachine\Command;
5
6
use TheAentMachine\Aenthill\Manifest;
7
use TheAentMachine\Aenthill\Metadata;
8
use TheAentMachine\Exception\ManifestException;
9
use TheAentMachine\Exception\MissingEnvironmentVariableException;
10
11
class EnvironmentEventCommand extends JsonEventCommand
12
{
13
    protected function getEventName(): string
14
    {
15
        return 'ENVIRONMENT';
16
    }
17
18
    /**
19
     * @param array $payload
20
     * @return array|null
21
     * @throws ManifestException
22
     * @throws MissingEnvironmentVariableException
23
     */
24
    protected function executeJsonEvent(array $payload): ?array
25
    {
26
        return [
27
            Manifest::getMetadata(Metadata::ENV_NAME_KEY),
28
            Manifest::getMetadata(Metadata::ENV_TYPE_KEY)
29
        ];
30
    }
31
}
32