Passed
Push — master ( 81c773...fe57db )
by Jonathan
12:55
created

ContextsTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 19
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getContexts() 0 5 1
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * The Imaging Source Download System PHP Wrapper
6
 *
7
 * PHP wrapper for The Imaging Source Download System Web API. Authored and supported by The Imaging Source Europe GmbH.
8
 *
9
 * @link      http://dl-gui.theimagingsource.com to learn more about The Imaging Source Download System
10
 * @link      https://github.com/jonathanmaron/theimagingsource-tisd-sdk for the canonical source repository
11
 * @license   https://github.com/jonathanmaron/theimagingsource-tisd-sdk/blob/master/LICENSE.md
12
 * @copyright © 2022 The Imaging Source Europe GmbH
13
 */
14
15
namespace Tisd\Sdk;
16
17
/**
18
 * Trait ContextsTrait
19
 *
20
 * @package Tisd\Sdk
21
 */
22
trait ContextsTrait
23
{
24
    /**
25
     * Get the array of consolidated data
26
     *
27
     * @return array
28
     */
29
    abstract protected function getConsolidated(): array;
30
31
    /**
32
     * Get the array of contexts
33
     *
34
     * @return array
35
     */
36 1
    public function getContexts(): array
37
    {
38 1
        $consolidated = $this->getConsolidated();
39
40 1
        return $consolidated['contexts'] ?? [];
41
    }
42
}
43