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\Example\TableExample; |
10
|
|
|
|
11
|
|
|
use ZfTable\AbstractTable; |
12
|
|
|
|
13
|
|
|
class Attr extends AbstractTable |
14
|
|
|
{ |
15
|
|
|
|
16
|
|
|
protected $config = array( |
17
|
|
|
'name' => 'Configure attributes', |
18
|
|
|
'showPagination' => true, |
19
|
|
|
'showQuickSearch' => false, |
20
|
|
|
'showItemPerPage' => true, |
21
|
|
|
); |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @var array Definition of headers |
25
|
|
|
*/ |
26
|
|
|
protected $headers = array( |
27
|
|
|
'idcustomer' => array('title' => 'Id', 'width' => '50') , |
28
|
|
|
'name' => array('title' => 'Name' , 'separatable' => true), |
29
|
|
|
'surname' => array('title' => 'Surname' ), |
30
|
|
|
'street' => array('title' => 'Street'), |
31
|
|
|
'city' => array('title' => 'City' , 'separatable' => true), |
32
|
|
|
'active' => array('title' => 'Active' , 'width' => 100 ), |
33
|
|
|
); |
34
|
|
|
|
35
|
|
|
public function init() |
36
|
|
|
{ |
37
|
|
|
//Attr and class for table |
38
|
|
|
$this->addClass('tableClass'); |
39
|
|
|
$this->addAttr('tableAttr', 'tableAttrValue'); |
40
|
|
|
|
41
|
|
|
//Attr and class for header |
42
|
|
|
$this->getHeader('name')->addAttr('attr', 'example'); |
43
|
|
|
$this->getHeader('name')->addClass('new-class'); |
44
|
|
|
|
45
|
|
|
//Attr and class for row |
46
|
|
|
$this->getRow()->addAttr('test', 'newattr'); |
47
|
|
|
$this->getRow()->addClass('class', 'nowaklasa1'); |
|
|
|
|
48
|
|
|
|
49
|
|
|
//Attr and class for cell |
50
|
|
|
$this->getHeader('surname')->getCell()->addAttr('cellAttr', 'cellAttrValue'); |
51
|
|
|
$this->getHeader('surname')->getCell()->addDecorator('class', array('class' => 'sss')); |
52
|
|
|
|
53
|
|
|
} |
54
|
|
|
} |
55
|
|
|
|
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.