UsesCollectionFormat   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 80%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 14
ccs 4
cts 5
cp 0.8
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A collectionFormat() 0 9 3
1
<?php
2
3
namespace MyriadDataStore\Actions;
4
5
trait UsesCollectionFormat
6
{
7 16
    protected function collectionFormat()
8
    {
9 16
        if (property_exists($this, 'collectionFormat')
10 16
            && is_array(static::$collectionFormat)
11
        ) {
12
            return static::$collectionFormat;
13
        }
14
15 16
        return $this->defaultCollectionFormat();
16
    }
17
18
    abstract protected function defaultCollectionFormat(): array;
19
}
20