ToArrayAccessor   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
lcom 0
cbo 2
dl 0
loc 13
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 4 1
1
<?php
2
3
namespace Underscore\Accessor;
4
5
use Underscore\Accessor;
6
use Underscore\Collection;
7
8
class ToArrayAccessor extends Accessor
9
{
10
    /**
11
     * Returns wrapped object as an array
12
     *
13
     * @param Collection $collection
14
     * @return mixed
15
     */
16 28
    public function __invoke(Collection $collection)
17
    {
18 28
        return $collection->toArray();
19
    }
20
}
21