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

Mixin   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 24
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1
ccs 4
cts 4
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
toArray() 0 1 ?
A fromVOArray() 0 4 1
A toVOArray() 0 4 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