Passed
Push — master ( a8ff8f...cbaed7 )
by payever
02:47
created

CommandsResponseEntity::load()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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