Collection::toArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
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