Completed
Push — master ( b0a3db...81c3f8 )
by Christopher
02:50
created

CreateAccount::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php namespace RayEmitter\Example\BankAccount;
2
3
use C4tech\RayEmitter\Domain\Command;
4
5
final class CreateAccount extends Command
6
{
7
    /**
8
     * Constructor
9
     *
10
     * @param array $data Payload data.
11
     */
12
    public function __construct(array $data)
13
    {
14
        $this->setupPayload();
15
        $this->payload->owner = $data['owner'];
16
        $this->payload->deposit = $data['deposit'];
17
    }
18
19
    /**
20
     * Run
21
     *
22
     * Push the command into the Aggregate.
23
     * @return void
24
     */
25
    public function run()
26
    {
27
        Aggregate::handle($this);
28
    }
29
}
30