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.

CallableDecorator::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
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
namespace ZfTable\Decorator\Cell;
10
11
use ZfTable\Decorator\Exception;
12
13
class CallableDecorator extends AbstractCellDecorator
14
{
15
16
    /**
17
     *
18
     * @var \Closure
19
     */
20
    protected $options;
21
22
    /**
23
     * Constructor
24
     *
25
     * @param array $options
26
     * @throws \Exception
27
     */
28
    public function __construct(array $options = array())
29
    {
30
        if (!isset($options['callable'])) {
31
            throw new \Exception('Please define closure');
32
        }
33
        $this->options = $options;
0 ignored issues
show
Documentation Bug introduced by
It seems like $options of type array<string,?,{"callable":"?"}> is incompatible with the declared type object<Closure> of property $options.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
34
35
    }
36
37
    /**
38
     * Rendering decorator
39
     *
40
     * @param string $context
41
     * @return string
42
     */
43
    public function render($context)
44
    {
45
        $closure = $this->options['callable'];
46
        return $closure($context, $this->getCell()->getActualRow());
47
    }
48
}
49