Collection   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 12
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 5 1
1
<?php
2
3
namespace Ghc\Rosetta;
4
5
use Ghc\Rosetta\Pipes\Pipeable;
6
7
class Collection extends Item implements Pipeable
8
{
9
    /**
10
     * Get the instance as an array.
11
     *
12
     * @return array
13
     */
14
    public function toArray()
15
    {
16
        return collect($this->getData())->map(function ($itemData) {
17
            return (new Item($itemData, $this->transformers))->toArray();
18
        })->toArray();
19
    }
20
}
21