GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Mapper::render()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
/**
3
 * ZfTable ( Module for Zend Framework 2)
4
 *
5
 * @copyright Copyright (c) 2013 Piotr Duda [email protected]
6
 * @license   MIT License
7
 */
8
9
10
namespace ZfTable\Decorator\Cell;
11
12
use ZfTable\Decorator\Exception;
13
14
class Mapper extends AbstractCellDecorator
15
{
16
17
    /**
18
     * Array of options mapping
19
     * @var array
20
     */
21
    protected $options;
22
23
24
    /**
25
     * Constructor
26
     * @param array $options
27
     * @throws Exception\InvalidArgumentException
28
     */
29
    public function __construct(array $options = array())
30
    {
31
        if (count($options) == 0) {
32
            throw new Exception\InvalidArgumentException('Array is empty');
33
        }
34
35
        $this->options = $options;
36
    }
37
38
    /**
39
     * Rendering decorator
40
     * @param string $context
41
     * @return string
42
     */
43
    public function render($context)
44
    {
45
        return (isset($this->options[$context])) ? $this->options[$context] :    $context;
46
    }
47
}
48