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

Mixin::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\VOArray;
4
5
use BestServedCold\PhalueObjects\VOArray;
6
7
/**
8
 * Class Mixin
9
 *
10
 * @package BestServedCold\PhalueObjects\VOArray
11
 */
12
trait Mixin
13
{
14
    /**
15
     * @return array
16
     */
17
    public abstract function toArray();
18
19
    /**
20
     * @param  VOArray $voArray
21
     * @return static
22
     */
23 4
    public static function fromVOArray(VOArray $voArray)
24
    {
25 4
        return static::fromArray($voArray->getValue());
0 ignored issues
show
Bug introduced by
The method fromArray() does not exist on BestServedCold\PhalueObjects\VOArray\Mixin. Did you maybe mean fromVOArray()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
26
    }
27
28
    /**
29
     * @return VOArray
30
     */
31 5
    public function toVOArray()
32
    {
33 5
        return VOArray::fromArray(self::toArray());
34
    }
35
}
36