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.

VarAttr::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
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
namespace ZfTable\Decorator\Row;
10
11
class VarAttr extends AbstractRowDecorator
12
{
13
14
    /**
15
     * Class
16
     * @var string
17
     */
18
    protected $name;
19
20
    protected $value;
21
22
    protected $vars;
23
24
    public function __construct($options)
25
    {
26
        $this->name = $options['name'];
27
        $this->value = $options['value'];
28
        $this->vars = $options['vars'];
29
    }
30
31
    /**
32
     * Rendering decorator
33
     *
34
     * @param string $context
35
     * @return string
36
     */
37
    public function render($context)
38
    {
39
        $values = array();
40
41
        foreach ($this->vars as $var) {
42
            $actualRow = $this->getRow()->getActualRow();
43
            $values[] = $actualRow[$var];
44
        }
45
        $value = vsprintf($this->value, $values);
46
47
        $this->getRow()->addVarAttr($this->name, $value);
48
        return $context;
49
    }
50
}
51