Completed
Push — master ( 8c9478...0f7d17 )
by Adam
02:25
created

Attribute   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 17
c 0
b 0
f 0
wmc 1
lcom 0
cbo 3
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromArray() 0 10 1
1
<?php
2
3
namespace BestServedCold\PhalueObjects\VOArray\Map;
4
5
use BestServedCold\PhalueObjects\VOArray;
6
use BestServedCold\PhalueObjects\VOClosure\KeyValue;
7
use BestServedCold\PhalueObjects\VOArray\Map;
8
9
/**
10
 * Class Attribute
11
 *
12
 * @package BestServedCold\PhalueObjects\VOArray\KeyValue
13
 */
14
class Attribute extends VOArray
15
{
16
    /**
17
     * @param  array  $array
18
     * @return VOArray
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use Attribute.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
19
     */
20 1
    public static function fromArray(array $array)
21
    {
22 1
        return parent::fromArray(
23 1
            Map::fromVariadic(
24 1
                KeyValue::fromVars(null, '="', '"'),
25 1
                array_keys($array),
26
                $array
27 1
            )->getValue()
28 1
        );
29
    }
30
}
31