Test Setup Failed
Pull Request — master (#24)
by
unknown
05:52
created

CodeTables   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A get() 0 4 1
1
<?php
2
3
namespace Scriptotek\Alma\Conf;
4
5
use Scriptotek\Alma\Client;
6
use Scriptotek\Alma\Model\ReadOnlyArrayAccess;
7
8
/**
9
 * A non-iterable collection of CodeTable resources
10
 */
11
class CodeTables implements \ArrayAccess
12
{
13
    use ReadOnlyArrayAccess;
14
15
    protected $client;
16
17
    /**
18
     * CodeTables constructor.
19
     *
20
     * @param Client $client
21
     */
22
    public function __construct(Client $client)
23
    {
24
        $this->client = $client;
25
    }
26
27
    /**
28
     * Get a CodeTable by identifier
29
     *
30
     * @param $code The identifier of a CodeTable
31
     *
32
     * @return CodeTable
33
     */
34
    public function get($code)
35
    {
36
        return CodeTable::make($this->client, $code);
37
    }
38
}
39