CommandsResponseEntity::load()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 3
c 2
b 0
f 0
dl 0
loc 5
rs 10
cc 3
nc 3
nop 1
1
<?php
2
3
/**
4
 * PHP version 5.4 and 8
5
 *
6
 * @category  ResponseEntity
7
 * @package   Payever\Plugins
8
 * @author    payever GmbH <[email protected]>
9
 * @author    Hennadii.Shymanskyi <[email protected]>
10
 * @copyright 2017-2021 payever GmbH
11
 * @license   MIT <https://opensource.org/licenses/MIT>
12
 * @link      https://docs.payever.org/shopsystems/api/getting-started
13
 */
14
15
namespace Payever\ExternalIntegration\Plugins\Http\ResponseEntity;
16
17
use Payever\ExternalIntegration\Core\Http\ResponseEntity;
18
use Payever\ExternalIntegration\Plugins\Http\MessageEntity\PluginCommandEntity;
19
20
class CommandsResponseEntity extends ResponseEntity
21
{
22
    /** @var PluginCommandEntity[] */
23
    protected $commands = [];
24
25
    /**
26
     * @inheritDoc
27
     */
28
    public function load($data)
29
    {
30
        if (is_array($data)) {
31
            foreach ($data as $plainCommand) {
32
                $this->commands[] = new PluginCommandEntity($plainCommand);
33
            }
34
        }
35
    }
36
37
    /**
38
     * @return PluginCommandEntity[]
39
     */
40
    public function getCommands()
41
    {
42
        return $this->commands;
43
    }
44
}
45