Total Complexity | 6 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class HtmlPaginationMenu extends HtmlMenu{ |
||
10 | private $_page; |
||
11 | private $_pages; |
||
12 | private $_max; |
||
13 | public function __construct( $identifier, $items=array() ){ |
||
16 | } |
||
17 | /** |
||
18 | * {@inheritDoc} |
||
19 | * @see \Ajax\common\html\BaseHtml::compile() |
||
20 | */ |
||
21 | public function compile(JsUtils $js=NULL,&$view=NULL){ |
||
22 | $max=$this->_max;//\sizeof($this->content); |
||
|
|||
23 | foreach ($this->content as $item){ |
||
24 | $item->addClass("pageNum"); |
||
25 | } |
||
26 | $this->insertItem(new HtmlIcon("", "left chevron"))->setProperty("data-page", \max([1,$this->_page-1]))->addToProperty("class","_firstPage no-active"); |
||
27 | $this->addItem(new HtmlIcon("", "right chevron"))->setProperty("data-page", \min([$max,$this->_page+1]))->setProperty("data-max", $max)->addToProperty("class","_lastPage no-active"); |
||
28 | $this->asPagination(); |
||
29 | return parent::compile($js,$view); |
||
30 | } |
||
31 | |||
32 | public function setActivePage($page){ |
||
33 | $index=$page-$this->_pages[0]; |
||
34 | $item=$this->setActiveItem($index); |
||
35 | $this->_page=$page; |
||
36 | return $this; |
||
37 | } |
||
38 | |||
39 | public function getPage() { |
||
40 | return $this->_page; |
||
41 | } |
||
42 | /** |
||
43 | * @param mixed $_max |
||
44 | */ |
||
45 | public function setMax($_max) { |
||
47 | } |
||
48 | |||
49 | |||
50 | } |
||
51 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.