Completed
Pull Request — master (#24)
by Quentin
03:30
created

ActionCollection::resolve()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 9
ccs 0
cts 9
cp 0
rs 9.6666
cc 1
eloc 5
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Majora\Framework\Domain\Action;
4
5
use Majora\Framework\Model\EntityCollection;
6
7
/**
8
 * Custom collection class for actions.
9
 */
10
class ActionCollection extends EntityCollection
11
{
12
    /**
13
     * Resolve all actions in a row and return result as array.
14
     *
15
     * @return array
16
     */
17
    public function resolve()
18
    {
19
        return $this
20
            ->map(function (ActionInterface $action) {
21
                return $action->resolve();
22
            })
23
            ->toArray()
24
        ;
25
    }
26
}
27