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

CreateAccount   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A run() 0 4 1
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