Completed
Push — master ( 50437b...6d2b5a )
by Adam
02:31
created

Csv::toVOArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace BestServedCold\PhalueObjects\Format;
4
5
use BestServedCold\PhalueObjects\Contract\VOArrayable;
6
use BestServedCold\PhalueObjects\VOString;
7
use BestServedCold\PhalueObjects\VOArray\Mixin as VOArrayMixin;
8
9
/**
10
 * Class Csv
11
 *
12
 * @package BestServedCold\PhalueObjects\Format
13
 */
14
class Csv extends VOString implements VOArrayable
15
{
16
    use VOArrayMixin;
17
18
    /**
19
     * @param  array       $array
20
     * @param  string|null $space
21
     * @return static
22
     */
23 16
    public static function fromArray(array $array, $space = null)
24
    {
25 16
        return new static(implode(',' . $space, $array));
26
    }
27
28
    private static function fromMultiArray(array $array, $space = null)
0 ignored issues
show
Unused Code introduced by
This method is not used, and could be removed.
Loading history...
Unused Code introduced by
The parameter $array is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $space is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
29
    {
30
31
    }
32
33
    /**
34
     * @return array
35
     */
36 2
    public function toArray()
37
    {
38 2
        return explode(',', $this->getValue());
39
    }
40
}
41